| 1 |
<?php |
<?php |
| 2 |
// $Id: dba.module,v 1.55 2007/10/15 17:07:16 dww Exp $ |
// $Id: dba.module,v 1.56 2007/10/15 20:05:04 dww Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 337 |
} |
} |
| 338 |
|
|
| 339 |
function dba_auto_backup() { |
function dba_auto_backup() { |
| 340 |
|
$backup_started = time(); |
| 341 |
$path = variable_get('dba_auto_backup_path', file_directory_temp()); |
$path = variable_get('dba_auto_backup_path', file_directory_temp()); |
| 342 |
// See what tables (if any) the admin wants us to only backup |
// See what tables (if any) the admin wants us to only backup |
| 343 |
// the schema, not the actual data. we need it as an array, so we |
// the schema, not the actual data. we need it as an array, so we |
| 378 |
if ($fp = fopen($path ."/$filename", 'wb')) { |
if ($fp = fopen($path ."/$filename", 'wb')) { |
| 379 |
fwrite($fp, $backup); |
fwrite($fp, $backup); |
| 380 |
fclose($fp); |
fclose($fp); |
| 381 |
variable_set('dba_auto_backup_last', time()); |
variable_set('dba_auto_backup_last', $backup_started); |
| 382 |
|
|
| 383 |
// If enabled, email a copy of the backup to the site administrator. |
// If enabled, email a copy of the backup to the site administrator. |
| 384 |
if (variable_get('dba_auto_backup_mail', 0)) { |
if (variable_get('dba_auto_backup_mail', 0)) { |