PluginProbe
ManageWP Worker / trunk
ManageWP Worker vtrunk
4.9.38 4.9.37 4.9.36 4.9.35 4.9.34 3.8.7 3.8.8 3.9.0 3.9.1 3.9.10 3.9.11 3.9.12 3.9.13 3.9.14 3.9.15 3.9.16 3.9.17 3.9.18 3.9.19 3.9.2 3.9.20 3.9.21 3.9.22 3.9.23 3.9.24 All 73 releases
worker / src / MWP / IncrementalBackup / Database / DumpOptions.php

DumpOptions.php in ManageWP Worker trunk, at src/MWP/IncrementalBackup/Database/DumpOptions.php

138 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 * This file is part of the ManageWP Worker plugin.
4 *
5 * (c) ManageWP LLC <[email protected]>
6 *
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
9 */
10
11 class MWP_IncrementalBackup_Database_DumpOptions
12 {
13
14 /**
15 * @var string[]
16 */
17 private $tables = null;
18
19 /**
20 * @var bool
21 */
22 private $skipLockTables = true;
23
24 /**
25 * @var bool
26 */
27 private $skipExtendedInsert = true;
28
29 /**
30 * @var bool
31 */
32 private $dropTables = true;
33
34 /**
35 * @var array
36 */
37 private $connectionMethods = array();
38
39 /**
40 * @return array
41 */
42 public function getTables()
43 {
44 return $this->tables;
45 }
46
47 /**
48 * @param array $tables
49 */
50 public function setTables($tables)
51 {
52 $this->tables = $tables;
53 }
54
55 /**
56 * @return boolean
57 */
58 public function isSkipLockTables()
59 {
60 return $this->skipLockTables;
61 }
62
63 /**
64 * @param boolean $skipLockTables
65 */
66 public function setSkipLockTables($skipLockTables)
67 {
68 $this->skipLockTables = $skipLockTables;
69 }
70
71 /**
72 * @return boolean
73 */
74 public function isSkipExtendedInsert()
75 {
76 return $this->skipExtendedInsert;
77 }
78
79 /**
80 * @param boolean $skipExtendedInsert
81 */
82 public function setSkipExtendedInsert($skipExtendedInsert)
83 {
84 $this->skipExtendedInsert = $skipExtendedInsert;
85 }
86
87 /**
88 * @return boolean
89 */
90 public function isDropTables()
91 {
92 return $this->dropTables;
93 }
94
95 /**
96 * @param boolean $dropTables
97 */
98 public function setDropTables($dropTables)
99 {
100 $this->dropTables = $dropTables;
101 }
102
103 public static function createFromArray(array $options = array())
104 {
105 $dumpOptions = new self();
106
107 if (isset($options['skip_lock_tables'])) {
108 $dumpOptions->setSkipLockTables($options['skip_lock_tables']);
109 }
110
111 if (isset($options['skip_extended_insert'])) {
112 $dumpOptions->setSkipExtendedInsert($options['skip_extended_insert']);
113 }
114
115 if (isset($options['connection_methods'])) {
116 $dumpOptions->setConnectionMethods($options['connection_methods']);
117 }
118
119 return $dumpOptions;
120 }
121
122 /**
123 * @return array
124 */
125 public function getConnectionMethods()
126 {
127 return $this->connectionMethods;
128 }
129
130 /**
131 * @param array $connectionMethods
132 */
133 public function setConnectionMethods($connectionMethods)
134 {
135 $this->connectionMethods = $connectionMethods;
136 }
137 }
138