當前位置: 首頁>>代碼示例>>PHP>>正文


PHP static::handler方法代碼示例

本文整理匯總了PHP中static::handler方法的典型用法代碼示例。如果您正苦於以下問題:PHP static::handler方法的具體用法?PHP static::handler怎麽用?PHP static::handler使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在static的用法示例。


在下文中一共展示了static::handler方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: bootstrap

 /**
  * Bootstrap the session.
  *
  * @param Config $config The session config
  */
 public static function bootstrap(Config $config)
 {
     if (!$config->cookie_name) {
         $config->cookie_name = 'session_id';
     }
     if (!$config->id_format) {
         $config->id_format = Handler::DEFAULT_ID_FORMAT;
     }
     // Create and set the session save handler
     static::$handler = new Handler($config);
     session_set_save_handler(static::$handler, true);
     // Set the session name
     session_name($config->cookie_name);
     // Set the cookie parameters
     $app = Application::instance();
     $path = $app->config->base_uri ?: '/';
     $domain = $app->config->domain ?: $_SERVER['HTTP_HOST'];
     $secure = $app->request->isSecure();
     $lifetime = $config->lifetime ?: 2592000;
     session_set_cookie_params($lifetime, $path, $domain, $secure, true);
     // Start the session
     session_start();
     // Register session_write_close() as a shutdown function
     session_register_shutdown();
 }
開發者ID:pugphp,項目名稱:framework,代碼行數:30,代碼來源:Session.php

示例2: getHandler

 /**
  * share gateway
  */
 public static function getHandler()
 {
     if (is_null(static::$handler)) {
         static::$handler = new RequestHandler(new TokenResolver());
     }
     return static::$handler;
 }
開發者ID:ZerionSoftware,項目名稱:iFormBuilderAPI-v60,代碼行數:10,代碼來源:IformResource.php

示例3: getIns

 /**
  * Get the handhandle instance.
  *
  * @return self
  */
 public static function getIns()
 {
     if (!isset(static::$handler)) {
         static::$handler = new self();
     }
     return static::$handler;
 }
開發者ID:rrylee,項目名稱:phppoker,代碼行數:12,代碼來源:HandHandler.php

示例4: resolveFacadeInstance

 /**
  * Resolves the facade instance 
  * @return object FormHandler
  */
 public static function resolveFacadeInstance()
 {
     if (is_object(static::$handler)) {
         return static::$handler;
     }
     $decorator = static::getDecorator();
     return static::$handler = new FormHandler($decorator);
 }
開發者ID:raftalks,項目名稱:form,代碼行數:12,代碼來源:Form.php

示例5: __constructStatic

 /**
  * __constructStatic
  *
  * @return void
  */
 public static function __constructStatic()
 {
     static::$handler = new static();
 }
開發者ID:kewaunited,項目名稱:xcart,代碼行數:9,代碼來源:Singletons.php

示例6: getHandler

 /**
  * Return \PDO database handler
  *
  * @return \PDO
  */
 protected static function getHandler()
 {
     if (!isset(static::$handler)) {
         static::$handler = static::connectToDb();
     }
     return static::$handler;
 }
開發者ID:kingsj,項目名稱:core,代碼行數:12,代碼來源:Database.php

示例7: setHandler

 /**
  * 테마 핸들러를 지정한다.
  *
  * @param ThemeHandler $handler 테마 핸들러
  *
  * @return void
  */
 public static function setHandler(ThemeHandler $handler)
 {
     static::$handler = $handler;
 }
開發者ID:xpressengine,項目名稱:xpressengine,代碼行數:11,代碼來源:AbstractTheme.php

示例8: using

 /**
  * Load a Template Handler
  * @param  class $handler The template handler class instance
  */
 public static function using(View\Adapter $handler)
 {
     static::$handler = $handler;
 }
開發者ID:caffeina-core,項目名稱:core,代碼行數:8,代碼來源:View.php

示例9: setHandler

 static function setHandler(Handler\IOutputHandler $handler)
 {
     static::$handler = $handler;
 }
開發者ID:splitice,項目名稱:radical-common,代碼行數:4,代碼來源:OutputHandler.php

