當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。