PluginProbe ʕ •ᴥ•ʔ
JetBackup – Backup, Restore & Migrate / 2.0.3
JetBackup – Backup, Restore & Migrate v2.0.3
3.1.22.3 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.8.1 1.4.9 1.5.0 1.5.1 1.5.1.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.6.0 1.6.10 1.6.11 1.6.12 1.6.13 1.6.15 1.6.5.1 1.6.8.8 1.6.9 1.6.9.1 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7.5 2.0.8.7 2.0.9.11 2.0.9.14 2.0.9.15 2.0.9.6 2.0.9.7 2.0.9.9 3.1.10.7 3.1.11.1 3.1.12.3 3.1.13.4 3.1.14.17 3.1.15.4 3.1.16.1 3.1.17.5 3.1.18.10 3.1.18.8 3.1.18.9 3.1.19.8 3.1.20.3 3.1.21.3 3.1.7.9 3.1.9.2 trunk 1.1.90 1.1.91 1.2.0 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2
backup / com / core / storage / SGStorage.php
backup / com / core / storage Last commit date
SGStorage.php 3 years ago
SGStorage.php
78 lines
1 <?php
2
3 abstract class SGStorage
4 {
5 protected $connected = false;
6 protected $activeDirectory = '';
7 protected $delegate = null;
8
9 /* Make all initializations here */
10 abstract public function init();
11
12 /* Connect to the Storage */
13 abstract public function connect();
14
15 /* Connect offline. This will ensure that redirections to other pages won't be made */
16 abstract public function connectOffline();
17
18 /* Check if it is already connected */
19 abstract public function checkConnected();
20
21 /* Get list of files inside the active directory */
22 abstract public function getListOfFiles();
23
24 /* Create a folder inside the active directory. If folder already exists, do nothing. */
25 abstract public function createFolder($folderName);
26
27 /* Download file from Storage*/
28 abstract public function downloadFile($filePath, $size, $backupId = null);
29
30 /* Upload local file to Storage */
31 abstract public function uploadFile($filePath, $task);
32
33 /* Delete file from active directory */
34 abstract public function deleteFile($fileName);
35
36 /* Delete folder and it's contents from active directory */
37 abstract public function deleteFolder($folderName);
38
39 /* Search if file or folder exists in given path */
40 abstract public function fileExists($path);
41
42 public function __construct()
43 {
44 @session_write_close();
45 @session_start();
46 $this->init();
47 $this->checkConnected();
48 }
49
50 /* NOTE: Depending on the storage type, $directory could be the ID of the directory and not the name. */
51 public function setActiveDirectory($directory)
52 {
53 $this->activeDirectory = $directory;
54 }
55
56 public function getActiveDirectory()
57 {
58 return $this->activeDirectory;
59 }
60
61 public function isConnected()
62 {
63 return $this->connected;
64 }
65
66 public function setDelegate($delegate)
67 {
68 $this->delegate = $delegate;
69 }
70
71 public function standardizeFileCreationDate($date)
72 {
73 $time = strtotime($date);
74
75 return backupGuardConvertDateTimezone(date('Y-m-d H:i:s', $time), true);
76 }
77 }
78