PluginProbe ʕ •ᴥ•ʔ
JetBackup – Backup, Restore & Migrate / 1.5.1
JetBackup – Backup, Restore & Migrate v1.5.1
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 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
SGUploadState.php
152 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 private $backupId = null;
14 private $profileId = null;
15
16 function __construct()
17 {
18 $this->type = SG_STATE_TYPE_UPLOAD;
19 }
20
21 public function setBackupId($backupId)
22 {
23 $this->backupId = $backupId;
24 }
25
26 public function getBackupId()
27 {
28 return $this->backupId;
29 }
30
31 public function setProfileId($profileId)
32 {
33 $this->profileId = $profileId;
34 }
35
36 public function getProfileId()
37 {
38 return $this->profileId;
39 }
40
41 public function setActiveDirectory($activeDirectory)
42 {
43 $this->activeDirectory = $activeDirectory;
44 }
45
46 public function setCurrentUploadChunksCount($currentUploadChunksCount)
47 {
48 $this->currentUploadChunksCount = $currentUploadChunksCount;
49 }
50
51 public function setTotalUploadChunksCount($totalUploadChunksCount)
52 {
53 $this->totalUploadChunksCount = $totalUploadChunksCount;
54 }
55
56 public function setUploadId($uploadId)
57 {
58 $this->uploadId = $uploadId;
59 }
60
61 public function setParts($parts)
62 {
63 $this->parts = $parts;
64 }
65
66 public function setStorageType($storageType)
67 {
68 $this->storageType = $storageType;
69 }
70
71 public function getStorageType()
72 {
73 return $this->storageType;
74 }
75
76 public function getCurrentUploadChunksCount()
77 {
78 return $this->currentUploadChunksCount;
79 }
80
81 public function getTotalUploadChunksCount()
82 {
83 return $this->totalUploadChunksCount;
84 }
85
86 public function getUploadId()
87 {
88 return $this->uploadId;
89 }
90
91 public function getParts()
92 {
93 return $this->parts;
94 }
95
96 public function getActiveDirectory()
97 {
98 return $this->activeDirectory;
99 }
100
101 public function init($stateJson)
102 {
103 $this->type = $stateJson['type'];
104 $this->parts = $stateJson['parts'];
105 $this->offset = $stateJson['offset'];
106 $this->action = $stateJson['action'];
107 $this->uploadId = $stateJson['uploadId'];
108 $this->actionId = $stateJson['actionId'];
109 $this->progress = $stateJson['progress'];
110 $this->backupId = $stateJson['backupId'];
111 $this->profileId = $stateJson['profileId'];
112 $this->inprogress = $stateJson['inprogress'];
113 $this->storageType = $stateJson['storageType'];
114 $this->actionStartTs = $stateJson['actionStartTs'];
115 $this->warningsFound = $stateJson['warningsFound'];
116 $this->backupFileName = $stateJson['backupFileName'];
117 $this->backupFilePath = $stateJson['backupFilePath'];
118 $this->activeDirectory = $stateJson['activeDirectory'];
119 $this->pendingStorageUploads = $stateJson['pendingStorageUploads'];
120 $this->totalUploadChunksCount = $stateJson['totalUploadChunksCount'];
121 $this->currentUploadChunksCount = $stateJson['currentUploadChunksCount'];
122
123 return $this;
124 }
125
126 public function save()
127 {
128 file_put_contents(SG_BACKUP_DIRECTORY.SG_STATE_FILE_NAME, json_encode(array(
129 'type' => $this->type,
130 'parts' => $this->parts,
131 'token' => $this->token,
132 'offset' => $this->offset,
133 'action' => $this->action,
134 'uploadId' => $this->uploadId,
135 'actionId' => $this->actionId,
136 'progress' => $this->progress,
137 'backupId' => $this->backupId,
138 'profileId' => $this->profileId,
139 'inprogress' => $this->inprogress,
140 'storageType' => $this->storageType,
141 'actionStartTs' => $this->actionStartTs,
142 'warningsFound' => $this->warningsFound,
143 'backupFileName' => $this->backupFileName,
144 'backupFilePath' => $this->backupFilePath,
145 'activeDirectory' => $this->activeDirectory,
146 'pendingStorageUploads' => $this->pendingStorageUploads,
147 'totalUploadChunksCount' => $this->totalUploadChunksCount,
148 'currentUploadChunksCount' => $this->currentUploadChunksCount
149 )));
150 }
151 }
152