diff --git a/src/Framework/Config/ConfigService.php b/src/Framework/Config/ConfigService.php index c23b719..cdc1638 100644 --- a/src/Framework/Config/ConfigService.php +++ b/src/Framework/Config/ConfigService.php @@ -47,15 +47,18 @@ public function parseResource($resource, $isCustom) } if (false == $isCustom) { - $config['version'] = APP_VERSION; - $config['debug'] = true; - $config['secret'] = 'tastphp'; - $config['env'] = 'tastphp'; - $config['timezone'] = 'UTC'; - $config['name'] = 'tastphp'; + $configInit['version'] = APP_VERSION; + $configInit['debug'] = true; + $configInit['secret'] = 'tastphp'; + $configInit['env'] = 'tastphp'; + $configInit['timezone'] = 'UTC'; + $configInit['name'] = 'tastphp'; $appConfigCacheFile = self::$configCacheDir . "/app.php"; $config = $this->getConfig($appConfigCacheFile, __BASEDIR__ . "/config/{$resource}"); + if (empty($config)) { + $config = $configInit; + } } if (!$config) { diff --git a/src/Framework/Doctrine/DoctrineService.php b/src/Framework/Doctrine/DoctrineService.php index 88c1baa..b7b25c1 100644 --- a/src/Framework/Doctrine/DoctrineService.php +++ b/src/Framework/Doctrine/DoctrineService.php @@ -10,13 +10,7 @@ class DoctrineService { public function register(Container $app) - { - //debug bar - if ($app['debug']) { - $debugbar = new \TastPHP\Framework\Debug\DebugBar(); - $app['debugbar'] = $debugbar; - } - + { $app['db.default_options'] = array( 'driver' => 'pdo_mysql', 'dbname' => 'test', diff --git a/src/Framework/Handler/WhoopsExceptionsHandler.php b/src/Framework/Handler/WhoopsExceptionsHandler.php index 5cbe273..8284039 100644 --- a/src/Framework/Handler/WhoopsExceptionsHandler.php +++ b/src/Framework/Handler/WhoopsExceptionsHandler.php @@ -2,6 +2,7 @@ namespace TastPHP\Framework\Handler; +use TastPHP\Framework\Debug\DebugBar; use TastPHP\Framework\Kernel; use Whoops\Handler\PlainTextHandler; use Whoops\Handler\PrettyPageHandler; @@ -15,6 +16,13 @@ class WhoopsExceptionsHandler public function register() { $container = Kernel::getInstance(); + + //debug bar + if ($container['debug']) { + $debugBar = new DebugBar(); + $container['debugbar'] = $debugBar; + } + if (isset($container['display_errors']) && !$container['display_errors']) { ini_set('display_errors', 'Off'); }