当前位置: 首页>>代码示例>>PHP>>正文


PHP Params::server方法代码示例

本文整理汇总了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();
 }
开发者ID:bprudent,项目名称:framework,代码行数:34,代码来源:Site.php

示例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
     }
 }
开发者ID:jcorbinredtree,项目名称:framework,代码行数:24,代码来源:Component.php


注:本文中的Params::server方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。