Exemple #1
0
 public static function getInstance($type = 'File', $options = array())
 {
     if (self::$handler === null) {
         $class = 'Driver_Storage_' . $type;
         self::$handler = new $class($options);
     }
     return self::$handler;
 }
Exemple #2
0
 public static function connect($Driver = '')
 {
     $Driver = empty($Driver) ? C('STORAGE_DRIVER') : $Driver;
     $class = $Driver . 'Storage';
     self::$handler = new $class();
 }
Exemple #3
0
 /**
  * 连接分布式文件系统
  * @access public
  * @param string $type 文件类型
  * @param array $options  配置数组
  * @return void
  */
 public static function connect($type = 'File', $options = array())
 {
     require_once "Storage/Driver/" . ucwords($type) . ".class.php";
     $class = $type;
     self::$handler = new $class($options);
 }