Example #1
0
 public function __construct($limit)
 {
     parent::__construct($limit);
     $db = PearDatabase::getInstance();
     $result = $db->pquery('SELECT * FROM vtiger_systems WHERE server_type = ?', array('local_backup'));
     $this->path = $db->query_result($result, 0, 'server_path');
     $this->path = $this->addTrailingSlash($this->path);
 }
Example #2
0
 public static function getInstance($type, $limit)
 {
     if ($type == self::$FTP) {
         if (empty(self::$ftpBackup)) {
             self::$ftpBackup = new Vtiger_FTPBackup($limit);
         }
         return self::$ftpBackup;
     }
     if (empty(self::$localBackup)) {
         self::$localBackup = new Vtiger_LocalBackup($limit);
     }
     return self::$localBackup;
 }
Example #3
0
 public function __construct()
 {
     $path = null;
     $limit = $this->getBackupLimit();
     if ($this->isLocalBackupEnabled()) {
         $this->location = Vtiger_Location::getInstance(Vtiger_Location::$LOCAL, $limit);
         $path = $this->location->getPath();
     } else {
         $this->location = Vtiger_Location::getInstance(Vtiger_Location::$FTP, $limit);
     }
     $this->zip = Vtiger_BackupZip::getInstance($path);
     ini_set('memory_limit', $this->getMemoryLimit());
     ini_set('max_execution_time', $this->getExecutionTimeLimit());
 }
Example #4
0
 public function __construct($limit)
 {
     parent::__construct($limit);
     $db = PearDatabase::getInstance();
     $details = array();
     $query = "select * from vtiger_systems where server_type=?";
     $result = $db->pquery($query, array('ftp_backup'));
     $rowCount = $db->num_rows($result);
     if ($rowCount > 0) {
         $this->server = $db->query_result($result, 0, 'server');
         $this->username = $db->query_result($result, 0, 'server_username');
         $this->password = $db->query_result($result, 0, 'server_password');
     } else {
         //TODO handler error;
     }
 }