diff --git a/backend/bin/doctrine.php b/backend/bin/doctrine.php index b906d45..90aef89 100644 --- a/backend/bin/doctrine.php +++ b/backend/bin/doctrine.php @@ -27,23 +27,22 @@ use Volkszaehler\Util; // TODO replace by state class -const BACKEND_DIR = '/home/steffen/workspace/volkszaehler.org/backend'; -const DEV_ENV = TRUE; +const VZ_BACKEND_DIR = '/home/steffen/workspace/volkszaehler.org/backend'; // class autoloading -require BACKEND_DIR . '/lib/Util/ClassLoader.php'; +require VZ_BACKEND_DIR . '/lib/Util/ClassLoader.php'; $classLoaders = array(); -$classLoaders[] = new Volkszaehler\Util\ClassLoader('Doctrine', BACKEND_DIR . '/lib/vendor/Doctrine'); -$classLoaders[] = new Volkszaehler\Util\ClassLoader('Symfony', BACKEND_DIR . '/lib/vendor/Symfony'); -$classLoaders[] = new Volkszaehler\Util\ClassLoader('Volkszaehler', BACKEND_DIR . '/lib'); +$classLoaders[] = new Volkszaehler\Util\ClassLoader('Doctrine', VZ_BACKEND_DIR . '/lib/vendor/Doctrine'); +$classLoaders[] = new Volkszaehler\Util\ClassLoader('Symfony', VZ_BACKEND_DIR . '/lib/vendor/Symfony'); +$classLoaders[] = new Volkszaehler\Util\ClassLoader('Volkszaehler', VZ_BACKEND_DIR . '/lib'); foreach ($classLoaders as $loader) { $loader->register(); // register on SPL autoload stack } // load configuration -Util\Configuration::load(BACKEND_DIR . '/volkszaehler.conf'); +Util\Configuration::load(VZ_BACKEND_DIR . '/volkszaehler.conf'); $em = Volkszaehler\Dispatcher::createEntityManager(); @@ -52,8 +51,9 @@ $helperSet = new \Symfony\Component\Console\Helper\HelperSet(array( 'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em) )); + $cli = new \Symfony\Component\Console\Application('Doctrine Command Line Interface', Doctrine\ORM\Version::VERSION); -$cli->setCatchExceptions(TRUE); +$cli->setCatchExceptions(true); $cli->setHelperSet($helperSet); $cli->addCommands(array( // DBAL Commands @@ -74,7 +74,7 @@ $cli->addCommands(array( new \Doctrine\ORM\Tools\Console\Command\GenerateProxiesCommand(), new \Doctrine\ORM\Tools\Console\Command\ConvertMappingCommand(), new \Doctrine\ORM\Tools\Console\Command\RunDqlCommand(), - new \Doctrine\ORM\Tools\Console\Command\ValidateSchemaCommand(), + new \Doctrine\ORM\Tools\Console\Command\ValidateSchemaCommand() )); $cli->run(); diff --git a/backend/index.php b/backend/index.php index b9cc606..0cf7d98 100644 --- a/backend/index.php +++ b/backend/index.php @@ -1,6 +1,6 @@ * @copyright Copyright (c) 2010, The volkszaehler.org project @@ -29,6 +29,9 @@ namespace Volkszaehler; use Volkszaehler\Util; use Volkszaehler\Controller; +// enable strict error reporting +error_reporting(E_ALL); + // TODO replace by state class define('VZ_VERSION', 0.2); define('VZ_DIR', realpath(__DIR__ . '/..')); @@ -39,17 +42,14 @@ define('DEV_ENV', TRUE); require VZ_BACKEND_DIR . '/lib/Util/ClassLoader.php'; $classLoaders = array(); -$classLoaders[] = new Util\ClassLoader('Doctrine', VZ_BACKEND_DIR . '/lib/vendor/Doctrine'); -$classLoaders[] = new Util\ClassLoader('Symfony', VZ_BACKEND_DIR . '/lib/vendor/Symfony'); $classLoaders[] = new Util\ClassLoader('Volkszaehler', VZ_BACKEND_DIR . '/lib'); +$classLoaders[] = new Util\ClassLoader('Doctrine', VZ_BACKEND_DIR . '/lib/vendor/Doctrine'); +//$classLoaders[] = new Util\ClassLoader('Symfony', VZ_BACKEND_DIR . '/lib/vendor/Symfony'); // only required for the cli foreach ($classLoaders as $loader) { $loader->register(); // register on SPL autoload stack } -// enable strict error reporting -error_reporting(E_ALL); - Util\Configuration::load(VZ_BACKEND_DIR . '/volkszaehler.conf'); $fc = new Dispatcher; // spawn frontcontroller / dispatcher diff --git a/index.php b/index.php index 8e6d97c..7f28e55 100644 --- a/index.php +++ b/index.php @@ -24,6 +24,6 @@ * along with volkszaehler.org. If not, see . */ -header('Location: frontend'); +header('Location: frontend/'); ?>