PluginProbe
UpdraftPlus: WP Backup & Migration Plugin / 1.8.13
UpdraftPlus: WP Backup & Migration Plugin v1.8.13
1.26.7 1.26.6 1.26.5 1.26.4 1.26.3 1.9.19 1.9.25 1.9.26 1.9.30 1.9.31 1.9.32 1.9.4 1.9.40 1.9.41 1.9.42 1.9.43 1.9.44 1.9.45 1.9.46 1.9.5 1.9.50 1.9.51 1.9.60 1.9.62 1.9.63 All 371 releases
updraftplus / methods / s3generic.php

s3generic.php in UpdraftPlus: WP Backup & Migration Plugin 1.8.13, at methods/s3generic.php

60 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 require_once(UPDRAFTPLUS_DIR.'/methods/s3.php');
4
5 # Migrate options to new-style storage - Jan 2014
6 if (!is_array(UpdraftPlus_Options::get_updraft_option('updraft_s3generic')) && '' != UpdraftPlus_Options::get_updraft_option('updraft_s3generic_login', '')) {
7 $opts = array(
8 'accesskey' => UpdraftPlus_Options::get_updraft_option('updraft_s3generic_login'),
9 'secretkey' => UpdraftPlus_Options::get_updraft_option('updraft_s3generic_pass'),
10 'path' => UpdraftPlus_Options::get_updraft_option('updraft_s3generic_remote_path'),
11 'endpoint' => UpdraftPlus_Options::get_updraft_option('updraft_s3generic_endpoint')
12 );
13 UpdraftPlus_Options::update_updraft_option('updraft_s3generic', $opts);
14 UpdraftPlus_Options::delete_updraft_option('updraft_s3generic_login');
15 UpdraftPlus_Options::delete_updraft_option('updraft_s3generic_pass');
16 UpdraftPlus_Options::delete_updraft_option('updraft_s3generic_remote_path');
17 UpdraftPlus_Options::delete_updraft_option('updraft_s3generic_endpoint');
18 }
19
20 class UpdraftPlus_BackupModule_s3generic extends UpdraftPlus_BackupModule_s3 {
21
22 protected function set_endpoint($obj, $region = '') {
23 $config = $this->get_config();
24 $endpoint = ($region != '' && $region != 'n/a') ? $region : $config['endpoint'];
25 global $updraftplus;
26 $updraftplus->log("Set endpoint: $endpoint");
27 $obj->setEndpoint($endpoint);
28 }
29
30 public function get_credentials() {
31 return array('updraft_s3generic');
32 }
33
34 function get_config() {
35 global $updraftplus;
36 $opts = $updraftplus->get_job_option('updraft_s3generic');
37 if (!is_array($opts)) $opts = array('accesskey' => '', 'secretkey' => '', 'path' => '');
38 $opts['whoweare'] = 'S3';
39 $opts['whoweare_long'] = __('S3 (Compatible)', 'updraftplus');
40 $opts['key'] = 's3generic';
41 return $opts;
42 }
43
44 public function config_print() {
45 // 5th parameter = control panel URL
46 // 6th = image HTML
47 $this->config_print_engine('s3generic', 'S3', __('S3 (Compatible)', 'updraftplus'), 'S3', '', '', true);
48 }
49
50 public function config_print_javascript_onready() {
51 $this->config_print_javascript_onready_engine('s3generic', 'S3');
52 }
53
54 public function credentials_test() {
55 $this->credentials_test_engine($this->get_config());
56 }
57
58 }
59 ?>
60