PluginProbe ʕ •ᴥ•ʔ
JetBackup – Backup, Restore & Migrate / 1.3.3
JetBackup – Backup, Restore & Migrate v1.3.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 / lib / SGUploadState.php
backup / com / lib Last commit date
BackupGuard 6 years ago Dropbox 6 years ago Request 6 years ago SGArchive.php 6 years ago SGAuthClient.php 6 years ago SGCallback.php 6 years ago SGCdrEntry.php 6 years ago SGCharsetHandler.php 6 years ago SGDBState.php 6 years ago SGEntry.php 6 years ago SGFileEntry.php 6 years ago SGFileState.php 6 years ago SGMigrateState.php 6 years ago SGMysqldump.php 6 years ago SGReloadHandler.php 6 years ago SGReloader.php 6 years ago SGReloaderState.php 6 years ago SGReviewManager.php 6 years ago SGState.php 6 years ago SGUploadHandler.php 6 years ago SGUploadState.php 6 years ago
SGUploadState.php
125 lines
1 <?php
2
3 require_once(dirname(__FILE__).'/SGState.php');
4
5 class SGUploadState extends SGState
6 {
7 private $activeDirectory = '';
8 private $currentUploadChunksCount = 0;
9 private $totalUploadChunksCount = 0;
10 private $uploadId = 0;
11 private $parts = array();
12 private $storageType = null;
13
14 function __construct()
15 {
16 $this->type = SG_STATE_TYPE_UPLOAD;
17 }
18
19 public function setActiveDirectory($activeDirectory)
20 {
21 $this->activeDirectory = $activeDirectory;
22 }
23
24 public function setCurrentUploadChunksCount($currentUploadChunksCount)
25 {
26 $this->currentUploadChunksCount = $currentUploadChunksCount;
27 }
28
29 public function setTotalUploadChunksCount($totalUploadChunksCount)
30 {
31 $this->totalUploadChunksCount = $totalUploadChunksCount;
32 }
33
34 public function setUploadId($uploadId)
35 {
36 $this->uploadId = $uploadId;
37 }
38
39 public function setParts($parts)
40 {
41 $this->parts = $parts;
42 }
43
44 public function setStorageType($storageType)
45 {
46 $this->storageType = $storageType;
47 }
48
49 public function getStorageType()
50 {
51 return $this->storageType;
52 }
53
54 public function getCurrentUploadChunksCount()
55 {
56 return $this->currentUploadChunksCount;
57 }
58
59 public function getTotalUploadChunksCount()
60 {
61 return $this->totalUploadChunksCount;
62 }
63
64 public function getUploadId()
65 {
66 return $this->uploadId;
67 }
68
69 public function getParts()
70 {
71 return $this->parts;
72 }
73
74 public function getActiveDirectory()
75 {
76 return $this->activeDirectory;
77 }
78
79 public function init($stateJson)
80 {
81 $this->type = $stateJson['type'];
82 $this->parts = $stateJson['parts'];
83 $this->offset = $stateJson['offset'];
84 $this->action = $stateJson['action'];
85 $this->uploadId = $stateJson['uploadId'];
86 $this->actionId = $stateJson['actionId'];
87 $this->progress = $stateJson['progress'];
88 $this->storageType = $stateJson['storageType'];
89 $this->actionStartTs = $stateJson['actionStartTs'];
90 $this->warningsFound = $stateJson['warningsFound'];
91 $this->backupFileName = $stateJson['backupFileName'];
92 $this->backupFilePath = $stateJson['backupFilePath'];
93 $this->activeDirectory = $stateJson['activeDirectory'];
94 $this->pendingStorageUploads = $stateJson['pendingStorageUploads'];
95 $this->totalUploadChunksCount = $stateJson['totalUploadChunksCount'];
96 $this->currentUploadChunksCount = $stateJson['currentUploadChunksCount'];
97
98 return $this;
99 }
100
101 public function save()
102 {
103 file_put_contents(SG_BACKUP_DIRECTORY.SG_STATE_FILE_NAME, json_encode(array(
104 'type' => $this->type,
105 'parts' => $this->parts,
106 'token' => $this->token,
107 'offset' => $this->offset,
108 'action' => $this->action,
109 'uploadId' => $this->uploadId,
110 'actionId' => $this->actionId,
111 'progress' => $this->progress,
112 'inprogress' => $this->inprogress,
113 'storageType' => $this->storageType,
114 'actionStartTs' => $this->actionStartTs,
115 'warningsFound' => $this->warningsFound,
116 'backupFileName' => $this->backupFileName,
117 'backupFilePath' => $this->backupFilePath,
118 'activeDirectory' => $this->activeDirectory,
119 'pendingStorageUploads' => $this->pendingStorageUploads,
120 'totalUploadChunksCount' => $this->totalUploadChunksCount,
121 'currentUploadChunksCount' => $this->currentUploadChunksCount
122 )));
123 }
124 }
125