1 | <?php |
||
19 | class Backup |
||
20 | { |
||
21 | |||
22 | /** |
||
23 | * Database class instance |
||
24 | * @var \gplcart\core\Database $db |
||
25 | */ |
||
26 | protected $db; |
||
27 | |||
28 | /** |
||
29 | * @param Config $config |
||
30 | */ |
||
31 | public function __construct(Config $config) |
||
36 | |||
37 | /** |
||
38 | * Implements hook "module.install.before" |
||
39 | * @param null|string $result |
||
40 | */ |
||
41 | public function hookModuleInstallBefore(&$result) |
||
54 | |||
55 | /** |
||
56 | * Implements hook "module.uninstall.after" |
||
57 | */ |
||
58 | public function hookModuleUninstallAfter() |
||
62 | |||
63 | /** |
||
64 | * Implements hook "user.role.permissions" |
||
65 | * @param array $permissions |
||
66 | */ |
||
67 | public function hookUserRolePermissions(array &$permissions) |
||
73 | |||
74 | /** |
||
75 | * Implements hook "route.list" |
||
76 | * @param array $routes |
||
77 | */ |
||
78 | public function hookRouteList(array &$routes) |
||
88 | |||
89 | /** |
||
90 | * Performs backup operation |
||
91 | * @param string $handler_id |
||
92 | * @param array $data |
||
93 | * @return boolean|string |
||
94 | */ |
||
95 | public function backup($handler_id, array $data) |
||
99 | |||
100 | /** |
||
101 | * Performs restore operation |
||
102 | * @param string $handler_id |
||
103 | * @param array $data |
||
104 | * @return boolean|string |
||
105 | */ |
||
106 | public function restore($handler_id, array $data) |
||
110 | |||
111 | /** |
||
112 | * Returns an array of defined handlers |
||
113 | * @return array |
||
114 | */ |
||
115 | public function getHandlers() |
||
119 | |||
120 | /** |
||
121 | * Whether a backup already exists |
||
122 | * @param string $id |
||
123 | * @param null|string $version |
||
124 | * @return bool |
||
125 | */ |
||
126 | public function exists($id, $version = null) |
||
130 | |||
131 | /** |
||
132 | * Returns backup model |
||
133 | * @return \gplcart\modules\backup\models\Backup |
||
134 | */ |
||
135 | protected function getModel() |
||
139 | |||
140 | /** |
||
141 | * Language model instance |
||
142 | * @return \gplcart\core\models\Language $language |
||
143 | */ |
||
144 | protected function getLanguage() |
||
148 | |||
149 | /** |
||
150 | * Returns an array of database scheme |
||
151 | * @return array |
||
152 | */ |
||
153 | protected function getDbScheme() |
||
170 | |||
171 | } |
||
172 |