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


PHP static::request方法代码示例

本文整理汇总了PHP中static::request方法的典型用法代码示例。如果您正苦于以下问题:PHP static::request方法的具体用法?PHP static::request怎么用?PHP static::request使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在static的用法示例。


在下文中一共展示了static::request方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: makeRequest

 public function makeRequest(Request $request)
 {
     static::$request = $request;
     return static::$response;
 }
开发者ID:payneteasy,项目名称:php-library-payneteasy-api,代码行数:5,代码来源:FakeGatewayClient.php

示例2: find

 /**
  * Find a single element by its ID
  *
  * @param  mixed $id
  * @return Daursu\Xero\BaseModel
  */
 public static function find($id)
 {
     $object = new static();
     $response = $object->request('GET', sprintf('%s/%s', $object->getUrl(), $id));
     return $response ? $object : false;
 }
开发者ID:daursu,项目名称:xero,代码行数:12,代码来源:BaseModel.php

示例3: disconnect

 /**
  * Disconnect current \Hybrid\Request connection
  * 
  * @static
  * @access	public
  */
 public static function disconnect()
 {
     static::$request = null;
 }
开发者ID:huzairy,项目名称:feedmalaya,代码行数:10,代码来源:input.php

示例4: __construct

 /**
  * Builds the required static objects for later use
  *
  * @return void
  * @author Dan Cox
  */
 public function __construct()
 {
     // Build Aura's Router
     $factory = new RouterFactory();
     static::$router = $factory->newInstance();
     // Build the request object
     static::$request = Request::createFromGlobals();
 }
开发者ID:Danzabar,项目名称:schedules,代码行数:14,代码来源:Route.php

示例5: __construct

 /**
  * Runner constructor.
  */
 public function __construct()
 {
     static::$request = Request::createFromGlobals();
     if (!static::$request->hasPreviousSession()) {
         $session = new Session();
         $session->start();
         static::$request->setSession($session);
     }
 }
开发者ID:spasquier,项目名称:sv-egg-giver,代码行数:12,代码来源:Runner.php

示例6: getRequest

 /**
  * Retrieve a object of JSON-RPC request.
  *
  * @return  object  The request object.
  */
 public static function getRequest()
 {
     if (static::$request == null) {
         $http = Http\Request::getInstance();
         $body = $http->getBody();
         static::$request = Request::fromJson($body);
     }
     return static::$request;
 }
开发者ID:sp1rytus,项目名称:ixias,代码行数:14,代码来源:Server.php

示例7:

 static function get_request()
 {
     if (!isset(static::$request)) {
         $version = @$_POST['version'];
         // If API version changes, could return
         // different EnvayaSMS_Request instance
         // to support multiple phone versions
         static::$request = new EnvayaSMS_Request();
     }
     return static::$request;
 }
开发者ID:romsun,项目名称:EnvayaSMS,代码行数:11,代码来源:EnvayaSMS.php

示例8: get

 public static function get()
 {
     if (isset(static::$request)) {
         return static::$request;
     }
     if (isset($_SERVER['REQUEST_METHOD'])) {
         static::$request = new HTTPRequest();
     } else {
         throw new RequestTypeNotImplementedException();
     }
     return static::$request;
 }
开发者ID:matthieusieben,项目名称:sedra,代码行数:12,代码来源:Request.php

示例9: __construct

 public function __construct()
 {
     $dir = __DIR__ . '/db/';
     $file = 'oauth.sqlite';
     if (!file_exists($dir . $file)) {
         include_once $dir . 'rebuild_db.php';
     }
     static::$storage = new OAuth2_Storage_Pdo(array('dsn' => 'sqlite:' . $dir . $file));
     static::$request = OAuth2_Request::createFromGlobals();
     static::$server = new OAuth2_Server(static::$storage);
     static::$server->addGrantType(new OAuth2_GrantType_AuthorizationCode(static::$storage));
 }
开发者ID:emildev35,项目名称:processmaker,代码行数:12,代码来源:Server.php

示例10: init

 /**
  * Builds the routes then processes the request to the controller and method.
  * @param array $config The config array with the controller path and routes.
  */
 public static function init(array $config)
 {
     static::$controller_path = $config['controller_path'];
     foreach ($config['routes'] as $route => $args) {
         if (!is_array($args)) {
             $args = array($args, 'params' => array());
         }
         static::$routes[$route] = $args;
     }
     static::$request = static::get_request();
     static::route();
 }
