Ejemplo n.º 1
0
 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]);
     }
 }
Ejemplo n.º 2
0
 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]);
     }
 }
Ejemplo n.º 3
0
 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);
 }
Ejemplo n.º 4
0
 public function getBackupFileName()
 {
     return $this->zip->getBackupFileName();
 }