当前位置: 首页>>代码示例>>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;未经允许,请勿转载。