本文整理匯總了PHP中Framework::request方法的典型用法代碼示例。如果您正苦於以下問題:PHP Framework::request方法的具體用法?PHP Framework::request怎麽用?PHP Framework::request使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Framework
的用法示例。
在下文中一共展示了Framework::request方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: start
/**
* Start up the framework
*
* @access public
* @param string $site The site to load
* @param string $controller Which controller to use
* @return boolean True on success
* @throws Framework_Exception
*/
public static function start($site = 'Default', $controller = 'Web')
{
self::$site = Framework_Site::factory($site);
if (is_null(Framework::$log)) {
$logFile = (string) Framework::$site->config->logFile;
Framework::$log = Log::factory('file', $logFile);
}
self::$site->prepare();
self::$controller = Framework_Controller::factory($controller);
self::$request = Framework_Request::factory(self::$controller->requester);
self::$module =& self::$controller->module();
if (!in_array($controller, self::$module->controllers)) {
throw new Framework_Exception('Invalid controller requested', FRAMEWORK_MODULE_ERROR_INVALID_CONTROLLER);
}
self::$controller->authenticate();
$result = self::$controller->start();
return self::$controller->display();
}
示例2: start
/**
* start
*
* @access public
* @return mixed PEAR_Error on failure, true on success
*/
public static function start($site = 'Default', $controller = 'Web')
{
self::$site = Framework_Site::factory($site);
if (PEAR::isError(self::$site)) {
return PEAR::raiseError(self::$site->getMessage(), FRAMEWORK_ERROR_SITE);
}
if (is_null(Framework::$log)) {
$logFile = (string) Framework::$site->config->logFile;
Framework::$log = Log::factory('file', $logFile);
}
$result = self::$site->prepare();
if (PEAR::isError($result)) {
return PEAR::raiseError($result->getMessage(), FRAMEWORK_ERROR_SITE);
}
self::$controller = Framework_Controller::factory($controller);
if (PEAR::isError(self::$controller)) {
return self::$controller;
}
try {
self::$request = Framework_Request::factory(self::$controller->requester);
} catch (Framework_Exception $error) {
return PEAR::raiseError($error->getMessage(), FRAMEWORK_ERROR_REQUEST);
}
self::$module =& self::$controller->module();
if (PEAR::isError(self::$module)) {
return PEAR::raiseError(self::$module->getMessage(), FRAMEWORK_ERROR_MODULE_INIT);
}
if (!in_array($controller, self::$module->controllers)) {
return PEAR::raiseError('Invalid controller requested', FRAMEWORK_MODULE_ERROR_INVALID_CONTROLLER);
}
$result = self::$controller->authenticate();
if (PEAR::isError($result)) {
return PEAR::raiseError($result->getMessage(), FRAMEWORK_ERROR_AUTH);
}
$result = self::$controller->start();
if (PEAR::isError($result)) {
return PEAR::raiseError($result->getMessage(), FRAMEWORK_ERROR_MODULE_EVENT);
}
return self::$controller->display();
}