Skip to content

Commit

Permalink
[5.0] Fixes the cli installer (#42116)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Richard Fath <[email protected]>
Co-authored-by: Harald Leithner <[email protected]>
  • Loading branch information
3 people authored Oct 18, 2023
1 parent f937108 commit 3207bf6
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions libraries/src/Helper/PublicFolderGeneratorHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,19 +161,18 @@ public function createPublicFolder(string $destinationPath): void
// The API root index.php
$this->createFile($fullDestinationPath . 'api/index.php', str_replace(['{{APPLICATIONPATH}}', '{{DEFINESPATH}}'], ['\'' . DIRECTORY_SEPARATOR . 'api\'', 'dirname(__DIR__)'], $this->indexTemplate));

if (is_dir(JPATH_ROOT . '/images')) {
$this->createSymlink($root . 'images', $destinationPath . 'images', JPATH_ROOT . '/');
}

// Create symlinks for all the local filesystem directories
if (PluginHelper::isEnabled('filesystem', 'local')) {
// Get all the local filesystem directories
if (\defined('_JCLI_INSTALLATION')) {
$localDirectories = [(object)['directory' => 'images']];
} elseif (PluginHelper::isEnabled('filesystem', 'local')) {
$local = PluginHelper::getPlugin('filesystem', 'local');
$localDirectories = (new Registry($local->params))->get('directories', [(object)['directory' => 'images']]);
}

foreach ($localDirectories as $localDirectory) {
if (!is_link($destinationPath . '/' . $localDirectory->directory)) {
$this->createSymlink($root . $localDirectory->directory, $destinationPath . $localDirectory->directory, JPATH_ROOT . '/');
}
// Symlink all the local filesystem directories
foreach ($localDirectories as $localDirectory) {
if (!is_link($destinationPath . '/' . $localDirectory->directory)) {
$this->createSymlink($root . $localDirectory->directory, $destinationPath . $localDirectory->directory, JPATH_ROOT . '/');
}
}
}
Expand Down

0 comments on commit 3207bf6

Please sign in to comment.