/** * rawlist * * @param string $dir * @return array */ private function _rawlist($dir = '/') { self::$_dir = $dir = str_replace('\\', '/', $dir); if (isset(self::$_rawlist[self::$_dir])) { return self::$_rawlist[self::$_dir]; } elseif (isset(self::$_rawlist[self::$_dir . '/'])) { return self::$_rawlist[self::$_dir . '/']; } ftp_chdir($this->_res, '/'); if (preg_match('/^[A-Z]+?:[\\*|\\/*]+(.*)/', $dir, $match)) { $dir = $match[1] ? '/' . $match[1] : '/'; } foreach ((array) ftp_rawlist($this->_res, '-A /' . IOWrapper::set($dir)) as $var) { if (mb_substr($var, -3) == ' ..') { continue; } else { preg_replace_callback('`^(d|l|\\-{1}+)(.{9}+)\\s*(?:\\d{1,3})\\s*(\\d+?|\\w+?)\\s*(\\d+?|\\w+?)\\s*(\\d*)\\s([a-zA-Z]{3}+)\\s*([0-9]{1,2}+)\\s*([0-9]{2}+):?([0-9]{2}+)\\s*(.*)$`U', array($this, '_rawlistCallback'), $var); } } self::$_rawlist[self::$_dir]['.'] = array('chmod' => '0', 'uid' => '', 'owner' => '', 'gid' => '', 'group' => '', 'size' => '0', 'mtime' => '', 'file' => '.', 'type' => 'dir'); return self::$_rawlist[self::$_dir]; }