mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-06 08:08:33 +02:00
Merge pull request #10800 from creative-commoners/pulls/5/scan-theme-dir
FIX Ensure dir exists before scanning it
This commit is contained in:
commit
86917ce291
@ -472,8 +472,11 @@ class i18nTextCollector
|
|||||||
if (!$this->modulesAndThemes) {
|
if (!$this->modulesAndThemes) {
|
||||||
$modules = ModuleLoader::inst()->getManifest()->getModules();
|
$modules = ModuleLoader::inst()->getManifest()->getModules();
|
||||||
// load themes as modules
|
// load themes as modules
|
||||||
|
$themes = [];
|
||||||
|
if (is_dir(THEMES_PATH)) {
|
||||||
$themes = array_diff(scandir(THEMES_PATH), ['..', '.']);
|
$themes = array_diff(scandir(THEMES_PATH), ['..', '.']);
|
||||||
if ($themes) {
|
}
|
||||||
|
if (!empty($themes)) {
|
||||||
foreach ($themes as $theme) {
|
foreach ($themes as $theme) {
|
||||||
if (is_dir(Path::join(THEMES_PATH, $theme))) {
|
if (is_dir(Path::join(THEMES_PATH, $theme))) {
|
||||||
$modules[self::THEME_PREFIX . $theme] = new Module(Path::join(THEMES_PATH, $theme), BASE_PATH);
|
$modules[self::THEME_PREFIX . $theme] = new Module(Path::join(THEMES_PATH, $theme), BASE_PATH);
|
||||||
|
Loading…
Reference in New Issue
Block a user