本文整理汇总了PHP中Params::server方法的典型用法代码示例。如果您正苦于以下问题:PHP Params::server方法的具体用法?PHP Params::server怎么用?PHP Params::server使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Params
的用法示例。
在下文中一共展示了Params::server方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle
/**
* Handling process:
* dispatch: onParseUrl }-> caught Exception
* dispatch: onAccessCheck |-> dispatch: onException
* dispatch: onRequestStart |
* dispatch: onSendResponse }---> caught SiteRedirectException
* dispatch: onResponseSent | |-> redirect
* cleanup <-------------------/-/
*
* At any point in the process, a thrown exception will cause 'onException'
* to be dispatched, if that generates no output, then the exception is
* simply printed in a minimal html document. After the onException, normal cleanup is done
*
* @return void
* @see parseUrl
*/
public final function handle()
{
$args = array_slice(func_get_args(), 1);
try {
ob_start();
$this->parseUrl(Params::server('REQUEST_URI'));
$this->log->info(sprintf('==> Framework v%s: New Request from %s - %s <==', Loader::$FrameworkVersion, Params::server('REMOTE_ADDR'), $this->requestUrl));
$this->dispatchCallback('onAccessCheck', $this);
$this->dispatchCallback('onRequestStart', $this);
$this->dispatchCallback('onSendResponse', $this);
$this->dispatchCallback('onResponseSent', $this);
ob_end_flush();
} catch (SiteRedirectException $r) {
ob_end_clean();
header("Location: {$r->url}");
}
$this->cleanup();
}
示例2: __construct
/**
* contructor; generic initializations
* do your initializations onInitialize()
*/
public final function __construct($actionId = null)
{
$this->title = get_class($this);
$this->onInitialize();
$this->onRegisterActions();
if (!isset($actionId)) {
$actionId = Params::request(self::$ActionKey, null);
}
if (!isset($actionId)) {
throw new RuntimeException("need an action");
}
$this->action = $this->getAction($actionId);
if (!$this->action) {
throw new RuntimeException("Unknown action {$actionId}");
}
$this->stage = Params::request(self::$StageKey, Stage::VIEW);
if (Params::server('HTTPS') != 'on' && $this->action->requiresSSL) {
// TODO implement secure checking
}
}