PluginProbe ʕ •ᴥ•ʔ
WP STAGING – WordPress Backup, Restore, Migration & Clone / 3.8.2
WP STAGING – WordPress Backup, Restore, Migration & Clone v3.8.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 / Backend / Modules / Jobs / Data.php
wp-staging / Backend / Modules / Jobs Last commit date
Cleaners 5 years ago Exceptions 5 years ago Cancel.php 2 years ago CancelUpdate.php 2 years ago Cloning.php 2 years ago CloningProcess.php 2 years ago Data.php 2 years ago Database.php 2 years ago Delete.php 2 years ago Directories.php 2 years ago Files.php 2 years ago Finish.php 1 year ago Job.php 2 years ago JobExecutable.php 2 years ago Logs.php 3 years ago PreserveDataFirstStep.php 3 years ago PreserveDataSecondStep.php 2 years ago ProcessLock.php 2 years ago Scan.php 2 years ago SearchReplace.php 2 years ago TotalStepsAreNumberOfTables.php 5 years ago Updating.php 2 years ago
Data.php
69 lines
1 <?php
2
3 namespace WPStaging\Backend\Modules\Jobs;
4
5 use WPStaging\Core\WPStaging;
6 use WPStaging\Framework\CloningProcess\Data\CleanThirdPartyConfigs;
7 use WPStaging\Framework\CloningProcess\Data\CopyWpConfig;
8 use WPStaging\Framework\CloningProcess\Data\Job as DataJob;
9 use WPStaging\Framework\CloningProcess\Data\ResetIndexPhp;
10 use WPStaging\Framework\CloningProcess\Data\UpdateSiteUrlAndHome;
11 use WPStaging\Framework\CloningProcess\Data\UpdateTablePrefix;
12 use WPStaging\Framework\CloningProcess\Data\UpdateWpConfigConstants;
13 use WPStaging\Framework\CloningProcess\Data\UpdateWpConfigTablePrefix;
14 use WPStaging\Framework\CloningProcess\Data\UpdateWpOptionsTablePrefix;
15 use WPStaging\Framework\CloningProcess\Data\UpdateStagingOptionsTable;
16 use WPStaging\Framework\Utils\Strings;
17
18 /**
19 * Class Data
20 * @package WPStaging\Backend\Modules\Jobs
21 */
22 class Data extends DataJob
23 {
24 /**
25 * Initialize
26 */
27 public function initialize()
28 {
29 parent::initialize();
30 $this->getTables();
31 }
32
33 protected function initializeSteps()
34 {
35 $this->steps = [
36 CopyWpConfig::class, // Copy wp-config.php from the staging site if it is located outside of root one level up or copy default wp-config.php if production site uses bedrock or any other boilerplate solution that stores wp default config data elsewhere.
37 UpdateSiteUrlAndHome::class,
38 UpdateStagingOptionsTable::class,
39 UpdateTablePrefix::class,
40 UpdateWpConfigTablePrefix::class,
41 ResetIndexPhp::class, // This is needed if live site is located in subfolder. @see: https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory
42 UpdateWpOptionsTablePrefix::class, // This is important when custom folders are used
43 UpdateWpConfigConstants::class,
44 CleanThirdPartyConfigs::class, // Remove or use dummy config files for hosting like Flywheel etc
45 ];
46 }
47
48 /**
49 * Get a list of tables to copy
50 */
51 protected function getTables()
52 {
53 $strings = new Strings();
54 $this->tables = [];
55 foreach ($this->options->tables as $table) {
56 $this->tables[] = $this->options->prefix . $strings->strReplaceFirst(WPStaging::getTablePrefix(), null, $table);
57 }
58 }
59
60 /**
61 * Calculate total steps in this job and assign it to $this->options->totalSteps
62 * @return void
63 */
64 protected function calculateTotalSteps()
65 {
66 $this->options->totalSteps = 8;
67 }
68 }
69