public function limitbackup() { $fileList = $this->getBackupTimeList(); $connection = $this->getConnection(); for ($index = 0; count($fileList) > $this->limit - 1; ++$index) { $fileName = Vtiger_BackupZip::getDefaultFileName($fileList[$index]); @ftp_delete($connection, $fileName); unset($fileList[$index]); } }
public function limitbackup() { $directoryPath = $this->getPath(); $fileList = $this->getBackupTimeList(); for ($index = 0; count($fileList) > $this->limit - 1; ++$index) { $fileName = Vtiger_BackupZip::getDefaultFileName($fileList[$index]); unlink($directoryPath . $fileName); unset($fileList[$index]); } }
public static function getInstance($folder = null, $filename = null) { if (empty($filename)) { $filename = self::getDefaultFileName(); } self::$defaultPath = 'backup' . DIRECTORY_SEPARATOR; if (empty($folder)) { self::$isUserPath = false; $folder = self::getDefaultFolderPath(); } else { self::$isUserPath = true; $folder = self::addTrailingSlash($folder); self::$defaultPath = $folder; } $filename = $folder . $filename; if (extension_loaded('zip') === true) { return new Vtiger_ExtensionZip($filename); } return new Vtiger_PHPZip($filename); }
public function getBackupFileName() { return $this->zip->getBackupFileName(); }