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


PHP static::driver方法代码示例

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


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

示例1: getFileSystem

 /**
  * 获取Filesystem
  * @return Filesystem
  */
 public static function getFileSystem()
 {
     if (is_null(static::$driver)) {
         static::$driver = \Storage::drive('local');
     }
     return static::$driver;
 }
开发者ID:xjtuwangke,项目名称:laravel-bundles,代码行数:11,代码来源:LocalStoredFile.php

示例2: setDriver

 public static function setDriver($new_driver)
 {
     $c = 'AeriaCache' . $new_driver;
     if (class_exists($c)) {
         static::$driver = $c;
     }
 }
开发者ID:caffeinalab,项目名称:aeria,代码行数:7,代码来源:AeriaCache.php

示例3: factory

 /**
  * Factory method.
  *
  * @static
  * @access   public
  * @since    1.0.0-alpha
  * @version  1.0.0-alpha
  */
 public static function factory()
 {
     self::$defaultLifeTime = Config::get('cache.lifetime', 3600);
     $driverName = ucfirst(Config::get('cache.driver'));
     $driver = '\\Plethora\\Cache\\Drivers\\' . $driverName . 'CacheDriver';
     static::$driver = new $driver();
     Log::insert('Cache type "' . Config::get('cache.driver') . '" initialized!');
 }
开发者ID:ktrzos,项目名称:plethora,代码行数:16,代码来源:Cache.php

示例4: init

 public static function init($driver = null)
 {
     if ($driver == null) {
         static::$driver = new DiskFileSystemDriver();
     } elseif ($driver instanceof LocalStorageDriverInterface) {
         static::$driver = $driver;
     } else {
         throw new Exception('driver must be instance of LocalStorageDriverInterface');
     }
 }
开发者ID:mordisacks,项目名称:localstorage,代码行数:10,代码来源:LocalStorage.php

示例5: tearDownAfterClass

 public static function tearDownAfterClass()
 {
     static::$driver = null;
     static::$pdo = null;
     foreach (static::$tempFiles as $file) {
         if (is_file($file)) {
             unlink($file);
         }
     }
     parent::tearDownAfterClass();
 }
开发者ID:phlib,项目名称:flysystem-pdo,代码行数:11,代码来源:IntegrationTest.php

示例6: __construct

 /**
  * Constructor.
  *
  * @access  protected
  */
 protected function __construct()
 {
     // Set current time
     static::$now = time();
     // Cache key allows us to invalidate all cache on configuration changes.
     static::$key = (Config::get('system.cache.prefix') ? Config::get('system.cache.prefix') : 'fansoro') . '-' . md5(ROOT_DIR . Fansoro::VERSION);
     // Get Cache Driver
     static::$driver = static::getCacheDriver();
     // Set the cache namespace to our unique key
     static::$driver->setNamespace(static::$key);
 }
开发者ID:cv0,项目名称:fansoro,代码行数:16,代码来源:Cache.php

示例7: using

 public static function using($driver, $options = null)
 {
     $class = 'Email\\' . ucfirst(strtolower($driver));
     if (!class_exists($class)) {
         throw new Exception("[core.email] : {$driver} driver not found.");
     }
     static::$driver_name = $driver;
     static::$options = $options;
     static::$driver = new $class();
     static::$driver->onInit($options);
 }
开发者ID:caffeina-core,项目名称:core,代码行数:11,代码来源:Email.php

示例8: __construct

 /**
  * Create new session.
  *
  * @return void
  */
 public function __construct()
 {
     // Does the session need to be initialized?
     if (!static::$initialized) {
         // Get the driver name from the application config and get the
         // class name for us to instantiate.
         $driver = 'native';
         $class = 'Spire\\Session\\Driver\\' . ucfirst(strtolower($driver));
         // Instantiate driver.
         static::$driver = new $class();
         // Initialize the session.
         if (static::driver()->initialize()) {
             static::$initialized = true;
         }
     }
 }
开发者ID:spire-framework,项目名称:spire,代码行数:21,代码来源:Session.php