示例10: upload

 /**
  * Upload a file
  *
  * @param string $localFile Path to the file
  * @param string $remoteFileName Name of this file on remote server
  * @param string $error Error detail
  *
  * @throws Exception\ServerTypeMustSet
  * @throws Exception\ServerTypeNotSupported
  * @throws Exception\ServerHandlerInterfaceInvalid
  * @throws Exception\TargetFileUnreadable
  *
  * @return mixed Return path on the remote server when success, false otherwise
  */
 public static function upload($localFile, $remoteFileName = '', &$error = '')
 {
     $handler = null;
     if (!is_readable($localFile)) {
         throw new Exception\TargetFileUnreadable($localFile);
     }
     // Create handler instance
     if (!static::$handler) {
         foreach (static::$servers as $serverNo => $server) {
             if (!isset($server['Type'][0])) {
                 throw new Exception\ServerTypeMustSet($serverNo);
             }
             $operatorName = static::getOperator($server['Type']);
             if (!class_exists($operatorName)) {
                 throw new Exception\ServerTypeNotSupported($serverNo);
             }
             $handler = new $operatorName(isset($server['Option']) ? $server['Option'] : array());
             if (!$handler instanceof OperatorImplement) {
                 throw new Exception\ServerHandlerInterfaceInvalid($serverNo);
             }
             if ($result = static::runHandler($handler, $localFile, $remoteFileName, $error)) {
                 static::$handler = $handler;
                 return $result;
             } else {
                 unset($handler);
             }
         }
     } else {
         return static::runHandler(static::$handler, $localFile, $remoteFileName, $error);
     }
     return false;
 }
開發者ID:raincious,項目名稱:facula,代碼行數:46,代碼來源:Factory.php

示例11: addCommand

 /**
  * Add an argument(sub command) setting.
  *
  * @param   string|AbstractCommand  $command      The argument name or Console object.
  *                                                If we just send a string, the object will auto create.
  * @param   string                  $description  Console description.
  * @param   Option[]                $options      Console options.
  * @param   \Closure                $handler      The closure to execute.
  *
  * @return  AbstractCommand  Return this object to support chaining.
  *
  * @since   2.0
  */
 public function addCommand($command, $description = null, $options = array(), \Closure $handler = null)
 {
     if (!$command instanceof AbstractCommand) {
         $command = new static($command, $this->io, $this);
     }
     // Set argument detail
     $command->setApplication($this->app)->setIO($this->io);
     if ($description !== null) {
         $command->description($description);
     }
     if (count($options)) {
         $command->setOptions($options);
     }
     if ($handler) {
         $command->handler($handler);
     }
     // Set parent
     $command->setParent($this);
     // Set global options to sub command
     /** @var $option Option */
     foreach ($this->globalOptions as $option) {
         $command->addGlobalOption($option);
     }
     $name = $command->getName();
     $this->children[$name] = $command;
     return $command;
 }
開發者ID:rokite,項目名稱:windwalker,代碼行數:40,代碼來源:AbstractCommand.php

示例12: getHandler

 /**
  * Return instance of the entity manager
  *
  * @return \Doctrine\ORM\EntityManager
  */
 protected static function getHandler()
 {
     if (!isset(static::$handler)) {
         static::$handler = \Doctrine\ORM\EntityManager::create(static::getDSN(), static::getConfig());
         \XLite\Core\Database::registerCustomTypes(static::$handler);
     }
     return static::$handler;
 }
開發者ID:kirkbauer2,項目名稱:kirkxc,代碼行數:13,代碼來源:EntityManager.php

示例13: init

 public static function init($name = 'alien-session')
 {
     static::$name = $name;
     $handler_class = Config::get('session.handlers')[Config::get('session.handler')];
     static::$handler = new $handler_class();
 }
開發者ID:ramee,項目名稱:alien-framework,代碼行數:6,代碼來源:Session.php

示例14: getHandler

 /**
  * @param bool $display
  * @param Logger|null $logger
  * @return Debug
  */
 public static function getHandler($display = true, Logger $logger = null)
 {
     if (null === static::$handler) {
         static::$handler = new static($display, $logger);
     }
     return static::$handler;
 }
開發者ID:JanHuang,項目名稱:debug,代碼行數:12,代碼來源:Debug.php

示例15: using

 /**
  * Load a Template Handler
  * @param  class $handler The template handler class instance
  */
 public static function using(&$handler)
 {
     static::$handler = $handler;
 }
開發者ID:evil-enterprises,項目名稱:phpcore,代碼行數:8,代碼來源:View.php


注:本文中的static::handler方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。