/** * @depends DfAppTest::testSetupEx */ public function testShowSources() { $path = DfApp::getRuntimePath(true) . 'app/controllers/MainController.php'; $this->checkSources($this->sources($path, true)); $this->checkSources($this->sources($path, false, 20)); $this->checkSources($this->sources($path, false, 20, 5)); $pathNotExist = DfApp::getRuntimePath(true) . 'app/controllers/MainController.php1'; $this->assertTrue($this->sources($pathNotExist) == "<tbody><td><tr>File not exist</tr></td></tbody>"); }
/** * @param DfException $ex * @param string $page * @throws Exception */ private static function includePage($ex, $page = 'error') { $path = DfApp::getRuntimePath(true) . "framework/views/errors/{$page}.php"; if (file_exists($path)) { include $path; } else { if (self::$debug) { throw new Exception($ex->getMessage(), 0, $ex); } else { exit("Unable to include error page. Try to reinstall framework"); } } }
<?php /** * Daitel Framework * Basic Application Config * * @author Nikita Fedoseev <*****@*****.**> * @link https://github.com/daitel/framework * @since 0.2.1 */ $config = ['name' => 'basic', 'errors' => ['debug' => true, 'error_call' => ['controller' => 'error', 'action' => 'index', 'id' => '']], 'logger' => ['path' => DfApp::getRuntimePath(true) . "app/logs/log.txt"], 'router' => ['default' => ['controller' => 'hello']]];