PluginProbe ʕ •ᴥ•ʔ
JetBackup – Backup, Restore & Migrate / 1.4.9
JetBackup – Backup, Restore & Migrate v1.4.9
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 / lib / SGState.php
backup / com / lib Last commit date
BackupGuard 5 years ago Dropbox 5 years ago Request 5 years ago SGArchive.php 5 years ago SGAuthClient.php 5 years ago SGCallback.php 5 years ago SGCdrEntry.php 5 years ago SGCharsetHandler.php 5 years ago SGDBState.php 5 years ago SGEntry.php 5 years ago SGFileEntry.php 5 years ago SGFileState.php 5 years ago SGMigrateState.php 5 years ago SGMysqldump.php 5 years ago SGReloadHandler.php 5 years ago SGReloader.php 5 years ago SGReloaderState.php 5 years ago SGReviewManager.php 5 years ago SGState.php 5 years ago SGStatsRequests.php 5 years ago SGUploadHandler.php 5 years ago SGUploadState.php 5 years ago
SGState.php
190 lines
1 <?php
2
3 require_once(SG_LIB_PATH.'SGFileState.php');
4 require_once(SG_LIB_PATH.'SGDBState.php');
5 require_once(SG_LIB_PATH.'SGUploadState.php');
6 require_once(SG_LIB_PATH.'SGMigrateState.php');
7
8 class SGState
9 {
10 protected $inprogress = false;
11 protected $type = '';
12 protected $token = '';
13 protected $action = '';
14 protected $actionId = null;
15 protected $actionStartTs = 0;
16 protected $backupFileName = '';
17 protected $backupFilePath = '';
18 protected $progress = 0;
19 protected $warningsFound = false;
20 protected $pendingStorageUploads = array();
21 protected $restoreMode = '';
22 protected $restoreFiles = array();
23 protected $offset = 0;
24
25 function __construct()
26 {
27 }
28
29 public function setInprogress($inprogress)
30 {
31 $this->inprogress = $inprogress;
32 }
33
34 public function setToken($token)
35 {
36 $this->token = $token;
37 }
38
39 public function setAction($action)
40 {
41 $this->action = $action;
42 }
43
44 public function setType($type)
45 {
46 $this->type = $type;
47 }
48
49 public function setActionId($actionId)
50 {
51 $this->actionId = $actionId;
52 }
53
54 public function setActionStartTs($actionStartTs)
55 {
56 $this->actionStartTs = $actionStartTs;
57 }
58
59 public function setBackupFileName($name)
60 {
61 $this->backupFileName = $name;
62 }
63
64 public function setBackupFilePath($backupFilePath)
65 {
66 $this->backupFilePath = $backupFilePath;
67 }
68
69 public function setProgress($progress)
70 {
71 $this->progress = $progress;
72 }
73
74 public function setWarningsFound($warningsFound)
75 {
76 $this->warningsFound = $warningsFound;
77 }
78
79 public function setRestoreFiles($restoreFiles)
80 {
81 $this->restoreFiles = $restoreFiles;
82 }
83
84 public function setPendingStorageUploads($pendingStorageUploads)
85 {
86 $this->pendingStorageUploads = $pendingStorageUploads;
87 }
88
89 public function setRestoreMode($mode){
90 $this->restoreMode = $mode;
91 }
92
93 public function getRestoreMode(){
94 return $this->restoreMode;
95 }
96
97 public function getInprogress()
98 {
99 return $this->inprogress;
100 }
101
102 public function getToken()
103 {
104 return $this->token;
105 }
106
107 public function getAction()
108 {
109 return $this->action;
110 }
111
112 public function getType()
113 {
114 return $this->type;
115 }
116
117 public function getActionId()
118 {
119 return $this->actionId;
120 }
121
122 public function getActionStartTs()
123 {
124 return $this->actionStartTs;
125 }
126
127 public function getBackupFileName()
128 {
129 return $this->backupFileName;
130 }
131
132 public function getBackupFilePath()
133 {
134 return $this->backupFilePath;
135 }
136
137 public function getProgress()
138 {
139 return $this->progress;
140 }
141
142 public function getWarningsFound()
143 {
144 return $this->warningsFound;
145 }
146
147 public function getRestoreFiles()
148 {
149 return $this->restoreFiles;
150 }
151
152 public function getPendingStorageUploads()
153 {
154 return $this->pendingStorageUploads;
155 }
156
157 public function setOffset($offset)
158 {
159 $this->offset = $offset;
160 }
161
162 public function getOffset()
163 {
164 return $this->offset;
165 }
166
167 public function factory($stateJson)
168 {
169 $stateJson = json_decode($stateJson, true);
170
171 $type = $stateJson['type'];
172
173 if ($type == SG_STATE_TYPE_FILE) {
174 $sgState = new SGFileState();
175 }
176 else if ($type == SG_STATE_TYPE_UPLOAD) {
177 $sgState = new SGUploadState();
178 }
179 else if ($type == SG_STATE_TYPE_MIGRATE) {
180 $sgState = new SGMigrateState();
181 }
182 else {
183 $sgState = new SGDBState();
184 }
185
186 $sgState = $sgState->init($stateJson);
187 return $sgState;
188 }
189 }
190