__construct() public method

Constructor.
public __construct ( array $params = [] )
$params array A hash containing connection parameters.
示例#1
0
文件: Sql.php 项目: raz0rsdge/horde
 /**
  * Constructor.
  *
  * @param array $params  A hash containing connection parameters.
  */
 public function __construct($params = array())
 {
     $params = array_merge(array('table' => 'horde_vfs'), $params);
     parent::__construct($params);
     $this->_db = $this->_params['db'];
     unset($this->_params['db']);
 }
示例#2
0
文件: File.php 项目: jubinpatel/horde
 /**
  * Constructs a new Filesystem based VFS object.
  *
  * @param array $params  A hash containing connection parameters. REQUIRED
  *                       parameters:
  *   - vfsroot: (string) The root path.
  *              Note: The user that your webserver runs as MUST have
  *              read/write permission to this directory.
  */
 public function __construct($params = array())
 {
     parent::__construct($params);
     if (!empty($this->_params['vfsroot']) && (substr($this->_params['vfsroot'], -1) == '/' || substr($this->_params['vfsroot'], -1) == '\\')) {
         $this->_params['vfsroot'] = substr($this->_params['vfsroot'], 0, strlen($this->_params['vfsroot']) - 1);
     }
     $this->_connect();
 }
示例#3
0
文件: Mongo.php 项目: horde/horde
 /**
  * Constructor.
  *
  * @param array $params  Additional parameters:
  * <pre>
  *   - collection: (string) The collection name for the folders data.
  *   - gridfs: (string) The GridFS name.
  *   - mongo_db: [REQUIRED] (Horde_Mongo_Client) A MongoDB client object.
  * </pre>
  */
 public function __construct(array $params = array())
 {
     if (!isset($params['mongo_db'])) {
         throw new InvalidArgumentException('Missing mongo_db parameter.');
     }
     parent::__construct(array_merge(array('collection' => 'horde_vfs_folders', 'gridfs' => 'horde_vfs'), $params));
     $this->_files = $this->_params['mongo_db']->selectDB(null)->getGridFS($this->_params['gridfs']);
     $this->_folders = $this->_params['mongo_db']->selectDB(null)->selectCollection($this->_params['collection']);
 }
示例#4
0
文件: Horde.php 项目: raz0rsdge/horde
 /**
  * Constructor.
  *
  * @param array $params  A hash containing connection parameters.
  * @throws Horde_Vfs_Exception
  */
 public function __construct($params = array())
 {
     parent::__construct($params);
     if (!isset($this->_params['horde_base'])) {
         throw new Horde_Vfs_Exception('Required "horde_base" not specified in VFS configuration.');
     }
     require_once $this->_params['horde_base'] . '/lib/Application.php';
     Horde_Registry::appInit('horde');
     // Create the Registry object.
     $this->_registry = $GLOBALS['registry'];
 }
示例#5
0
文件: Smb.php 项目: horde/horde
 /**
  * Constructor.
  *
  * @param array $params  A hash containing connection parameters.
  */
 public function __construct($params = array())
 {
     parent::__construct($params);
     if (!isset($this->_params['share'])) {
         return;
     }
     $share_parts = explode('/', $this->_params['share']);
     $this->_params['share'] = array_shift($share_parts);
     if ($share_parts) {
         $this->_prefix = implode('/', $share_parts);
     }
 }