Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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