mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
refactor: move CodeIgniter::resolvePlatformExtensions() to bootstrap.php
This commit is contained in:
parent
66c81bcc13
commit
83c15b90de
@ -186,11 +186,6 @@ class CodeIgniter
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
// Run this check for manual installations
|
||||
if (! is_file(COMPOSER_PATH)) {
|
||||
$this->resolvePlatformExtensions(); // @codeCoverageIgnore
|
||||
}
|
||||
|
||||
// Set default locale on the server
|
||||
Locale::setDefault($this->config->defaultLocale ?? 'en');
|
||||
|
||||
@ -206,6 +201,8 @@ class CodeIgniter
|
||||
* @throws FrameworkException
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @deprecated 4.5.0 Moved to system/bootstrap.php.
|
||||
*/
|
||||
protected function resolvePlatformExtensions()
|
||||
{
|
||||
|
@ -11,6 +11,7 @@ declare(strict_types=1);
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use CodeIgniter\Exceptions\FrameworkException;
|
||||
use Config\Autoload;
|
||||
use Config\Modules;
|
||||
use Config\Paths;
|
||||
@ -144,5 +145,37 @@ Services::autoloader()->loadHelpers();
|
||||
|
||||
Services::exceptions()->initialize();
|
||||
|
||||
// Initialize Kint
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* CHECK SYSTEM FOR MISSING REQUIRED PHP EXTENSIONS
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
// Run this check for manual installations
|
||||
if (! is_file(COMPOSER_PATH)) {
|
||||
$requiredExtensions = [
|
||||
'intl',
|
||||
'json',
|
||||
'mbstring',
|
||||
];
|
||||
|
||||
$missingExtensions = [];
|
||||
|
||||
foreach ($requiredExtensions as $extension) {
|
||||
if (! extension_loaded($extension)) {
|
||||
$missingExtensions[] = $extension;
|
||||
}
|
||||
}
|
||||
|
||||
if ($missingExtensions !== []) {
|
||||
throw FrameworkException::forMissingExtension(implode(', ', $missingExtensions));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* INITIALIZE KINT
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
Services::autoloader()->initializeKint(CI_DEBUG);
|
||||
|
Loading…
x
Reference in New Issue
Block a user