PluginProbe ʕ •ᴥ•ʔ
WP STAGING – WordPress Backup, Restore, Migration & Clone / 3.1.0
WP STAGING – WordPress Backup, Restore, Migration & Clone v3.1.0
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 / bootstrap.php
wp-staging Last commit date
Backend 2 years ago Backup 2 years ago Basic 2 years ago Core 2 years ago Framework 2 years ago Frontend 2 years ago assets 2 years ago languages 3 years ago vendor_wpstg 2 years ago Deactivate.php 2 years ago README.md 3 years ago autoloader.php 3 years ago bootstrap.php 2 years ago constantsFree.php 2 years ago freeBootstrap.php 2 years ago install.php 2 years ago opcacheBootstrap.php 2 years ago readme.txt 2 years ago runtimeRequirements.php 2 years ago uninstall.php 2 years ago wp-staging-error-handler.php 3 years ago wp-staging.php 2 years ago
bootstrap.php
122 lines
1 <?php
2
3 /**
4 * @var string $pluginFilePath The absolute path to the main file of this plugin.
5 */
6
7 use WPStaging\Core\WPStaging;
8
9 if (file_exists(__DIR__ . '/autoloader_dev.php')) {
10 include_once __DIR__ . '/autoloader_dev.php';
11 } elseif (wpstgDoLoadPluginAutoLoad($pluginFilePath)) {
12 include_once __DIR__ . '/autoloader.php';
13 }
14
15 // Early bail: Unexpected behavior from the autoloader
16 if (!class_exists('\WPStaging\Core\WPStaging')) {
17 return;
18 }
19
20 // Register common constants.
21 if (!defined('WPSTG_PLUGIN_FILE')) {
22 define('WPSTG_PLUGIN_FILE', $pluginFilePath);
23 }
24
25 // Absolute path to plugin dir /var/www/.../plugins/wp-staging(-pro)/
26 if (!defined('WPSTG_PLUGIN_DIR')) {
27 define('WPSTG_PLUGIN_DIR', plugin_dir_path($pluginFilePath));
28 }
29
30 // URL of the base folder
31 if (!defined('WPSTG_PLUGIN_URL')) {
32 define('WPSTG_PLUGIN_URL', plugin_dir_url($pluginFilePath));
33 }
34
35 // Expected version number of the must-use plugin 'optimizer'. Used for automatic updates of the mu-plugin
36 if (!defined('WPSTG_OPTIMIZER_MUVERSION')) {
37 define('WPSTG_OPTIMIZER_MUVERSION', '1.5.4');
38 }
39
40 // /var/www/single/wp-content/plugins/wp-staging-pro/wp-staging-pro.php => wp-staging-pro
41 if (!defined('WPSTG_PLUGIN_SLUG')) {
42 define('WPSTG_PLUGIN_SLUG', basename(dirname($pluginFilePath)));
43 }
44
45 // An identifier that is the same both for WP STAGING Free and WP STAGING | PRO
46 if (!defined('WPSTG_PLUGIN_DOMAIN')) {
47 define('WPSTG_PLUGIN_DOMAIN', 'wp-staging');
48 }
49
50 // Define WordPress default constants if not already defined in outdated WP version for backward compatibility
51 if (!defined('KB_IN_BYTES')) {
52 define('KB_IN_BYTES', 1024);
53 }
54
55 if (!defined('MB_IN_BYTES')) {
56 define('MB_IN_BYTES', 1024 * KB_IN_BYTES);
57 }
58
59 if (!defined('GB_IN_BYTES')) {
60 define('GB_IN_BYTES', 1024 * MB_IN_BYTES);
61 }
62
63 if (!defined('MINUTE_IN_SECONDS')) {
64 define('MINUTE_IN_SECONDS', 60);
65 }
66
67 if (!defined('HOUR_IN_SECONDS')) {
68 define('HOUR_IN_SECONDS', 60 * MINUTE_IN_SECONDS);
69 }
70
71 if (!defined('DAY_IN_SECONDS')) {
72 define('DAY_IN_SECONDS', 24 * HOUR_IN_SECONDS);
73 }
74
75 if (!defined('WEEK_IN_SECONDS')) {
76 define('WEEK_IN_SECONDS', 7 * DAY_IN_SECONDS);
77 }
78
79 if (!defined('MONTH_IN_SECONDS')) {
80 define('MONTH_IN_SECONDS', 30 * DAY_IN_SECONDS);
81 }
82
83 if (!defined('YEAR_IN_SECONDS')) {
84 define('YEAR_IN_SECONDS', 365 * DAY_IN_SECONDS);
85 }
86
87 /**
88 * Register specific Pro and Free constants. We register them here instead of on the
89 * entrypoint because we want to make sure we are defining constants for the plugins
90 * actually being bootstrapped.
91 */
92 if (file_exists(__DIR__ . '/constantsPro.php')) {
93 include_once __DIR__ . '/constantsPro.php';
94 } elseif (file_exists(__DIR__ . '/constantsFree.php')) {
95 include_once __DIR__ . '/constantsFree.php';
96 }
97
98 if (!function_exists('\WPStaging\functions\debug_log') && file_exists(__DIR__ . '/wp-staging-error-handler.php')) {
99 include_once __DIR__ . '/wp-staging-error-handler.php';
100 }
101
102 $wpStaging = WPStaging::getInstance();
103 $wpStaging->registerErrorHandler();
104
105 /*
106 * Set the WPSTG_COMPATIBLE constant in the container,
107 * so that we can change it for testing purposes.
108 */
109 $wpStaging->set('WPSTG_COMPATIBLE', WPSTG_COMPATIBLE);
110
111 /*
112 * Used during testing to enable virtual filesystem.
113 */
114 $wpStaging->set('WPSTG_ALLOW_VFS', false);
115
116 // Wordpress DB Object
117 global $wpdb;
118
119 if ($wpdb instanceof wpdb) {
120 $wpStaging->set("wpdb", $wpdb);
121 }
122