mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX: ensure config variables exist
This commit is contained in:
parent
72f81447f0
commit
7a9f142c97
@ -248,19 +248,28 @@ class SS_ClassManifest {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an array of module names mapped to their paths.
|
* Returns an array of module names mapped to their paths.
|
||||||
* "Modules" in SilverStripe are simply directories with a _config.php file.
|
*
|
||||||
|
* "Modules" in SilverStripe are simply directories with a _config.php
|
||||||
|
* file.
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getModules() {
|
public function getModules() {
|
||||||
$modules = array();
|
$modules = array();
|
||||||
foreach($this->configs as $configPath) {
|
|
||||||
$modules[basename(dirname($configPath))] = dirname($configPath);
|
if($this->configs) {
|
||||||
|
foreach($this->configs as $configPath) {
|
||||||
|
$modules[basename(dirname($configPath))] = dirname($configPath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
foreach($this->configDirs as $configDir) {
|
|
||||||
$path = preg_replace('/\/_config$/', '', dirname($configDir));
|
if($this->configDirs) {
|
||||||
$modules[basename($path)] = $path;
|
foreach($this->configDirs as $configDir) {
|
||||||
|
$path = preg_replace('/\/_config$/', '', dirname($configDir));
|
||||||
|
$modules[basename($path)] = $path;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $modules;
|
return $modules;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user