diff options
author | ྅༻ Ǭɀħ ༄༆ཉ <ozh@ozh.org> | 2022-05-29 15:27:25 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-29 15:27:25 +0300 |
commit | e79b33c706eb48baaf88422c8ae859861e055c0d (patch) | |
tree | 4892ed039eb041bbf0f930f321b8313ba5df0d94 | |
parent | d85466307e43875b41c0f1e2253f894a5fb8d20c (diff) |
Always include `functions-(upgrade|install).php` (#3354)
Fixes #3326
-rw-r--r-- | admin/install.php | 1 | ||||
-rw-r--r-- | admin/upgrade.php | 2 | ||||
-rw-r--r-- | includes/Config/Init.php | 8 | ||||
-rw-r--r-- | includes/Config/InitDefaults.php | 6 | ||||
-rw-r--r-- | tests/bootstrap.php | 1 | ||||
-rw-r--r-- | tests/tests/install/install.php | 1 |
6 files changed, 2 insertions, 17 deletions
diff --git a/admin/install.php b/admin/install.php index bb20ed4b..3b004508 100644 --- a/admin/install.php +++ b/admin/install.php @@ -2,7 +2,6 @@ define( 'YOURLS_ADMIN', true ); define( 'YOURLS_INSTALLING', true ); require_once( dirname( __DIR__ ).'/includes/load-yourls.php' ); -require_once( YOURLS_INC.'/functions-install.php' ); $error = array(); $warning = array(); diff --git a/admin/upgrade.php b/admin/upgrade.php index 45d2b0ee..536a9f87 100644 --- a/admin/upgrade.php +++ b/admin/upgrade.php @@ -2,8 +2,6 @@ define( 'YOURLS_ADMIN', true ); define( 'YOURLS_UPGRADING', true ); require_once( dirname( __DIR__ ).'/includes/load-yourls.php' ); -require_once( YOURLS_INC.'/functions-upgrade.php' ); -require_once( YOURLS_INC.'/functions-install.php' ); yourls_maybe_require_auth(); yourls_html_head( 'upgrade', yourls__( 'Upgrade YOURLS' ) ); diff --git a/includes/Config/Init.php b/includes/Config/Init.php index 6cd05e7d..a0c50f21 100644 --- a/includes/Config/Init.php +++ b/includes/Config/Init.php @@ -187,12 +187,8 @@ class Init { require_once YOURLS_INC.'/functions-infos.php'; require_once YOURLS_INC.'/functions-deprecated.php'; require_once YOURLS_INC.'/functions-auth.php'; - - // Load install & upgrade functions if needed - if ($this->actions->include_install_upgrade_funcs === true) { - require_once YOURLS_INC.'/functions-upgrade.php'; - require_once YOURLS_INC.'/functions-install.php'; - } + require_once YOURLS_INC.'/functions-upgrade.php'; + require_once YOURLS_INC.'/functions-install.php'; } } diff --git a/includes/Config/InitDefaults.php b/includes/Config/InitDefaults.php index 7792e011..791650c9 100644 --- a/includes/Config/InitDefaults.php +++ b/includes/Config/InitDefaults.php @@ -21,12 +21,6 @@ class InitDefaults { public $include_core_funcs = true; /** - * Whether to include auth function files - * @var bool - */ - public $include_install_upgrade_funcs = false; // by default do not load - - /** * Whether to set default time zone * @var bool */ diff --git a/tests/bootstrap.php b/tests/bootstrap.php index aaa06693..cccc0cd6 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -37,7 +37,6 @@ $init->check_if_upgrade_needed = false; $init->load_plugins = false; // do not attempt to load (no DB yet to store data), but do send the 'plugins_loaded' action (some code depend on it) $init->get_all_options = false; $init->check_new_version = false; -$init->include_install_upgrade_funcs = true; new \YOURLS\Config\Init($init); // All set -- install diff --git a/tests/tests/install/install.php b/tests/tests/install/install.php index e814fce0..560acf5a 100644 --- a/tests/tests/install/install.php +++ b/tests/tests/install/install.php @@ -108,7 +108,6 @@ class Install_Tests extends PHPUnit\Framework\TestCase { $expected = array ( 'include_core_funcs' => true, - 'include_install_upgrade_funcs' => false, 'default_timezone' => true, 'load_default_textdomain' => true, 'check_maintenance_mode' => true, |