Exemplo n.º 1
0
 /**
  * @see Installer::checkTargetDir()
  */
 protected function checkTargetDir()
 {
     $this->ftpPath = FTPUtil::getRelativeFtpPath($this->ftp, $this->targetDir);
     if ($this->ftpPath === null) {
         throw new SystemException("cannot detect relative path coming from absolute path '" . $this->targetDir . "' at ftp server.", 14004);
     }
 }
 /**
  * Creates a new FTPUninstaller object.
  * 
  * @param	string		$targetDir		directory from the deleting files
  * @param	array		$files			delete files
  * @param	FTP		$ftp			active ftp connection
  * @param	boolean		$deleteEmptyTargetDir	delete target dir if empty
  * @param	boolean		$deleteEmptyDirectories	delete sub-directories if empty
  */
 public function __construct($targetDir, $files, FTP $ftp, $deleteEmptyTargetDir, $deleteEmptyDirectories)
 {
     $this->ftp = $ftp;
     $this->ftpPath = FTPUtil::getRelativeFtpPath($this->ftp, $targetDir);
     if (!$this->ftpPath) {
         throw new SystemException(WCF::getLanguage()->get('warnings.couldNotFindFTPPath', array('{$dir}' => $targetDir)));
     }
     parent::__construct($this->ftpPath, $files, $deleteEmptyTargetDir, $deleteEmptyDirectories);
 }