/** * Process the data returned from a directory content listing. * (Overriden) * @param type $lines the lines that were returned from the directoryt file listing */ protected function processDirectoryData($lines) { $parser = Zend_Ftp_Factory::getParser($this->_ftp->getSysType()); foreach ($lines as $line) { $fileData = $parser->parseFileDirectoryListing($line); $id = intval(substr($fileData['name'], 2, 4), 10); if (isset($this->_dir->filesState[$id]) && $this->_dir->filesState[$id]['state'] == Zend_Ftp_Directory_Nsn::FILE_STATE_FULL) { $fileData['id'] = $id; $this->_data[] = $fileData; } } $this->_count = count($this->_data); }
public function __construct($options) { parent::__construct($options); $this->ftpConfig = isset($options['ftp']['host']) ? array($options['ftp']) : $options['ftp']; if (isset($options['ftp']['remote_directory'])) { $this->ftp_path = $options['ftp']['remote_directory']; } if (isset($options['workspace'])) { $this->workspace = $options['workspace']; } Zend_Ftp_Factory::registerParserType(Zend_Ftp::UNKNOWN_SYSTEM_TYPE, 'Zend_Ftp_Parser_NsnFtpParser'); Zend_Ftp_Factory::registerInteratorType(Zend_Ftp::UNKNOWN_SYSTEM_TYPE, 'Zend_Ftp_Directory_NsnIterator'); Zend_Ftp_Factory::registerFileType(Zend_Ftp::UNKNOWN_SYSTEM_TYPE, 'Zend_Ftp_File_NsnCDRFile'); Zend_Ftp_Factory::registerDirecotryType(Zend_Ftp::UNKNOWN_SYSTEM_TYPE, 'Zend_Ftp_Directory_Nsn'); }
/** * register a new iterator class to corespond to a given parser type. * @param string $type the type of parser to register the class on. * @param string $class the parser class name. */ public static function registerDirecotryType($type, $class) { Zend_Ftp_Factory::registerTypes(array('directory' => array($type => $class))); }
/** * process the data returned from a directory content listing. * @param type $lines the lines that were returned from the directoryt file listing */ protected function processDirectoryData($lines) { $parser = Zend_Ftp_Factory::getParser($this->_ftp->getSysType()); foreach ($lines as $line) { $fileData = $parser->parseFileDirectoryListing($line); if ($fileData['type'] != 'l') { $this->_data[] = $fileData; } } $this->_count = count($this->_data); }
/** * Get the current Directory * * @return Zend_Ftp_Directory */ public function getCurrentDirectory() { if ($this->_currentDirectory === null) { $this->_connect(); $this->_currentDirectory = Zend_Ftp_Factory::getDirecotry($this->getSysType(), array($this->_currentPath, $this)); } return $this->_currentDirectory; }