Esempio n. 1
0
 /**
  * Save the database for the given date
  */
 public function save()
 {
     // Read dumps for current date
     $numberDumps = $this->manager->getNumberOfDumpsAt();
     if ($numberDumps > 0) {
         return $this;
     }
     // Backup databases
     switch ($this->connection->getDriverName()) {
         case 'sqlite':
             return $this->backupSqliteDatabase();
         case 'mysql':
             return $this->backupMySqlDatabase();
     }
     // Clean old database
     $this->manager->cleanup();
     return $this;
 }