예제 #1
0
 public function __construct($output = null)
 {
     $this->config = WP_Backup_Registry::config();
     $this->dropbox = WP_Backup_Registry::dropbox();
     $this->output = $output ? $output : WP_Backup_Extension_Manager::construct()->get_output();
     $this->db_core = new WP_Backup_Database_Core();
     $this->db_plugins = new WP_Backup_Database_Plugins();
 }
 public function __construct()
 {
     $this->dropbox = WP_Backup_Registry::dropbox();
     $this->config = WP_Backup_Registry::config();
 }
 public static function setDropbox($dropbox)
 {
     self::$dropbox = $dropbox;
 }
 *          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.
 */
try {
    if ($errors = get_option('wpb2d-init-errors')) {
        delete_option('wpb2d-init-errors');
        throw new Exception(__('WordPress Backup to Dropbox failed to initialize due to these database errors.', 'wpbtd') . '<br /><br />' . $errors);
    }
    $validation_errors = null;
    $dropbox = WP_Backup_Registry::dropbox();
    $config = WP_Backup_Registry::config();
    $backup = new WP_Backup();
    $backup->create_dump_dir();
    $disable_backup_now = $config->get_option('in_progress');
    //We have a form submit so update the schedule and options
    if (array_key_exists('wpb2d_save_changes', $_POST)) {
        check_admin_referer('backup_to_dropbox_options_save');
        if (preg_match('/[^A-Za-z0-9-_.\\/]/', $_POST['dropbox_location'])) {
            $error_msg = __('The sub directory must only contain alphanumeric characters.', 'wpbtd');
            $dropbox_location = $_POST['dropbox_location'];
            $store_in_subfolder = true;
        } else {
            $config->set_schedule($_POST['day'], $_POST['time'], $_POST['frequency'])->set_option('store_in_subfolder', $_POST['store_in_subfolder'] == "on")->set_option('dropbox_location', $_POST['dropbox_location']);
        }
    } else {