Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Commit

Permalink
feat(ModuleInstaller): support symlinks in dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
tntrex committed Apr 4, 2019
1 parent 12936e7 commit ca65ddc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/ModuleInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace spaceonfire\BMF;

use Bitrix\Main;
use Bitrix\Main\IO\FileDeleteException;
use Bitrix\Main\IO\FileOpenException;
use Bitrix\Main\ModuleManager;
Expand Down Expand Up @@ -43,7 +44,8 @@ public function doUninstall(): void
*/
public function isDevelopmentMode(): bool
{
return $_ENV['ENVIRONMENT'] === 'development';
$exceptionHandling = Main\Config\Configuration::getValue('exception_handling') ?? [];
return $exceptionHandling['debug'] ?? false;
}

/**
Expand Down Expand Up @@ -86,7 +88,9 @@ public function installFiles(): void
}
}

if (!file_exists($link)) {
if (is_link($target)) {
symlink(readlink($target), $link);
} else if (!file_exists($link)) {
symlink($this->findRelativePath($link, $target), $link);
}
}
Expand Down

0 comments on commit ca65ddc

Please sign in to comment.