本文整理匯總了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;