本文整理汇总了PHP中RequestHandler::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP RequestHandler::getInstance方法的具体用法?PHP RequestHandler::getInstance怎么用?PHP RequestHandler::getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RequestHandler
的用法示例。
在下文中一共展示了RequestHandler::getInstance方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: catch
<?php
/**
* This is the application handler
* all webpage requests is sent here from a RewriteRule in .htaccess
*/
require_once 'config.php';
require_once 'RequestHandler.php';
try {
$front = RequestHandler::getInstance();
$front->excludeSession(array('api'));
//exclude session handling for these controllers
$front->route();
$page = XmlDocumentHandler::getInstance();
echo $page->render();
} catch (Exception $e) {
echo '<pre>';
echo $e->__toString();
dp($e->__toString());
//because the exception is caught it is not written to error log
echo '</pre>';
}
示例2: Registry
<?php
// all necessary settings are included
include 'app/config/init.php';
// class autoloading is started
Autoloader::init();
// application registry initializes
$registry = new Registry();
// core components loading
$registry->session = Session::getInstance();
$registry->db = MySQLDriver::getInstance();
$registry->request = RequestHandler::getInstance();
$registry->dao = new DAOFactory($registry);
$registry->router = Router::getInstance($registry);
$registry->template = new Template($registry);
// application is started
$registry->router->loader();