mirror of
https://github.com/SuiteCRM/SuiteCRM-Core.git
synced 2025-08-29 01:10:42 +08:00
Move install check to autoload runtime template
This commit is contained in:
parent
f0e2129bdf
commit
fb8be46256
2 changed files with 15 additions and 7 deletions
|
@ -11,14 +11,27 @@ use Symfony\Component\HttpFoundation\Request;
|
|||
|
||||
require __DIR__ . '/../config/bootstrap.php';
|
||||
|
||||
$kernel = new Kernel($_SERVER['APP_ENV'], (bool)$_SERVER['APP_DEBUG']);
|
||||
|
||||
$configValues = $kernel->getConfigValues() ?? [];
|
||||
$installerLocked = $configValues['installed_locked'] ?? false;
|
||||
if (!file_exists('legacy/config.php') && !file_exists('../.installed_checked') && !file_exists('../.curl_check_main_page')) {
|
||||
header('Location: install.php');
|
||||
|
||||
if (empty($_POST['install-checked'])) {
|
||||
header('Location: install.php');
|
||||
return;
|
||||
}
|
||||
|
||||
file_put_contents('../.installed_checked', true);
|
||||
header('Location: .');
|
||||
return;
|
||||
} else if (!$installerLocked && file_exists('../.installed_checked') && !empty($_POST['install-checked'])) {
|
||||
header('Location: .');
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the autoloader class
|
||||
|
||||
$kernel = new Kernel($_SERVER['APP_ENV'], (bool)$_SERVER['APP_DEBUG']);
|
||||
$request = Request::createFromGlobals();
|
||||
|
||||
$kernel->init();
|
||||
|
|
|
@ -4,11 +4,6 @@ use App\Kernel;
|
|||
|
||||
require_once dirname(__DIR__) . '/vendor/autoload_runtime.php';
|
||||
|
||||
if (!file_exists('legacy/config.php') && !file_exists('../.installed_checked') && !file_exists('../.curl_check_main_page')){
|
||||
header('Location: install.php');
|
||||
return;
|
||||
}
|
||||
|
||||
return function (array $context) {
|
||||
return new Kernel($context['APP_ENV'], (bool)$context['APP_DEBUG']);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue