public function __construct(array $config = null) { if (!extension_loaded('ssh2')) { throw new Engine_Vfs_Adapter_Exception('The ssh2 extension is not installed, unable to initialize SSH-VFS'); } parent::__construct($config); }
public function __construct(array $config = null) { if (!extension_loaded('ftp')) { if (!function_exists('ftp_connect')) { // This should be added by PEAR //throw new Engine_Vfs_Adapter_Exception('The ftp extension is not installed, unable to initialize FTP-VFS'); include 'PEAR/Net/FTP/Socket.php'; if (!function_exists('ftp_connect')) { throw new Engine_Vfs_Adapter_Exception('The ftp extension is not installed and unable to load compatibility layer, unable to initialize FTP-VFS'); } } } $this->_directorySeparator = '/'; $this->_lsPatterns = array('unix' => array('pattern' => '/(?:(d)|.)([rwxts-]{9})\\s+(\\w+)\\s+([\\w\\d-()?.]+)\\s+' . '([\\w\\d-()?.]+)\\s+(\\w+)\\s+(\\S+\\s+\\S+\\s+\\S+)\\s+(.+)/', 'map' => array('is_dir' => 1, 'rights' => 2, 'files_inside' => 3, 'user' => 4, 'group' => 5, 'size' => 6, 'date' => 7, 'name' => 8)), 'windows' => array('pattern' => '/([0-9\\-]+)\\s+([0-9:APM]+)\\s+((<DIR>)|\\d+)\\s+(.+)/', 'map' => array('date' => 1, 'time' => 2, 'size' => 3, 'is_dir' => 4, 'name' => 5))); parent::__construct($config); // Set the umask $this->setUmask($this->getUmask()); // Force connect now? $this->getResource(); }