/** * SshAdapter constructor. * * @param array|null $driverConfig */ public function __construct($driverConfig = []) { if (!extension_loaded('ssh2')) { throw new DriverException('Missing extension "ssh2"'); } parent::__construct($driverConfig); }
/** * FtpAdapter constructor. * * @param array $driverConfig */ public function __construct($driverConfig = []) { parent::__construct($driverConfig); /** * @codeCoverageIgnoreStart */ if (!extension_loaded('ftp')) { if (!function_exists('ftp_connect')) { // This should be added by PEAR throw new Exception('Missing extension "ftp"'); } } $this->directorySeparator = '/'; $this->lsPatterns = ['unix' => ['pattern' => '/(?:(d)|.)([rwxts-]{9})\\s+(\\w+)\\s+([\\w\\d-()?.]+)\\s+' . '([\\w\\d-()?.]+)\\s+(\\w+)\\s+(\\S+\\s+\\S+\\s+\\S+)\\s+(.+)/', 'map' => ['is_dir' => 1, 'rights' => 2, 'files_inside' => 3, 'user' => 4, 'group' => 5, 'size' => 6, 'date' => 7, 'name' => 8]], 'windows' => ['pattern' => '/([0-9\\-]+)\\s+([0-9:APM]+)\\s+((<DIR>)|\\d+)\\s+(.+)/', 'map' => ['date' => 1, 'time' => 2, 'size' => 3, 'is_dir' => 4, 'name' => 5]]]; $this->setUmask($this->getUmask()); $this->getResource(); }