本文整理匯總了PHP中Dispatcher::_instance方法的典型用法代碼示例。如果您正苦於以下問題:PHP Dispatcher::_instance方法的具體用法?PHP Dispatcher::_instance怎麽用?PHP Dispatcher::_instance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Dispatcher
的用法示例。
在下文中一共展示了Dispatcher::_instance方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Instance
/**
* Ensure that we always have but one instance of this Controller
* @return Dispatcher object
*/
public static function Instance()
{
if (self::$_instance == null) {
self::$_instance = new Dispatcher();
}
return self::$_instance;
}
示例2: getInstance
public static function getInstance()
{
if (self::$_instance == null) {
self::$_instance = new DisPatcher();
return self::$_instance;
} else {
return self::$_instance;
}
}
示例3: getInstance
/**
* @static
* @return Dispatcher
*/
public static function getInstance($pPath = null)
{
if (self::$_instance == null) {
self::$_instance = new Dispatcher();
}
if ($pPath != null) {
self::$_instance->_path = $pPath;
}
return self::$_instance;
}
示例4: getInstance
public static function getInstance()
{
try {
if (defined('BENCHMARK_TIMER') && BENCHMARK_TIMER == 'on') {
self::startTimer();
}
if (!self::$_instance) {
self::$_instance = new self();
self::$_modelAndFlow = ModelAndFlow::getInstance();
}
if (!self::$_session) {
self::$_session = Session::getInstance();
}
} catch (Exception $ex) {
if (self::$_logger) {
self::$_logger->error('Can not get a instance of the dispatcher', $ex);
}
// also throw it to the container
throw new Exception($ex->getMessage());
}
return self::$_instance;
}
示例5: getInstance
public static function getInstance($initConfig = null)
{
if (!self::$_instance) {
self::$_instance = new Dispatcher($initConfig);
}
return self::$_instance;
}