Browse Source

really omit backup

master
René Wagner 1 year ago
committed by GitHub
parent
commit
0881449dbe
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      ajax.php

9
ajax.php

@ -17,6 +17,9 @@ register_shutdown_function('backup_enforce');
// Just call this function before editing the database
function db_backup()
{
// omit backup if configured
if (Config::get('dbbackup') == -1) return TRUE;
global $backed;
if($backed) return; // already done
$f= MTTPATH.'db/todolist.db';
@ -28,13 +31,13 @@ function db_backup()
function backup_enforce()
{
// omit backup if configured
if (Config::get('dbbackup') == -1) return TRUE;
// Remove backup file iff unchanged
global $backed;
if(!$backed) return TRUE;
// omit backup if configured
if (Config::get('dbbackup') == -1) return TRUE;
$f= MTTPATH.'db/todolist.db';
$b= MTTPATH.'db/backup.db';
if(are_files_identical($b,$f)) return TRUE;

Loading…
Cancel
Save