本文整理汇总了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();
}