1 | <?php |
||
17 | class Backup extends Module |
||
18 | { |
||
19 | |||
20 | /** |
||
21 | * Constructor |
||
22 | */ |
||
23 | public function __construct() |
||
29 | |||
30 | /** |
||
31 | * Implements hook "module.install.before" |
||
32 | */ |
||
33 | public function hookModuleInstallBefore(&$result) |
||
46 | |||
47 | /** |
||
48 | * Implements hook "module.uninstall.after" |
||
49 | */ |
||
50 | public function hookModuleUninstallAfter() |
||
54 | |||
55 | /** |
||
56 | * Implements hook "user.role.permissions" |
||
57 | * @param array $permissions |
||
58 | */ |
||
59 | public function hookUserRolePermissions(array &$permissions) |
||
65 | |||
66 | /** |
||
67 | * Implements hook "route.list" |
||
68 | * @param array $routes |
||
69 | */ |
||
70 | public function hookRouteList(array &$routes) |
||
80 | |||
81 | /** |
||
82 | * Performs backup operation |
||
83 | * @param string $handler_id |
||
84 | * @param array $data |
||
85 | * @return boolean|string |
||
86 | */ |
||
87 | public function backup($handler_id, array $data) |
||
91 | |||
92 | /** |
||
93 | * Performs restore operation |
||
94 | * @param string $handler_id |
||
95 | * @param array $data |
||
96 | * @return boolean|string |
||
97 | */ |
||
98 | public function restore($handler_id, array $data) |
||
102 | |||
103 | /** |
||
104 | * Returns an array of defined handlers |
||
105 | * @return array |
||
106 | */ |
||
107 | public function getHandlers() |
||
111 | |||
112 | /** |
||
113 | * Whether a backup already exists |
||
114 | * @param string $id |
||
115 | * @param null|string $version |
||
116 | * @return bool |
||
117 | */ |
||
118 | public function exists($id, $version = null) |
||
122 | |||
123 | /** |
||
124 | * Returns backup model |
||
125 | * @return \gplcart\modules\backup\models\Backup |
||
126 | */ |
||
127 | protected function getModelBackup() |
||
131 | |||
132 | /** |
||
133 | * Returns an array of database scheme |
||
134 | * @return array |
||
135 | */ |
||
136 | protected function getDbScheme() |
||
153 | |||
154 | } |
||
155 |