示例9: init

 /**
  * Initialize both database and forge components
  */
 public static function init($driver)
 {
     if (empty(static::$db) && empty(static::$forge)) {
         $config = Mock_Database_DB::config($driver);
         $connection = new Mock_Database_DB($config);
         $db = Mock_Database_DB::DB($connection->set_dsn($driver), TRUE);
         CI_TestCase::instance()->ci_instance_var('db', $db);
         $loader = new CI_Loader();
         $loader->dbforge();
         $forge = CI_TestCase::instance()->ci_instance_var('dbforge');
         static::$db = $db;
         static::$forge = $forge;
         static::$driver = $driver;
     }
     return static::$db;
 }
开发者ID:DavBfr,项目名称:BlogMVC,代码行数:19,代码来源:skeleton.php

示例10: _init

 /**
  * Init, config loading.
  * @throws Amon_Request_Exception
  */
 public static function _init()
 {
     \Config::load('amon', true);
     static::$config = \Config::get('amon');
     if (!class_exists('\\ZMQContext')) {
         static::$config['protocol'] = 'http';
     }
     $class = 'Amon_Request_' . ucwords(strtolower(static::$config['protocol']));
     if (!class_exists($class)) {
         throw new Amon_Request_Exception('Can not find request driver');
     }
     try {
         static::$driver = new $class(static::$config['host'], static::$config['port'], static::$config['application_key']);
     } catch (Amon_Request_Exception $e) {
         throw $e;
     }
 }
开发者ID:maca134,项目名称:fuel-amon,代码行数:21,代码来源:request.php

示例11: using

 /**
  * Load cache drivers with a FCFS strategy
  *
  * @method using
  * @param  mixed $driver can be a single driver name string, an array of driver names or a map [ driver_name => driver_options array ]
  * @return bool   true if a driver was loaded
  * @example
  *
  *   Cache::using('redis');
  *   Cache::using(['redis','files','memory']); // Prefer "redis" over "files" over "memory" caching
  *   Cache::using([
  *         'redis' => [
  *             'host'   => '127.0.0.1',
  *             'prefix' => 'mycache',
  *          ],
  *         'files' => [
  *             'cache_dir' => '/tmp',
  *         ],
  *         'memory'
  *   ]);
  *
  */
 public static function using($driver)
 {
     foreach ((array) $driver as $key => $value) {
         if (is_numeric($key)) {
             $drv = $value;
             $conf = [];
         } else {
             $drv = $key;
             $conf = $value;
         }
         $class = 'Cache\\' . ucfirst(strtolower($drv));
         if (class_exists($class) && $class::valid()) {
             static::$driver = new $class($conf);
             return true;
         }
     }
     return false;
 }
开发者ID:caffeina-core,项目名称:core,代码行数:40,代码来源:Cache.php

示例12: driver

 /**
  * Get the session driver.
  *
  * @return Session\Driver
  */
 public static function driver()
 {
     if (is_null(static::$driver)) {
         switch (Config::get('session.driver')) {
             case 'cookie':
                 return static::$driver = new Session\Cookie();
             case 'file':
                 return static::$driver = new Session\File();
             case 'db':
                 return static::$driver = new Session\DB();
             case 'memcached':
                 return static::$driver = new Session\Memcached();
             case 'apc':
                 return static::$driver = new Session\APC();
             default:
                 throw new \Exception("Session driver [{$driver}] is not supported.");
         }
     }
     return static::$driver;
 }
开发者ID:hpaul,项目名称:Google-short,代码行数:25,代码来源:session.php

示例13: setDriver

 /**
  * Sets the database driver (string).
  */
 public static function setDriver($driver)
 {
     static::$driver = strtolower($driver);
 }
开发者ID:phpf,项目名称:micro,代码行数:7,代码来源:Database.php

示例14: setDriver

 /**
  * @param ILogStore $d driver to be set
  */
 public static function setDriver(ILogStore $d)
 {
     static::$driver = $d;
 }
开发者ID:sophokli,项目名称:HumanityEventLogger,代码行数:7,代码来源:EventLogger.php

示例15: _init

 public static function _init()
 {
     static::$driver = new \G2verify_Driver();
 }
开发者ID:ariela,项目名称:fuel-g2verify,代码行数:4,代码来源:g2verify.php


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