Changeset 651647
- Timestamp:
- 01/12/2013 01:52:20 PM (13 years ago)
- Location:
- wponlinebackup/trunk
- Files:
-
- 10 edited
-
include/admin.php (modified) (1 diff)
-
include/bootstrap.php (modified) (2 diffs)
-
include/compressor_deflate.php (modified) (4 diffs)
-
include/disk.php (modified) (1 diff)
-
include/files.php (modified) (1 diff)
-
include/stream_delta.php (modified) (1 diff)
-
include/stream_full.php (modified) (1 diff)
-
include/writer_encrypt.php (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
-
wponlinebackup.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wponlinebackup/trunk/include/admin.php
r650319 r651647 3778 3778 // Load the boostrap, and dump the progress 3779 3779 $this->WPOnlineBackup->Load_Bootstrap(); 3780 3780 3781 $progress = $this->Fetch_Progress(); 3781 if ( $progress['size'] !== '' ) $progress['size'] = WPOnlineBackup_Formatting::Fix_B( $progress['size'], true ); 3782 3783 if ( isset( $progress['size'] ) ) 3784 $progress['size'] = WPOnlineBackup_Formatting::Fix_B( $progress['size'], true ); 3785 3782 3786 echo json_encode( $progress ); 3787 3783 3788 exit; 3784 3789 } -
wponlinebackup/trunk/include/bootstrap.php
r650319 r651647 703 703 $run_time = time() - $this->start_time; 704 704 705 // Store the current status as the latest tick status - if an error occurs we'll drop back to this one706 $this->last_tick_status = $this->status;707 708 // Split the references away from the real data709 unset( $this->last_tick_status['progress'] );710 $this->last_tick_status['progress'] = serialize( $this->status['progress'] );711 712 705 if ( $next || $run_time > $this->max_execution_time ) { 713 706 … … 834 827 if ( $exit ) 835 828 exit; 829 830 // Store the current status as the latest tick status - if an error occurs we'll drop back to this one 831 // We need to do this end of Tick and not start since Update_Status will increase counters etc and we must maintain the counter or we'll fail to update during On_Shutdown as counter will be the same 832 $this->last_tick_status = $this->status; 833 834 // Split the references away from the real data 835 unset( $this->last_tick_status['progress'] ); 836 $this->last_tick_status['progress'] = serialize( $this->status['progress'] ); 836 837 837 838 return true; -
wponlinebackup/trunk/include/compressor_deflate.php
r640384 r651647 68 68 /*public*/ function WPOnlineBackup_Compressor_Deflate( & $WPOnlineBackup ) 69 69 { 70 // Store the main object70 // Store the main object 71 71 $this->WPOnlineBackup = & $WPOnlineBackup; 72 72 73 73 $this->rolling_buffer = false; 74 $this->rolling_gzipname = false; 74 75 75 76 $this->register_temps = false; … … 160 161 } 161 162 162 /*public*/ function CleanUp( )163 /*public*/ function CleanUp( $wipe = true ) 163 164 { 164 165 if ( $this->rolling_buffer !== false ) { … … 172 173 // Remove any buffer file 173 174 if ( $this->rolling_tempfile !== false ) { 174 $this->rolling_tempfile->Delete( true ); 175 $this->rolling_tempfile->CleanUp(); 175 $this->rolling_tempfile->CleanUp( $wipe ); 176 176 } 177 177 … … 402 402 403 403 // Close and delete the buffer file 404 $this->rolling_tempfile-> Delete( true);404 $this->rolling_tempfile->CleanUp(); 405 405 406 406 if ( $this->register_temps ) $this->WPOnlineBackup->bootstrap->Unregister_Temp( $this->rolling_tempfile->Get_File_Path() ); -
wponlinebackup/trunk/include/disk.php
r640384 r651647 315 315 } 316 316 317 /*public*/ function CleanUp( $wipe )317 /*public*/ function CleanUp( $wipe = true ) 318 318 { 319 319 if ( $wipe ) -
wponlinebackup/trunk/include/files.php
r650319 r651647 1553 1553 // Fetch a batch of files we need to mark as deleted 1554 1554 $result = $wpdb->get_results( 1555 $this->db_force_master . 'SELECT i.item_id, (SELECT g.backup_time FROM `' . $this->db_prefix . 'wponlinebackup_generations` g WHERE g. item_id = i.item_id ORDER BY g.backup_time DESC LIMIT 1) AS backup_time ' .1555 $this->db_force_master . 'SELECT i.item_id, (SELECT g.backup_time FROM `' . $this->db_prefix . 'wponlinebackup_generations` g WHERE g.bin = i.bin AND g.item_id = i.item_id ORDER BY g.backup_time DESC LIMIT 1) AS backup_time ' . 1556 1556 'FROM `' . $this->db_prefix . 'wponlinebackup_items` i ' . 1557 1557 'WHERE i.bin = ' . WPONLINEBACKUP_BIN_FILESYSTEM . ' AND i.`exists` = 1 AND (i.activity_id <> ' . $this->progress['activity_id'] . ' OR i.counter > ' . $this->job['counter'] . ') ' . -
wponlinebackup/trunk/include/stream_delta.php
r650319 r651647 323 323 { 324 324 if ( $this->status == 0 || $this->status == 1 ) { 325 $this->compressor->CleanUp( );326 $this->writer->CleanUp( );325 $this->compressor->CleanUp( $wipe ); 326 $this->writer->CleanUp( $wipe ); 327 327 } 328 328 -
wponlinebackup/trunk/include/stream_full.php
r650319 r651647 353 353 /*public*/ function CleanUp( $wipe = true ) 354 354 { 355 $this->compressor->CleanUp( );355 $this->compressor->CleanUp( $wipe ); 356 356 if ( $this->writer !== false ) 357 357 $this->writer->CleanUp(); -
wponlinebackup/trunk/include/writer_encrypt.php
r640384 r651647 352 352 } 353 353 354 /*public*/ function CleanUp( )354 /*public*/ function CleanUp( $wipe = true ) 355 355 { 356 356 // If status is 0 we haven't opened yet so there is nothing to cleanup … … 366 366 if ( $this->volatile !== false ) { 367 367 368 // Clear from buffer disk369 368 if ( $this->buffer_disk !== false ) 370 $this->buffer_disk-> Delete( true );369 $this->buffer_disk->CleanUp( $wipe ); 371 370 372 371 } … … 617 616 if ( $this->buffer_disk !== false ) { 618 617 619 $this->buffer_disk-> Delete( true);618 $this->buffer_disk->CleanUp(); 620 619 621 620 if ( $this->register_temps ) $this->WPOnlineBackup->bootstrap->Unregister_Temp( $this->buffer_disk->Get_File_Path() ); -
wponlinebackup/trunk/readme.txt
r650320 r651647 71 71 72 72 == Changelog == 73 74 = 2.2.17 = 75 * Fix gzipbuffer.php No such file or directory errors 76 * Minor tweaks and fixes 73 77 74 78 = 2.2.16 = -
wponlinebackup/trunk/wponlinebackup.php
r650319 r651647 5 5 Description: Online Backup for WordPress can automatically backup your WordPress database and filesystem on a configurable schedule and can incrementally send the backup compressed (and optionally encrypted using DES or AES) to our online vault where you can later retrieve it. Backups can also be emailed to you or produced on-demand and downloaded straight to your computer. You can view the current status and change settings at "Tools -> Online Backup", or by clicking the "View Status" link next to the plugin name in the Plugins list. 6 6 Author: Jason Woods @ Backup Technology 7 Version: 2.2.1 67 Version: 2.2.17 8 8 Author URI: http://www.backup-technology.com/ 9 9 Licence: GPLv2 - See LICENCE.txt … … 19 19 20 20 // Version 21 define( 'WPONLINEBACKUP_VERSION', '2.2.1 6' );21 define( 'WPONLINEBACKUP_VERSION', '2.2.17' ); 22 22 define( 'WPONLINEBACKUP_DBVERSION', 11 ); 23 23 … … 101 101 /*private*/ var $recovery_mode = false; 102 102 103 /*private*/ var $_done_activate = false; 104 /*private*/ var $_done_check_tables = false; 105 103 106 /*public*/ function WPOnlineBackup() 104 107 { 108 $dbv = get_option( 'wponlinebackup_db_version', '' ); 109 105 110 // Upgrade check... Since 3.1 the activation hook doesn't trigger during updates (WordPress #14915) 106 if ( get_option( 'wponlinebackup_db_version', '' )=== '1.0' || get_option( 'wponlinebackup_db_version', 0 ) < WPONLINEBACKUP_DBVERSION )111 if ( $dbv === '1.0' || get_option( 'wponlinebackup_db_version', 0 ) < WPONLINEBACKUP_DBVERSION ) 107 112 $this->Activate(); 108 113 109 114 // Check the DB tables exist - creating them if needed - we exclude this option during backup meaning we get the default here - 1 110 if ( get_option( 'wponlinebackup_check_tables', 1 ) ) 115 // Only do this if we are already activated though (db version will exist) 116 if ( $dbv !== '' && get_option( 'wponlinebackup_check_tables', 1 ) ) 111 117 $this->Check_Tables(); 112 118 … … 162 168 $err = error_get_last(); 163 169 if ( is_null( $err ) ) 164 return 'No message was logged.';170 return __( 'No message was logged.', 'wponlinebackup' ); 165 171 166 172 // If the last error was an E_STRICT notice it will most likely be due to our PHP 4 compatibility so pretend no message was logged 167 173 if ( defined( 'E_STRICT' ) && $err['type'] == E_STRICT ) 168 return 'No error message was logged.'; 169 170 return 'An error happened at: ' . basename( $err['file'] ) . '(' . $err['line'] . ')' . PHP_EOL . 171 $err['message']; 174 return __( 'No error message was logged.', 'wponlinebackup' ); 175 176 return sprintf( __( "An error happened at: %s(%s)\n%s", 'wponlinebackup' ), basename( $err['file'] ), $err['line'], $err['message'] ); 172 177 } 173 178 … … 176 181 $err = error_get_last(); 177 182 if ( is_null( $err ) ) 178 return 'No message was logged.';183 return __( 'No message was logged.', 'wponlinebackup' ); 179 184 180 185 // If the last error was an E_STRICT notice it will most likely be due to our PHP 4 compatibility so pretend no message was logged 181 186 if ( defined( 'E_STRICT' ) && $err['type'] == E_STRICT ) 182 return 'No error message was logged.';187 return __( 'No error message was logged.', 'wponlinebackup' ); 183 188 184 189 // Try to match the error - hopefully this will match all languages as it bases solely on the layout of the error message … … 211 216 $errors = array(); 212 217 foreach ( $codes as $key => $code ) 213 $errors[] = '[Error Code ' . $code . '] ' . $messages[$key];218 $errors[] = sprintf( __( '[Error Code %s] %s', 'wponlinebackup' ), $code, $messages[ $key ] ); 214 219 215 220 return implode( PHP_EOL, $errors ); … … 220 225 { 221 226 global $wpdb; 227 228 // Only run once 229 if ( $this->_done_activate ) 230 return; 231 $this->_done_activate = true; 222 232 223 233 // Grab the database prefix to use … … 461 471 { 462 472 global $wpdb; 473 474 // Only run once 475 if ( $this->_done_check_tables ) 476 return; 477 $this->_done_check_tables = true; 463 478 464 479 // Grab the database prefix to use … … 982 997 /*private static*/ function Test_Temp( $tmp ) 983 998 { 984 if ( ( $tmpfile = @fopen( $tmp . '/obfw.writetest', 'w' ) ) === false ) return false; 999 // Check it's valid 1000 if ( !isset( $tmp ) || $tmp === false || $tmp == '' ) 1001 return false; 1002 1003 // Try to write to it 1004 if ( ( $tmpfile = @fopen( $tmp . '/obfw.writetest', 'w' ) ) === false ) 1005 return false; 1006 1007 // Cleanup 985 1008 @fclose( $tmpfile ); 986 1009 @unlink( $tmp . '/obfw.writetest' ); … … 997 1020 if ( function_exists( 'sys_get_temp_dir' ) && ( $ret = WPOnlineBackup::Test_Temp( sys_get_temp_dir() ) ) ) return $ret; 998 1021 if ( preg_match( '/^(?:Windows|WINNT)$/i', php_uname( 's' ) ) ) { 999 if ( $ret = WPOnlineBackup::Test_Temp( 'C:\\TEMP' ) ) return $ret;1000 1022 if ( $ret = WPOnlineBackup::Test_Temp( 'C:\\WINDOWS\\TEMP' ) ) return $ret; 1001 1023 } else { 1002 1024 if ( $ret = WPOnlineBackup::Test_Temp( '/tmp' ) ) return $ret; 1003 1025 } 1004 return false; 1026 1027 // Host didn't give us anywhere... use our tmp folder 1028 return WPONLINEBACKUP_TMP; 1005 1029 } 1006 1030
Note: See TracChangeset
for help on using the changeset viewer.