Plugin Directory

Changeset 651647


Ignore:
Timestamp:
01/12/2013 01:52:20 PM (13 years ago)
Author:
Driskell
Message:

Upload 2.2.17

Location:
wponlinebackup/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • wponlinebackup/trunk/include/admin.php

    r650319 r651647  
    37783778        // Load the boostrap, and dump the progress
    37793779        $this->WPOnlineBackup->Load_Bootstrap();
     3780
    37803781        $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
    37823786        echo json_encode( $progress );
     3787
    37833788        exit;
    37843789    }
  • wponlinebackup/trunk/include/bootstrap.php

    r650319 r651647  
    703703        $run_time = time() - $this->start_time;
    704704
    705         // Store the current status as the latest tick status - if an error occurs we'll drop back to this one
    706         $this->last_tick_status = $this->status;
    707 
    708         // Split the references away from the real data
    709         unset( $this->last_tick_status['progress'] );
    710         $this->last_tick_status['progress'] = serialize( $this->status['progress'] );
    711 
    712705        if ( $next || $run_time > $this->max_execution_time ) {
    713706
     
    834827        if ( $exit )
    835828            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'] );
    836837
    837838        return true;
  • wponlinebackup/trunk/include/compressor_deflate.php

    r640384 r651647  
    6868    /*public*/ function WPOnlineBackup_Compressor_Deflate( & $WPOnlineBackup )
    6969    {
    70 // Store the main object
     70        // Store the main object
    7171        $this->WPOnlineBackup = & $WPOnlineBackup;
    7272
    7373        $this->rolling_buffer = false;
     74        $this->rolling_gzipname = false;
    7475
    7576        $this->register_temps = false;
     
    160161    }
    161162
    162     /*public*/ function CleanUp()
     163    /*public*/ function CleanUp( $wipe = true )
    163164    {
    164165        if ( $this->rolling_buffer !== false ) {
     
    172173            // Remove any buffer file
    173174            if ( $this->rolling_tempfile !== false ) {
    174                 $this->rolling_tempfile->Delete( true );
    175                 $this->rolling_tempfile->CleanUp();
     175                $this->rolling_tempfile->CleanUp( $wipe );
    176176            }
    177177
     
    402402
    403403// Close and delete the buffer file
    404         $this->rolling_tempfile->Delete( true );
     404        $this->rolling_tempfile->CleanUp();
    405405
    406406        if ( $this->register_temps ) $this->WPOnlineBackup->bootstrap->Unregister_Temp( $this->rolling_tempfile->Get_File_Path() );
  • wponlinebackup/trunk/include/disk.php

    r640384 r651647  
    315315    }
    316316
    317     /*public*/ function CleanUp( $wipe )
     317    /*public*/ function CleanUp( $wipe = true )
    318318    {
    319319        if ( $wipe )
  • wponlinebackup/trunk/include/files.php

    r650319 r651647  
    15531553            // Fetch a batch of files we need to mark as deleted
    15541554            $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 ' .
    15561556                'FROM `' . $this->db_prefix . 'wponlinebackup_items` i ' .
    15571557                '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  
    323323    {
    324324        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 );
    327327        }
    328328
  • wponlinebackup/trunk/include/stream_full.php

    r650319 r651647  
    353353    /*public*/ function CleanUp( $wipe = true )
    354354    {
    355         $this->compressor->CleanUp();
     355        $this->compressor->CleanUp( $wipe );
    356356        if ( $this->writer !== false )
    357357            $this->writer->CleanUp();
  • wponlinebackup/trunk/include/writer_encrypt.php

    r640384 r651647  
    352352    }
    353353
    354     /*public*/ function CleanUp()
     354    /*public*/ function CleanUp( $wipe = true )
    355355    {
    356356        // If status is 0 we haven't opened yet so there is nothing to cleanup
     
    366366        if ( $this->volatile !== false ) {
    367367
    368             // Clear from buffer disk
    369368            if ( $this->buffer_disk !== false )
    370                 $this->buffer_disk->Delete( true );
     369                $this->buffer_disk->CleanUp( $wipe );
    371370
    372371        }
     
    617616        if ( $this->buffer_disk !== false ) {
    618617
    619             $this->buffer_disk->Delete( true );
     618            $this->buffer_disk->CleanUp();
    620619
    621620            if ( $this->register_temps ) $this->WPOnlineBackup->bootstrap->Unregister_Temp( $this->buffer_disk->Get_File_Path() );
  • wponlinebackup/trunk/readme.txt

    r650320 r651647  
    7171
    7272== Changelog ==
     73
     74= 2.2.17 =
     75* Fix gzipbuffer.php No such file or directory errors
     76* Minor tweaks and fixes
    7377
    7478= 2.2.16 =
  • wponlinebackup/trunk/wponlinebackup.php

    r650319 r651647  
    55Description: 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.
    66Author: Jason Woods @ Backup Technology
    7 Version: 2.2.16
     7Version: 2.2.17
    88Author URI: http://www.backup-technology.com/
    99Licence: GPLv2 - See LICENCE.txt
     
    1919
    2020// Version
    21 define( 'WPONLINEBACKUP_VERSION', '2.2.16' );
     21define( 'WPONLINEBACKUP_VERSION', '2.2.17' );
    2222define( 'WPONLINEBACKUP_DBVERSION', 11 );
    2323
     
    101101    /*private*/ var $recovery_mode = false;
    102102
     103    /*private*/ var $_done_activate = false;
     104    /*private*/ var $_done_check_tables = false;
     105
    103106    /*public*/ function WPOnlineBackup()
    104107    {
     108        $dbv = get_option( 'wponlinebackup_db_version', '' );
     109
    105110        // 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 )
    107112            $this->Activate();
    108113
    109114        // 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 ) )
    111117            $this->Check_Tables();
    112118
     
    162168            $err = error_get_last();
    163169            if ( is_null( $err ) )
    164                 return 'No message was logged.';
     170                return __( 'No message was logged.', 'wponlinebackup' );
    165171
    166172            // 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
    167173            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'] );
    172177        }
    173178
     
    176181            $err = error_get_last();
    177182            if ( is_null( $err ) )
    178                 return 'No message was logged.';
     183                return __( 'No message was logged.', 'wponlinebackup' );
    179184
    180185            // 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
    181186            if ( defined( 'E_STRICT' ) && $err['type'] == E_STRICT )
    182                 return 'No error message was logged.';
     187                return __( 'No error message was logged.', 'wponlinebackup' );
    183188
    184189            // Try to match the error - hopefully this will match all languages as it bases solely on the layout of the error message
     
    211216            $errors = array();
    212217            foreach ( $codes as $key => $code )
    213                 $errors[] = '[Error Code ' . $code . '] ' . $messages[$key];
     218                $errors[] = sprintf( __( '[Error Code %s] %s', 'wponlinebackup' ), $code, $messages[ $key ] );
    214219
    215220            return implode( PHP_EOL, $errors );
     
    220225    {
    221226        global $wpdb;
     227
     228        // Only run once
     229        if ( $this->_done_activate )
     230            return;
     231        $this->_done_activate = true;
    222232
    223233        // Grab the database prefix to use
     
    461471    {
    462472        global $wpdb;
     473
     474        // Only run once
     475        if ( $this->_done_check_tables )
     476            return;
     477        $this->_done_check_tables = true;
    463478
    464479        // Grab the database prefix to use
     
    982997    /*private static*/ function Test_Temp( $tmp )
    983998    {
    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
    9851008        @fclose( $tmpfile );
    9861009        @unlink( $tmp . '/obfw.writetest' );
     
    9971020        if ( function_exists( 'sys_get_temp_dir' ) && ( $ret = WPOnlineBackup::Test_Temp( sys_get_temp_dir() ) ) ) return $ret;
    9981021        if ( preg_match( '/^(?:Windows|WINNT)$/i', php_uname( 's' ) ) ) {
    999             if ( $ret = WPOnlineBackup::Test_Temp( 'C:\\TEMP' ) ) return $ret;
    10001022            if ( $ret = WPOnlineBackup::Test_Temp( 'C:\\WINDOWS\\TEMP' ) ) return $ret;
    10011023        } else {
    10021024            if ( $ret = WPOnlineBackup::Test_Temp( '/tmp' ) ) return $ret;
    10031025        }
    1004         return false;
     1026
     1027        // Host didn't give us anywhere... use our tmp folder
     1028        return WPONLINEBACKUP_TMP;
    10051029    }
    10061030
Note: See TracChangeset for help on using the changeset viewer.