コード例 #1
0
 private function loadParams()
 {
     $params = explode(self::DELIMITER, $this->getParams(), 3);
     if (!is_array($params) || count($params) != 3) {
         throw new Gpf_Exception('Invalid task parameters for Gpf_Install_UnzipFileTask');
     }
     $this->sourceDirectory = $params[0];
     $this->destinationDirectory = $params[1];
     $this->excludeDirectory = $params[2];
     $this->ftp = new Gpf_Io_Ftp();
     $this->ftp->connect();
 }
コード例 #2
0
 private function checkFtpConnectionSetAndOk($hostname, $directory, $username, $password)
 {
     $ftp = new Gpf_Io_Ftp();
     $ftp->setParams($hostname, $directory, $username, $password);
     try {
         $ftp->connect();
     } catch (Gpf_Exception $e) {
         $ftp->close();
         return $e->getMessage();
     }
     try {
         $fileList = $ftp->getFileList(Gpf_Paths::INSTALL_DIR);
     } catch (Gpf_Exception $e) {
         $ftp->close();
         return $this->_('Invalid main directory');
     }
     if (array_key_exists($this->distributionFileName, array_values($fileList))) {
         $ftp->close();
         return $this->_('Invalid main directory');
     }
     $ftp->close();
     return true;
 }