开发者ID:nirix-old,项目名称:ant,代码行数:16,代码来源:ant.php

示例11: __construct

 public function __construct()
 {
     $dir = __DIR__ . '/db/';
     $file = 'oauth.sqlite';
     if (!file_exists($dir . $file)) {
         include_once $dir . 'rebuild_db.php';
     }
     static::$storage = new Pdo(array('dsn' => 'sqlite:' . $dir . $file));
     // create array of supported grant types
     $grantTypes = array('authorization_code' => new AuthorizationCode(static::$storage), 'user_credentials' => new UserCredentials(static::$storage));
     static::$request = Request::createFromGlobals();
     static::$server = new OAuth2Server(static::$storage, array('enforce_state' => true, 'allow_implicit' => true), $grantTypes);
 }
开发者ID:raven7,项目名称:Restler,代码行数:13,代码来源:Server.php

示例12: __construct

 public function __construct()
 {
     static::$instance = $this;
     static::$request = $_REQUEST;
     static::$get = $_GET;
     static::$post = $_POST;
     static::$server = $_SERVER;
     static::$headers = static::getAllHeaders();
     static::$requestUri = static::prepareRequestUri();
     static::$baseUrl = static::prepareBaseUrl();
     static::$basePath = static::prepareBasePath();
     static::$pathInfo = static::preparePathInfo();
     static::$method = static::$server['REQUEST_METHOD'];
 }
开发者ID:nirix,项目名称:radium,代码行数:14,代码来源:Request.php

示例13: __construct

 public function __construct($config)
 {
     static::$config = $config;
     static::$request = $this->request();
     static::$cache = new Cache();
     $this->connection = static::connect();
     if (isset($_REQUEST['upgrade'])) {
         $this->checkDBVersion();
     }
     if (isset($_REQUEST['cssbump'])) {
         $this->setOption('cssv', time());
     }
     if (rand(0, 100) <= 10) {
         Auth::cleanSessions();
     }
     // 10% chance; should be moved to a cron job
 }
开发者ID:tiger154,项目名称:prototype,代码行数:17,代码来源:Core.php

示例14: getAll

 public function getAll()
 {
     static::$request = array_merge(['METHOD' => $_SERVER['REQUEST_METHOD']], ["SERVER" => $_SERVER ? $_SERVER : []], ["COOKIE" => $_COOKIE ? $_COOKIE : []], ['SESSION'] ? $_SESSION : []);
     try {
         switch ($_SERVER['REQUEST_METHOD']) {
             case 'GET':
                 array_push(static::$request, ["GET" => $_GET ? $_GET : []]);
                 break;
             case 'POST':
                 !empty($_GET) ?: array_push(static::$request, ["GET" => $_GET ? $_GET : []]);
                 !empty($_POST) ?: array_push(static::$request, ["POST" => $_POST ? $_POST : []]);
                 break;
         }
     } catch (\Exception $e) {
         //дописать логер
     }
     return static::$request;
 }
开发者ID:NickTaporuk,项目名称:core_silver,代码行数:18,代码来源:Request.php

示例15: run

 public function run()
 {
     $this->beforeRun();
     static::$response = new Response();
     static::$response->init();
     static::$request = new Request();
     try {
         $this->initComponents();
         $this->router();
     } catch (HttpException $exception) {
         if (ob_get_level() > 0) {
             ob_end_clean();
         }
         static::$response->setStatusCode($exception->statusCode);
         ob_start();
         require Url::to($this->getErrorView($exception->statusCode));
         $content = ob_get_contents();
         ob_end_clean();
         static::$response->data = $content;
     } catch (GboxException $exception) {
         if (ob_get_level() > 0) {
             ob_end_clean();
         }
         static::$response->setStatusCode(500);
         ob_start();
         require Url::to($this->getErrorView(500));
         $content = ob_get_contents();
         ob_end_clean();
         static::$response->data = $content;
     } catch (Exception $exception) {
         if (ob_get_level() > 0) {
             ob_end_clean();
         }
         static::$response->setStatusCode(500);
         ob_start();
         require Url::to($this->getErrorView(500));
         $content = ob_get_contents();
         ob_end_clean();
         static::$response->data = $content;
     }
     static::$response->send();
     $this->afterRun();
 }
开发者ID:roxgueldevs,项目名称:gboxframework,代码行数:43,代码来源:gbox.php


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