コード例 #1
0
 public function test_memory()
 {
     $limit = WP_Backup_Config::construct()->set_memory_limit();
     if ($limit < 64) {
         throw new Exception(sprintf(__('Memory limit could not be set and your settings are too low to use this widget, please increase your PHP memory_limit to at least %sM (%sM is recommended).'), 64, 150));
     }
 }
コード例 #2
0
 public function __construct($type, $wpdb = null, $zip_sql = true)
 {
     if (!$wpdb) {
         global $wpdb;
     }
     $this->zip_sql = $zip_sql ? class_exists('ZipArchive') : false;
     $this->type = $type;
     $this->database = $wpdb;
     $this->config = WP_Backup_Config::construct();
 }
コード例 #3
0
 public function __construct($dropbox = false, $config = false)
 {
     $this->dropbox = $dropbox ? $dropbox : Dropbox_Facade::construct();
     $this->config = $config ? $config : WP_Backup_Config::construct();
     $this->last_backup_time = $this->config->get_option('last_backup_time');
     $this->dropbox_location = null;
     if ($this->config->get_option('store_in_subfolder')) {
         $this->dropbox_location = $this->config->get_option('dropbox_location');
     }
     $this->max_file_size = $this->config->get_max_file_size();
 }
コード例 #4
0
 * @author Michael De Wildt (http://www.mikeyd.com.au/)
 * @license This program is free software; you can redistribute it and/or modify
 *          it under the terms of the GNU General Public License as published by
 *          the Free Software Foundation; either version 2 of the License, or
 *          (at your option) any later version.
 *
 *          This program is distributed in the hope that it will be useful,
 *          but WITHOUT ANY WARRANTY; without even the implied warranty of
 *          MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *          GNU General Public License for more details.
 *
 *          You should have received a copy of the GNU General Public License
 *          along with this program; if not, write to the Free Software
 *          Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA.
 */
$config = WP_Backup_Config::construct();
$backup = new WP_Backup();
if (array_key_exists('stop_backup', $_POST)) {
    check_admin_referer('backup_to_dropbox_monitor_stop');
    $backup->stop();
} else {
    if (array_key_exists('start_backup', $_POST)) {
        check_admin_referer('backup_to_dropbox_monitor_stop');
        $backup->backup_now();
        $started = true;
    }
}
?>
<script type="text/javascript" language="javascript">
	function reload() {
		jQuery.post(ajaxurl, { action:'progress' },  function(data) {
コード例 #5
0
/**
 * @return void
 */
function monitor_dropbox_backup()
{
    $config = WP_Backup_Config::construct();
    $action = $config->get_current_action();
    //5 mins to allow for socket timeouts and long uploads
    if ($action && $config->in_progress() && $action['time'] < strtotime(current_time('mysql')) - 300) {
        wp_schedule_single_event(time(), 'run_dropbox_backup_hook');
    }
}
コード例 #6
0
 public function __construct($dropbox = null, $output = null)
 {
     $this->dropbox = $dropbox ? $dropbox : Dropbox_Facade::construct();
     $this->output = $output ? $output : WP_Backup_Extension_Manager::construct()->get_output();
     $this->config = WP_Backup_Config::construct();
 }