mirror of
https://github.com/friendica/friendica
synced 2024-11-11 13:42:54 +00:00
Bugfixing Addon-config
This commit is contained in:
parent
d6dd74690d
commit
f2f8c97b7c
1 changed files with 13 additions and 3 deletions
|
@ -17,6 +17,11 @@ class ConfigCacheLoader
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
const SUBDIRECTORY = '/config/';
|
const SUBDIRECTORY = '/config/';
|
||||||
|
/**
|
||||||
|
* The addon sub-directory
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
const ADDONDIRECTORY = '/addon/';
|
||||||
|
|
||||||
private $baseDir;
|
private $baseDir;
|
||||||
private $configDir;
|
private $configDir;
|
||||||
|
@ -129,12 +134,17 @@ class ConfigCacheLoader
|
||||||
* ];
|
* ];
|
||||||
*
|
*
|
||||||
* @param string $filename
|
* @param string $filename
|
||||||
|
* @param bool $addon True, if a config for an addon should be loaded
|
||||||
* @return array The configuration
|
* @return array The configuration
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public function loadConfigFile($filename)
|
public function loadConfigFile($filename, $addon = false)
|
||||||
{
|
{
|
||||||
|
if ($addon) {
|
||||||
|
$filepath = $this->baseDir . self::ADDONDIRECTORY . self::SUBDIRECTORY . $filename . ".config.php";
|
||||||
|
} else {
|
||||||
$filepath = $this->configDir . $filename . ".config.php";
|
$filepath = $this->configDir . $filename . ".config.php";
|
||||||
|
}
|
||||||
|
|
||||||
if (!file_exists($filepath)) {
|
if (!file_exists($filepath)) {
|
||||||
throw new \Exception('Error loading non-existent config file ' . $filepath);
|
throw new \Exception('Error loading non-existent config file ' . $filepath);
|
||||||
|
|
Loading…
Reference in a new issue