/** * Initialize application container. * * @return void */ public function initializeContainer() { $this->container = new Container(['kernel.database' => Fdb::class, 'kernel.config' => Config::class, 'kernel.storage' => Storage::class, 'kernel.routing' => '\\Routes::getRouter', 'kernel.debug' => Debug::enable($this->isDebug())]); $this->container->set('kernel.container', $this->container); $this->container->set('kernel.dispatch', new Dispatcher($this->container)); $this->container->set('kernel', $this); $this->registerService($this->container); $this->container->singleton('kernel.dispatch')->dispatch('handle.error'); }
/** * @param array|null $parameters * @return mixed */ public function dispatch(array $parameters = null) { Debug::enable(false)->setLogger($this->getLogger(self::LOG_ERROR)); }
<?php /** * Created by PhpStorm. * User: janhuang * Date: 15/8/14 * Time: 下午2:10 * Github: https://www.github.com/janhuang * Coding: https://www.coding.net/janhuang * SegmentFault: http://segmentfault.com/u/janhuang * Blog: http://segmentfault.com/blog/janhuang * Gmail: bboyjanhuang@gmail.com * WebSite: http://www.janhuang.me */ include __DIR__ . '/../vendor/autoload.php'; $debug = \FastD\Debug\Debug::enable(); try { echo abc(); } catch (Exception $e) { echo $e->getMessage(); }
<?php /** * Created by PhpStorm. * User: janhuang * Date: 15/8/8 * Time: 下午12:27 * Github: https://www.github.com/janhuang * Coding: https://www.coding.net/janhuang * SegmentFault: http://segmentfault.com/u/janhuang * Blog: http://segmentfault.com/blog/janhuang * Gmail: bboyjanhuang@gmail.com * WebSite: http://www.janhuang.me */ include __DIR__ . '/../vendor/autoload.php'; $logger = new \Monolog\Logger('test'); $stream = new \Monolog\Handler\StreamHandler(__DIR__ . '/test.log'); $stream->setFormatter(new Monolog\Formatter\LineFormatter("[%datetime%] >> %level_name%: >> %message% >> %context% >> %extra%\n")); $logger->pushHandler($stream); $debug = \FastD\Debug\Debug::enable(false, $logger); throw new ErrorException('test');
<?php /** * Created by PhpStorm. * User: janhuang * Date: 16/4/28 * Time: 下午11:18 * Github: https://www.github.com/janhuang * Coding: https://www.coding.net/janhuang * SegmentFault: http://segmentfault.com/u/janhuang * Blog: http://segmentfault.com/blog/janhuang * Gmail: bboyjanhuang@gmail.com * WebSite: http://www.janhuang.me */ include __DIR__ . '/../vendor/autoload.php'; use FastD\Debug\Debug; Debug::enable(false); echo abc();
<?php /** * Created by PhpStorm. * User: janhuang * Date: 16/6/4 * Time: 上午10:21 * Github: https://www.github.com/janhuang * Coding: https://www.coding.net/janhuang * Blog: http://segmentfault.com/blog/janhuang */ include __DIR__ . '/../vendor/autoload.php'; use FastD\Debug\Debug; Debug::enable(); echo $a;
public function setUp() { Debug::enable(); }
/** * Created by PhpStorm. * User: janhuang * Date: 15/8/8 * Time: 下午7:32 * Github: https://www.github.com/janhuang * Coding: https://www.coding.net/janhuang * SegmentFault: http://segmentfault.com/u/janhuang * Blog: http://segmentfault.com/blog/janhuang * Gmail: bboyjanhuang@gmail.com * WebSite: http://www.janhuang.me */ include __DIR__ . '/../vendor/autoload.php'; use FastD\Debug\Debug; $debug = Debug::enable(false); class PageException extends \FastD\Debug\Exceptions\HttpException { /** * Returns the status code. * * @return int An HTTP response status code */ public function getStatusCode() { return 400; } /** * Returns response headers. * * @return array Response headers