本文整理汇总了PHP中zibo\core\Zibo::main方法的典型用法代码示例。如果您正苦于以下问题:PHP Zibo::main方法的具体用法?PHP Zibo::main怎么用?PHP Zibo::main使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类zibo\core\Zibo
的用法示例。
在下文中一共展示了Zibo::main方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testMainWithChainedRequests
public function testMainWithChainedRequests()
{
$routerMock = $this->getMock('zibo\\core\\router\\Router', array('getRequest', 'getRoutes', 'getAliases'));
$routerMockCall = $routerMock->expects($this->once());
$routerMockCall->method('getRequest');
$routerMockCall->will($this->returnValue(new Request('', '', 'zibo\\core\\TestController', 'chainAction')));
$zibo = new Zibo($this->getBrowserMock(), $this->getConfigIOMock());
$zibo->setRouter($routerMock);
$zibo->setDispatcher(new GenericDispatcher($zibo, new ObjectFactory()));
$zibo->main();
$this->assertEquals(array('chain', 'index'), TestController::$actions);
}
示例2: Zibo
* Check Bootstrap.php to modify the base configuration
*/
use zibo\core\Zibo;
use Exception;
try {
// include the bootstrap to initialize error handling, autoloader and
// dependencies. it should also create $fileBrowser, $configIO and $environment
require_once 'bootstrap.php';
// create an instance of Zibo
$zibo = new Zibo($fileBrowser, $configIO);
$zibo->setEnvironment($environment);
$zibo->setDefaultTimeZone('Europe/Brussels');
$zibo->setDefaultLocale(array('en_IE.utf8', 'en_IE', 'en'));
// run Zibo
$zibo->bootModules();
$zibo->main();
} catch (Exception $exception) {
// uncaught exception
$class = get_class($exception);
$message = $exception->getMessage();
$trace = $exception->getTraceAsString();
// try to log the exception
try {
if (isset($zibo)) {
$zibo->triggerEvent(Zibo::EVENT_LOG, $class . ($message ? ': ' . $message : ''), $trace);
}
} catch (Exception $e) {
}
$title = 'Uncaught exception (' . $class . ')' . ($message ? ': ' . $message : '');
if (php_sapi_name() == 'cli') {
echo "\n" . $title . "\n\n" . $trace;