PluginProbe ʕ •ᴥ•ʔ
JetBackup – Backup, Restore & Migrate / 1.2.8
JetBackup – Backup, Restore & Migrate v1.2.8
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 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
SGFileState.php
182 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
19 function __construct()
20 {
21 $this->type = SG_STATE_TYPE_FILE;
22 }
23
24 public function setCdrCursor($cdrCursor)
25 {
26 $this->cdrCursor = $cdrCursor;
27 }
28
29 public function getCdrCursor()
30 {
31 return $this->cdrCursor;
32 }
33
34 public function getProgressCursor()
35 {
36 return $this->progressCursor;
37 }
38
39 public function setProgressCursor($progressCursor)
40 {
41 $this->progressCursor = $progressCursor;
42 }
43
44 public function setCursor($cursor)
45 {
46 $this->cursor = $cursor;
47 }
48
49 public function setRangeCursor($rangeCursor)
50 {
51 $this->rangeCursor = $rangeCursor;
52 }
53
54 public function setNumberOfEntries($numberOfEntries)
55 {
56 $this->numberOfEntries = $numberOfEntries;
57 }
58
59 public function getCursor()
60 {
61 return $this->cursor;
62 }
63
64 public function getRangeCursor()
65 {
66 return $this->rangeCursor;
67 }
68
69 public function getNumberOfEntries()
70 {
71 return $this->numberOfEntries;
72 }
73
74 public function setCdr($cdr = array())
75 {
76 $this->cdr = $cdr;
77 }
78
79 public function getCdr()
80 {
81 return $this->cdr;
82 }
83
84 public function setCdrSize($cdrSize)
85 {
86 $this->cdrSize = $cdrSize;
87 }
88
89 public function setRanges($ranges)
90 {
91 $this->ranges = $ranges;
92 }
93
94 public function setHeaderSize($headerSize)
95 {
96 $this->headerSize = $headerSize;
97 }
98
99 public function getHeaderSize()
100 {
101 return $this->headerSize;
102 }
103
104 public function getRanges()
105 {
106 return $this->ranges;
107 }
108
109 public function getCdrSize()
110 {
111 return $this->cdrSize;
112 }
113
114 public function getFileOffsetInArchive()
115 {
116 return $this->fileOffsetInArchive;
117 }
118
119 public function setFileOffsetInArchive($fileOffsetInArchive)
120 {
121 $this->fileOffsetInArchive = $fileOffsetInArchive;
122 }
123
124 public function init($stateJson)
125 {
126 $this->cdrSize = $stateJson['cdrSize'];
127 $this->ranges = $stateJson['ranges'];
128 $this->offset = $stateJson['offset'];
129 $this->headerSize = $stateJson['headerSize'];
130 $this->inprogress = $stateJson['inprogress'];
131 $this->cdr = $stateJson['cdr'];
132 $this->action = $stateJson['action'];
133 $this->actionId = $stateJson['actionId'];
134 $this->actionStartTs = $stateJson['actionStartTs'];
135 $this->backupFileName = $stateJson['backupFileName'];
136 $this->backupFilePath = $stateJson['backupFilePath'];
137 $this->progress = $stateJson['progress'];
138 $this->warningsFound = $stateJson['warningsFound'];
139 $this->pendingStorageUploads = $stateJson['pendingStorageUploads'];
140 $this->numberOfEntries = $stateJson['numberOfEntries'];
141 $this->cursor = $stateJson['cursor'];
142 $this->rangeCursor = $stateJson['rangeCursor'];
143 $this->fileOffsetInArchive = $stateJson['fileOffsetInArchive'];
144 $this->progressCursor = $stateJson['progressCursor'];
145 $this->cdrCursor = $stateJson['cdrCursor'];
146 $this->restoreMode = $stateJson['restoreMode'];
147 $this->restoreFiles = $stateJson['restoreFiles'];
148
149 return $this;
150 }
151
152 public function save()
153 {
154 file_put_contents(SG_BACKUP_DIRECTORY.SG_STATE_FILE_NAME, json_encode(array(
155 'inprogress' => $this->inprogress,
156 'headerSize' => $this->headerSize,
157 'offset' => $this->offset,
158 'ranges' => $this->ranges,
159 'type' => $this->type,
160 'token' => $this->token,
161 'action' => $this->action,
162 'actionId' => $this->actionId,
163 'actionStartTs' => $this->actionStartTs,
164 'backupFileName' => $this->backupFileName,
165 'backupFilePath' => $this->backupFilePath,
166 'progress' => $this->progress,
167 'warningsFound' => $this->warningsFound,
168 'cdrSize' => $this->cdrSize,
169 'pendingStorageUploads' => $this->pendingStorageUploads,
170 'cdr' => $this->cdr,
171 'numberOfEntries' => $this->numberOfEntries,
172 'cursor' => $this->cursor,
173 'rangeCursor' => $this->rangeCursor,
174 'fileOffsetInArchive' => $this->fileOffsetInArchive,
175 'progressCursor' => $this->progressCursor,
176 'cdrCursor' => $this->cdrCursor,
177 'restoreMode' => $this->restoreMode,
178 'restoreFiles' => $this->restoreFiles
179 )));
180 }
181 }
182