moved doctrine path to config file

This commit is contained in:
Steffen Vogel 2011-03-17 11:18:42 +01:00
parent b886d84802
commit 01d39068b9
3 changed files with 22 additions and 13 deletions

View file

@ -57,20 +57,26 @@ $config['db']['password'] = 'demo';
*/
$config['db']['dbname'] = 'volkszaehler';
/*
/**
* For administration tasks (used by doctrine cli and the setup script)
* the following $['db']['admin'] settings will be merged with $config['db']
*/
//$config['db']['admin']['user'] = 'vz_admin';
//$config['db']['admin']['password'] = 'admin_demo';
/**
* @var string path of the sqlite database
* @link http://www.doctrine-project.org/projects/dbal/2.0/docs/reference/configuration/en
*/
//$config['db']['path'] = 'volkszaehler';
/**
* Set to NULL to use PHP's include path
* @var string path of Doctrine library
* @link http://www.php.net/manual/en/ini.core.php#ini.include-path
*/
$config['lib']['doctrine'] = VZ_DIR . '/lib/vendor/Doctrine';
/** @var boolean disables some optimizations. Only use it when you exactly know what you are doing. */
$config['devmode'] = FALSE;

View file

@ -36,19 +36,21 @@ define('VZ_DIR', realpath(__DIR__ . '/..'));
define('VZ_VERSION', '0.2');
// class autoloading
require VZ_DIR . '/lib/Util/ClassLoader.php';
require_once VZ_DIR . '/lib/Util/ClassLoader.php';
require_once VZ_DIR . '/lib/Util/Configuration.php';
// load configuration
Util\Configuration::load(VZ_DIR . '/etc/volkszaehler.conf');
$classLoaders = array(
new Util\ClassLoader('Volkszaehler', VZ_DIR . '/lib'),
new Util\ClassLoader('Doctrine', VZ_DIR . '/lib/vendor/Doctrine')
new Util\ClassLoader('Doctrine', Util\Configuration::read('lib.doctrine')),
new Util\ClassLoader('Volkszaehler', VZ_DIR . '/lib')
);
foreach ($classLoaders as $loader) {
$loader->register(); // register on SPL autoload stack
}
Util\Configuration::load(VZ_DIR . '/etc/volkszaehler.conf');
$r = new Router();
$r->run();
$r->view->send();

View file

@ -30,20 +30,21 @@ define('VZ_DIR', realpath(__DIR__ . '/../..'));
// class autoloading
require_once VZ_DIR . '/lib/Util/ClassLoader.php';
require_once VZ_DIR . '/lib/Util/Configuration.php';
// load configuration
Util\Configuration::load(VZ_DIR . '/etc/volkszaehler.conf');
$classLoaders = array(
new Volkszaehler\Util\ClassLoader('Doctrine', VZ_DIR . '/lib/vendor/Doctrine'),
new Volkszaehler\Util\ClassLoader('Symfony', VZ_DIR . '/lib/vendor/Doctrine/Symfony'),
new Volkszaehler\Util\ClassLoader('Volkszaehler', VZ_DIR . '/lib')
new Util\ClassLoader('Doctrine', Util\Configuration::read('lib.doctrine')),
new Util\ClassLoader('Symfony', VZ_DIR . '/lib/vendor/Doctrine/Symfony'),
new Util\ClassLoader('Volkszaehler', VZ_DIR . '/lib')
);
foreach ($classLoaders as $loader) {
$loader->register(); // register on SPL autoload stack
}
// load configuration
Util\Configuration::load(VZ_DIR . '/etc/volkszaehler.conf');
$em = Volkszaehler\Router::createEntityManager(TRUE); // get admin credentials
$helperSet = new \Symfony\Component\Console\Helper\HelperSet(array(