PluginProbe ʕ •ᴥ•ʔ
JetBackup – Backup, Restore & Migrate / 1.6.11
JetBackup – Backup, Restore & Migrate v1.6.11
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 / SGFileState.php
backup / com / lib Last commit date
BackupGuard 5 years ago Dropbox 3 years ago Request 5 years ago SGArchive.php 4 years ago SGAuthClient.php 4 years ago SGCallback.php 5 years ago SGCdrEntry.php 9 years ago SGCharsetHandler.php 7 years ago SGDBState.php 8 years ago SGEntry.php 9 years ago SGFileEntry.php 5 years ago SGFileState.php 5 years ago SGMigrateState.php 8 years ago SGMysqldump.php 5 years ago SGReloadHandler.php 4 years ago SGReloader.php 5 years ago SGReloaderState.php 9 years ago SGReviewManager.php 6 years ago SGState.php 5 years ago SGStatsRequests.php 5 years ago SGUploadHandler.php 5 years ago SGUploadState.php 5 years ago
SGFileState.php
195 lines
1 <?php
2
3 require_once(dirname(__FILE__).'/SGState.php');
4
5 class SGFileState extends SGState
6 {
7 private $cdrSize = 0;
8 private $ranges = array();
9 private $fileOffsetInArchive = 0;
10 private $headerSize = 0;
11 private $cdr = array();
12 private $cursor = 0;
13 private $rangeCursor = 0;
14 private $numberOfEntries = 0;
15
16 private $progressCursor = 0;
17 private $cdrCursor = 0;
18 private $filesActionStartTs = 0;
19
20 function __construct()
21 {
22 $this->type = SG_STATE_TYPE_FILE;
23 }
24
25 public function setCdrCursor($cdrCursor)
26 {
27 $this->cdrCursor = $cdrCursor;
28 }
29
30 public function getCdrCursor()
31 {
32 return $this->cdrCursor;
33 }
34
35 public function getProgressCursor()
36 {
37 return $this->progressCursor;
38 }
39
40 public function setProgressCursor($progressCursor)
41 {
42 $this->progressCursor = $progressCursor;
43 }
44
45 public function setCursor($cursor)
46 {
47 $this->cursor = $cursor;
48 }
49
50 public function setRangeCursor($rangeCursor)
51 {
52 $this->rangeCursor = $rangeCursor;
53 }
54
55 public function setNumberOfEntries($numberOfEntries)
56 {
57 $this->numberOfEntries = $numberOfEntries;
58 }
59
60 public function getCursor()
61 {
62 return $this->cursor;
63 }
64
65 public function getRangeCursor()
66 {
67 return $this->rangeCursor;
68 }
69
70 public function getNumberOfEntries()
71 {
72 return $this->numberOfEntries;
73 }
74
75 public function setCdr($cdr = array())
76 {
77 $this->cdr = $cdr;
78 }
79
80 public function getCdr()
81 {
82 return $this->cdr;
83 }
84
85 public function setCdrSize($cdrSize)
86 {
87 $this->cdrSize = $cdrSize;
88 }
89
90 public function setRanges($ranges)
91 {
92 $this->ranges = $ranges;
93 }
94
95 public function setHeaderSize($headerSize)
96 {
97 $this->headerSize = $headerSize;
98 }
99
100 public function getHeaderSize()
101 {
102 return $this->headerSize;
103 }
104
105 public function getRanges()
106 {
107 return $this->ranges;
108 }
109
110 public function getCdrSize()
111 {
112 return $this->cdrSize;
113 }
114
115 public function getFileOffsetInArchive()
116 {
117 return $this->fileOffsetInArchive;
118 }
119
120 public function setFilesActionStartTs($filesActionStartTs)
121 {
122 $this->filesActionStartTs = $filesActionStartTs;
123 }
124
125 public function getFilesActionStartTs()
126 {
127 return $this->filesActionStartTs;
128 }
129
130 public function setFileOffsetInArchive($fileOffsetInArchive)
131 {
132 $this->fileOffsetInArchive = $fileOffsetInArchive;
133 }
134
135 public function init($stateJson)
136 {
137 $this->cdrSize = $stateJson['cdrSize'];
138 $this->ranges = $stateJson['ranges'];
139 $this->offset = $stateJson['offset'];
140 $this->headerSize = $stateJson['headerSize'];
141 $this->inprogress = $stateJson['inprogress'];
142 $this->cdr = $stateJson['cdr'];
143 $this->action = $stateJson['action'];
144 $this->actionId = $stateJson['actionId'];
145 $this->actionStartTs = $stateJson['actionStartTs'];
146 $this->backupFileName = $stateJson['backupFileName'];
147 $this->backupFilePath = $stateJson['backupFilePath'];
148 $this->progress = $stateJson['progress'];
149 $this->warningsFound = $stateJson['warningsFound'];
150 $this->pendingStorageUploads = $stateJson['pendingStorageUploads'];
151 $this->numberOfEntries = $stateJson['numberOfEntries'];
152 $this->cursor = $stateJson['cursor'];
153 $this->rangeCursor = $stateJson['rangeCursor'];
154 $this->fileOffsetInArchive = $stateJson['fileOffsetInArchive'];
155 $this->progressCursor = $stateJson['progressCursor'];
156 $this->cdrCursor = $stateJson['cdrCursor'];
157 $this->restoreMode = $stateJson['restoreMode'];
158 $this->restoreFiles = $stateJson['restoreFiles'];
159 $this->filesActionStartTs = $stateJson['filesActionStartTs'];
160
161 return $this;
162 }
163
164 public function save()
165 {
166 file_put_contents(SG_BACKUP_DIRECTORY.SG_STATE_FILE_NAME, json_encode(array(
167 'inprogress' => $this->inprogress,
168 'headerSize' => $this->headerSize,
169 'offset' => $this->offset,
170 'ranges' => $this->ranges,
171 'type' => $this->type,
172 'token' => $this->token,
173 'action' => $this->action,
174 'actionId' => $this->actionId,
175 'actionStartTs' => $this->actionStartTs,
176 'backupFileName' => $this->backupFileName,
177 'backupFilePath' => $this->backupFilePath,
178 'progress' => $this->progress,
179 'warningsFound' => $this->warningsFound,
180 'cdrSize' => $this->cdrSize,
181 'pendingStorageUploads' => $this->pendingStorageUploads,
182 'cdr' => $this->cdr,
183 'numberOfEntries' => $this->numberOfEntries,
184 'cursor' => $this->cursor,
185 'rangeCursor' => $this->rangeCursor,
186 'fileOffsetInArchive' => $this->fileOffsetInArchive,
187 'progressCursor' => $this->progressCursor,
188 'cdrCursor' => $this->cdrCursor,
189 'restoreMode' => $this->restoreMode,
190 'restoreFiles' => $this->restoreFiles,
191 'filesActionStartTs' => $this->filesActionStartTs
192 )));
193 }
194 }
195