Exemple #1
0
 /**
  * Performs a database backup.
  *
  * @param array|null $ignoreDataTables If set to an empty array, a full database backup will be performed. If set
  *                                     to an array or database table names, they will get merged with the default
  *                                     list of table names whose data is to be ignored during a database backup.
  *
  * @return bool|string The file path to the database backup, or false if something went wrong.
  */
 public function backup($ignoreDataTables = null)
 {
     $backup = new DbBackup();
     if ($ignoreDataTables !== null) {
         $backup->setIgnoreDataTables($ignoreDataTables);
     }
     if (($backupFile = $backup->run()) !== false) {
         return $backupFile;
     }
     return false;
 }
 /**
  * Performs a database backup.
  *
  * @param array|null $ignoreDataTables If set to an empty array, a full database backup will be performed. If set
  *                                     to an array or database table names, they will get merged with the default
  *                                     list of table names whose data is to be ignored during a database backup.
  *
  * @return bool|string The file path to the database backup, or false if something went wrong.
  */
 public function backup($ignoreDataTables = null)
 {
     $backup = new DbBackup();
     if ($ignoreDataTables !== null) {
         $backup->setIgnoreDataTables($ignoreDataTables);
     }
     if (($backupFile = $backup->run()) !== false) {
         // Fire an 'onBackup' event
         $this->onBackup(new Event($this, array('filePath' => $backupFile)));
         return $backupFile;
     }
     return false;
 }