set lib.doctrine = NULL to use php's include path, thx to jahir
This commit is contained in:
parent
fd6dc000d3
commit
855655931d
3 changed files with 10 additions and 5 deletions
|
@ -43,7 +43,7 @@ require_once VZ_DIR . '/lib/Util/Configuration.php';
|
|||
Util\Configuration::load(VZ_DIR . '/etc/volkszaehler.conf');
|
||||
|
||||
$classLoaders = array(
|
||||
new Util\ClassLoader('Doctrine', Util\Configuration::read('lib.doctrine')),
|
||||
new Util\ClassLoader('Doctrine', (is_null(Util\Configuration::read('lib.doctrine')) ? 'Doctrine' : Util\Configuration::read('lib.doctrine')),
|
||||
new Util\ClassLoader('Volkszaehler', VZ_DIR . '/lib')
|
||||
);
|
||||
|
||||
|
|
|
@ -47,11 +47,11 @@ class ClassLoader {
|
|||
* If neither a namespace nor an include path is given, the ClassLoader will
|
||||
* be responsible for loading all classes, thereby relying on the PHP include_path.
|
||||
*
|
||||
* @param string $ns The namespace of the classes to load.
|
||||
* @param string $namespace The namespace of the classes to load.
|
||||
* @param string $includePath The base include path to use.
|
||||
*/
|
||||
public function __construct($ns = NULL, $includePath = NULL) {
|
||||
$this->namespace = $ns;
|
||||
public function __construct($namespace = NULL, $includePath = NULL) {
|
||||
$this->namespace = $namespace;
|
||||
$this->includePath = $includePath;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,12 @@ class Configuration {
|
|||
|
||||
$values = self::$values;
|
||||
foreach ($tree as $part) {
|
||||
$values = $values[$part];
|
||||
if (isset($values[$part])) {
|
||||
$values = $values[$part];
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return $values;
|
||||
|
|
Loading…
Add table
Reference in a new issue