PluginProbe ʕ •ᴥ•ʔ
WP STAGING – WordPress Backups, Restore, Migration & Clone / 4.11.0
WP STAGING – WordPress Backups, Restore, Migration & Clone v4.11.0
4.11.0 4.10.0 4.9.5 4.9.4 4.9.3 4.9.2 4.9.1 4.9.0 4.8.1 trunk 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.10.0 3.2.0 3.3.1 3.3.2 3.3.3 3.4.1 3.4.3 3.5.0 3.6.0 3.7.1 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.8.6 3.8.7 3.9.0 3.9.1 3.9.2 3.9.3 3.9.4 4.0.0 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4 4.2.0 4.2.1 4.3.0 4.3.1 4.3.2 4.4.0 4.5.0 4.6.0 4.7.0 4.7.1 4.7.2 4.7.3 4.8.0
wp-staging / Staging / Traits / StagingOperationDtoTrait.php
wp-staging / Staging / Traits Last commit date
StagingDatabaseDtoTrait.php 1 day ago StagingNetworkDtoTrait.php 1 day ago StagingOperationDtoTrait.php 1 day ago StagingSiteGetterTrait.php 1 day ago WithAdvanceStagingOptions.php 1 day ago WithDataAdjustmentTasks.php 11 months ago WithStagingDatabase.php 1 day ago WithStagingEnginePreference.php 1 day ago WithStagingRequirementLogs.php 1 day ago WithStagingSiteDto.php 1 day ago
StagingOperationDtoTrait.php
683 lines
1 <?php
2
3 namespace WPStaging\Staging\Traits;
4
5 use WPStaging\Staging\Service\StagingSetup;
6
7
8
9
10
11 trait StagingOperationDtoTrait
12 {
13
14
15
16 private $jobType = '';
17
18
19
20
21
22 private $includedTables = [];
23
24
25
26
27
28 private $excludedTables = [];
29
30
31
32
33
34 private $nonSiteTables = [];
35
36
37
38
39
40 private $selectedTables = [];
41
42
43
44
45
46 private $stagingTables = [];
47
48
49
50
51
52
53 private $preserveTables = [];
54
55
56 private $allTablesExcluded = false;
57
58
59 private $extraDirectories = [];
60
61
62 private $excludedDirectories = [];
63
64
65 private $excludeSizeGreaterThan = 8;
66
67
68 private $excludeFileRules = [];
69
70
71 private $excludeFolderRules = [];
72
73
74 private $excludeExtensionRules = [];
75
76
77 private $stagingSitePath = '';
78
79
80 private $stagingSiteUrl = '';
81
82
83
84
85
86 private $stagingSiteUploads = '';
87
88
89
90
91 private $isWpConfigExcluded = false;
92
93
94
95
96 private $isKeepPermalinks = false;
97
98
99
100
101 private $isRootFilesExcluded = false;
102
103
104
105
106 private $isWpAdminExcluded = false;
107
108
109
110
111 private $isWpIncludesExcluded = false;
112
113
114
115
116 private $isWpContentExcluded = false;
117
118
119
120
121 private $isPluginsExcluded = false;
122
123
124
125
126 private $isMuPluginsExcluded = false;
127
128
129
130
131 private $isThemesExcluded = false;
132
133
134
135
136 private $isUploadsExcluded = false;
137
138
139
140
141 private $isRootDirectoriesExcluded = false;
142
143
144
145
146 private $isExternalDatabase = false;
147
148
149
150
151
152 public function setJobType(string $jobType)
153 {
154 $this->jobType = $jobType;
155 }
156
157
158
159
160 public function getJobType(): string
161 {
162 return $this->jobType;
163 }
164
165
166
167
168
169 public function setIncludedTables(array $tables)
170 {
171 $this->includedTables = $tables;
172 }
173
174
175
176
177 public function getIncludedTables(): array
178 {
179 return $this->includedTables;
180 }
181
182
183
184
185
186 public function setExcludedTables(array $tables)
187 {
188 $this->excludedTables = $tables;
189 }
190
191
192
193
194 public function getExcludedTables(): array
195 {
196 return $this->excludedTables;
197 }
198
199
200
201
202
203 public function setNonSiteTables(array $tables)
204 {
205 $this->nonSiteTables = $tables;
206 }
207
208
209
210
211 public function getNonSiteTables(): array
212 {
213 return $this->nonSiteTables;
214 }
215
216
217
218
219
220 public function setSelectedTables(array $tables)
221 {
222 $this->selectedTables = $tables;
223 }
224
225
226
227
228 public function getSelectedTables(): array
229 {
230 return $this->selectedTables;
231 }
232
233
234
235
236
237 public function setStagingTables(array $tables)
238 {
239 $this->stagingTables = $tables;
240 }
241
242 public function getStagingTables(): array
243 {
244 return $this->stagingTables;
245 }
246
247
248
249
250
251
252 public function addStagingTable(string $srcTable, string $destTable)
253 {
254 $this->stagingTables[] = [
255 'source' => $srcTable,
256 'destination' => $destTable,
257 ];
258 }
259
260
261
262
263
264 public function setPreserveTables(array $tables)
265 {
266 $this->preserveTables = $tables;
267 }
268
269 public function getPreserveTables(): array
270 {
271 return $this->preserveTables;
272 }
273
274
275
276
277
278
279 public function addPreserveTable(string $destTable, string $backupTable)
280 {
281 $this->preserveTables[] = [
282 'destination' => $destTable,
283 'backup' => $backupTable,
284 ];
285 }
286
287
288
289
290
291 public function setAllTablesExcluded(bool $allTablesExcluded)
292 {
293 $this->allTablesExcluded = $allTablesExcluded;
294 }
295
296
297
298
299 public function getAllTablesExcluded(): bool
300 {
301 return $this->allTablesExcluded;
302 }
303
304
305
306
307
308 public function setExtraDirectories(array $extraDirectories)
309 {
310 $this->extraDirectories = $extraDirectories;
311 }
312
313
314
315
316 public function getExtraDirectories(): array
317 {
318 return $this->extraDirectories;
319 }
320
321
322
323
324
325 public function setExcludedDirectories(array $excludedDirectories)
326 {
327 $this->excludedDirectories = $excludedDirectories;
328 }
329
330
331
332
333 public function getExcludedDirectories(): array
334 {
335 return $this->excludedDirectories;
336 }
337
338
339
340
341
342 public function setExcludeSizeGreaterThan(float $excludeSizeGreaterThan)
343 {
344 $this->excludeSizeGreaterThan = $excludeSizeGreaterThan;
345 }
346
347
348
349
350 public function getExcludeSizeGreaterThan(): float
351 {
352 return $this->excludeSizeGreaterThan;
353 }
354
355
356
357
358
359 public function setExcludeFileRules(array $excludeFileRules)
360 {
361 $this->excludeFileRules = $excludeFileRules;
362 }
363
364
365
366
367 public function getExcludeFileRules(): array
368 {
369 return $this->excludeFileRules;
370 }
371
372
373
374
375
376 public function setExcludeFolderRules(array $excludeFolderRules)
377 {
378 $this->excludeFolderRules = $excludeFolderRules;
379 }
380
381
382
383
384 public function getExcludeFolderRules(): array
385 {
386 return $this->excludeFolderRules;
387 }
388
389
390
391
392
393 public function setExcludeExtensionRules(array $excludeExtensionRules)
394 {
395 $this->excludeExtensionRules = $excludeExtensionRules;
396 }
397
398
399
400
401 public function getExcludeExtensionRules(): array
402 {
403 return $this->excludeExtensionRules;
404 }
405
406
407
408
409
410 public function setStagingSitePath(string $path)
411 {
412 $this->stagingSitePath = $path;
413 }
414
415
416
417
418 public function getStagingSitePath(): string
419 {
420 return $this->stagingSitePath;
421 }
422
423
424
425
426
427 public function setStagingSiteUrl(string $url)
428 {
429 $this->stagingSiteUrl = $url;
430 }
431
432
433
434
435 public function getStagingSiteUrl(): string
436 {
437 return $this->stagingSiteUrl;
438 }
439
440
441
442
443
444
445 public function setStagingSiteUploads(string $path)
446 {
447 $this->stagingSiteUploads = $path;
448 }
449
450
451
452
453
454 public function getStagingSiteUploads(): string
455 {
456 return $this->stagingSiteUploads;
457 }
458
459
460
461
462
463 public function setIsWpConfigExcluded(bool $excluded)
464 {
465 $this->isWpConfigExcluded = $excluded;
466 }
467
468
469
470
471 public function getIsWpConfigExcluded(): bool
472 {
473 return $this->isWpConfigExcluded;
474 }
475
476
477
478
479
480 public function setIsKeepPermalinks(bool $isKeepPermalinks)
481 {
482 $this->isKeepPermalinks = $isKeepPermalinks;
483 }
484
485
486
487
488 public function getIsKeepPermalinks(): bool
489 {
490 return $this->isKeepPermalinks;
491 }
492
493
494
495
496
497 public function setIsRootFilesExcluded(bool $isRootFilesExcluded)
498 {
499 $this->isRootFilesExcluded = $isRootFilesExcluded;
500 }
501
502
503
504
505 public function getIsRootFilesExcluded(): bool
506 {
507 return $this->isRootFilesExcluded;
508 }
509
510
511
512
513
514 public function setIsWpAdminExcluded(bool $isWpAdminExcluded)
515 {
516 $this->isWpAdminExcluded = $isWpAdminExcluded;
517 }
518
519
520
521
522 public function getIsWpAdminExcluded(): bool
523 {
524 return $this->isWpAdminExcluded;
525 }
526
527
528
529
530
531 public function setIsWpIncludesExcluded(bool $isWpIncludesExcluded)
532 {
533 $this->isWpIncludesExcluded = $isWpIncludesExcluded;
534 }
535
536
537
538
539 public function getIsWpIncludesExcluded(): bool
540 {
541 return $this->isWpIncludesExcluded;
542 }
543
544
545
546
547
548 public function setIsWpContentExcluded(bool $isWpContentExcluded)
549 {
550 $this->isWpContentExcluded = $isWpContentExcluded;
551 }
552
553
554
555
556 public function getIsWpContentExcluded(): bool
557 {
558 return $this->isWpContentExcluded;
559 }
560
561
562
563
564
565 public function setIsPluginsExcluded(bool $isPluginsExcluded)
566 {
567 $this->isPluginsExcluded = $isPluginsExcluded;
568 }
569
570
571
572
573 public function getIsPluginsExcluded(): bool
574 {
575 return $this->isPluginsExcluded;
576 }
577
578
579
580
581
582 public function setIsMuPluginsExcluded(bool $isMuPluginsExcluded)
583 {
584 $this->isMuPluginsExcluded = $isMuPluginsExcluded;
585 }
586
587
588
589
590 public function getIsMuPluginsExcluded(): bool
591 {
592 return $this->isMuPluginsExcluded;
593 }
594
595
596
597
598
599 public function setIsThemesExcluded(bool $isThemesExcluded)
600 {
601 $this->isThemesExcluded = $isThemesExcluded;
602 }
603
604
605
606
607 public function getIsThemesExcluded(): bool
608 {
609 return $this->isThemesExcluded;
610 }
611
612
613
614
615
616 public function setIsUploadsExcluded(bool $isUploadsExcluded)
617 {
618 $this->isUploadsExcluded = $isUploadsExcluded;
619 }
620
621
622
623
624 public function getIsUploadsExcluded(): bool
625 {
626 return $this->isUploadsExcluded;
627 }
628
629
630
631
632
633 public function setIsRootDirectoriesExcluded(bool $isRootDirectoriesExcluded)
634 {
635 $this->isRootDirectoriesExcluded = $isRootDirectoriesExcluded;
636 }
637
638
639
640
641 public function getIsRootDirectoriesExcluded(): bool
642 {
643 return $this->isRootDirectoriesExcluded;
644 }
645
646
647
648
649
650 public function setIsExternalDatabase(bool $isExternalDatabase)
651 {
652 $this->isExternalDatabase = $isExternalDatabase;
653 }
654
655
656
657
658 public function getIsExternalDatabase(): bool
659 {
660 return $this->isExternalDatabase;
661 }
662
663 public function getIsNewStagingSite(): bool
664 {
665 return $this->jobType === StagingSetup::JOB_NEW_STAGING_SITE;
666 }
667
668 public function getIsUpdateJob(): bool
669 {
670 return $this->jobType === StagingSetup::JOB_UPDATE;
671 }
672
673 public function getIsResetJob(): bool
674 {
675 return $this->jobType === StagingSetup::JOB_RESET;
676 }
677
678 public function getIsUpdateOrResetJob(): bool
679 {
680 return $this->getIsUpdateJob() || $this->getIsResetJob();
681 }
682 }
683