|
@@ 159-163 (lines=5) @@
|
| 156 |
|
$fileLocation = $this->cycleDatabaseBackupFiles($fileLocation); |
| 157 |
|
global $databaseConfig; |
| 158 |
|
$compression = $this->Config()->get("compression"); |
| 159 |
|
if ($compression == "gzip") { |
| 160 |
|
$command = "mysqldump -u ".$databaseConfig["username"]." -p".$databaseConfig["password"]." -h ".$databaseConfig["server"]." ".$databaseConfig["database"]." | gzip > ".$fileLocation; |
| 161 |
|
} else { |
| 162 |
|
$command = "mysqldump -u ".$databaseConfig["username"]." -p".$databaseConfig["password"]." -h ".$databaseConfig["server"]." ".$databaseConfig["database"]." > ".$fileLocation; |
| 163 |
|
} |
| 164 |
|
$this->DebugMessage = exec($command); |
| 165 |
|
$this->FullLocation = $fileLocation; |
| 166 |
|
clearstatcache(); |
|
@@ 217-221 (lines=5) @@
|
| 214 |
|
$this->saveToSession(); |
| 215 |
|
global $databaseConfig; |
| 216 |
|
$compression = $this->Config()->get("compression"); |
| 217 |
|
if ($compression == "gzip") { |
| 218 |
|
$command = "gunzip < ".$fileLocation. " | mysql -u ".$databaseConfig["username"]." -p".$databaseConfig["password"]." -h ".$databaseConfig["server"]." ".$databaseConfig["database"]." "; |
| 219 |
|
} else { |
| 220 |
|
$command = "mysql -u ".$databaseConfig["username"]." -p".$databaseConfig["password"]." -h ".$databaseConfig["server"]." ".$databaseConfig["database"]." < ".$fileLocation; |
| 221 |
|
} |
| 222 |
|
exec($command); |
| 223 |
|
//reset list of backups ... |
| 224 |
|
$this->requireDefaultRecords(); |