-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathhelpers.php
48 lines (46 loc) · 1.52 KB
/
helpers.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
if (!function_exists('wsb_backup_db')) {
function wsb_backup_db(bool $once = false, string $connectionName = null, bool $noCleanup = false): bool {
try {
$manager = new \Webula\SmallBackup\Classes\DbBackupManager;
if (!$noCleanup) {
$manager->clear();
}
$manager->backup($connectionName, $once);
} catch (\Exception $ex) {
\Log::error($ex->getMessage());
return false;
}
return true;
}
}
if (!function_exists('wsb_backup_theme')) {
function wsb_backup_theme(bool $once = false, string $themeName = null, bool $noCleanup = false): bool {
try {
$manager = new \Webula\SmallBackup\Classes\ThemeBackupManager;
if (!$noCleanup) {
$manager->clear();
}
$manager->backup($themeName, $once);
} catch (\Exception $ex) {
\Log::error($ex->getMessage());
return false;
}
return true;
}
}
if (!function_exists('wsb_backup_storage')) {
function wsb_backup_storage(bool $once = false, string $cmsStorage = null, bool $noCleanup = false): bool {
try {
$manager = new \Webula\SmallBackup\Classes\StorageBackupManager;
if (!$noCleanup) {
$manager->clear();
}
$manager->backup($cmsStorage, $once);
} catch (\Exception $ex) {
\Log::error($ex->getMessage());
return false;
}
return true;
}
}