Skip to content

Commit

Permalink
Fixed when no app.yml file error && move debugbar code
Browse files Browse the repository at this point in the history
  • Loading branch information
xujiajun committed Oct 20, 2017
1 parent 5e620ba commit d73fbc6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
15 changes: 9 additions & 6 deletions src/Framework/Config/ConfigService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
8 changes: 1 addition & 7 deletions src/Framework/Doctrine/DoctrineService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
8 changes: 8 additions & 0 deletions src/Framework/Handler/WhoopsExceptionsHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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');
}
Expand Down

0 comments on commit d73fbc6

Please sign in to comment.