• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

codeigniter4 / CodeIgniter4 / 15084926873

17 May 2025 11:56AM UTC coverage: 84.194% (-0.1%) from 84.32%
15084926873

Pull #9562

github

web-flow
Merge b054ca6a0 into 551c56ddd
Pull Request #9562: refactor: add `system/util_bootstrap.php` to curb overreliance to `system/Test/bootstrap.php`

0 of 37 new or added lines in 2 files covered. (0.0%)

20774 of 24674 relevant lines covered (84.19%)

191.06 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/system/util_bootstrap.php
1
<?php
2

3
declare(strict_types=1);
4

5
/**
6
 * This file is part of CodeIgniter 4 framework.
7
 *
8
 * (c) CodeIgniter Foundation <admin@codeigniter.com>
9
 *
10
 * For the full copyright and license information, please view
11
 * the LICENSE file that was distributed with this source code.
12
 */
13

14
use CodeIgniter\Boot;
15
use Config\Paths;
16

NEW
17
error_reporting(E_ALL);
×
NEW
18
ini_set('display_errors', '1');
×
NEW
19
ini_set('display_startup_errors', '1');
×
20

21
/*
22
 * ---------------------------------------------------------------
23
 * DEFINE ENVIRONMENT
24
 * ---------------------------------------------------------------
25
 *
26
 * As this bootstrap file is primarily used by internal scripts
27
 * across the framework and other CodeIgniter projects, we need
28
 * to make sure it recognizes that we're in development.
29
 */
30

NEW
31
$_SERVER['CI_ENVIRONMENT'] = 'development';
×
NEW
32
define('ENVIRONMENT', 'development');
×
NEW
33
defined('CI_DEBUG') || define('CI_DEBUG', true);
×
34

35
/*
36
 * ---------------------------------------------------------------
37
 * SET UP OUR PATH CONSTANTS
38
 * ---------------------------------------------------------------
39
 *
40
 * The path constants provide convenient access to the folders
41
 * throughout the application. We have to set them up here
42
 * so they are available in the config files that are loaded.
43
 */
44

NEW
45
defined('HOMEPATH') || define('HOMEPATH', realpath(rtrim(getcwd(), '\\/ ')) . DIRECTORY_SEPARATOR);
×
46

NEW
47
$source = match (true) {
×
NEW
48
    is_dir(HOMEPATH . 'app/')                   => HOMEPATH,
×
NEW
49
    is_dir('vendor/codeigniter4/framework/')    => 'vendor/codeigniter4/framework/',
×
NEW
50
    is_dir('vendor/codeigniter4/codeigniter4/') => 'vendor/codeigniter4/codeigniter4/',
×
NEW
51
    default                                     => throw new RuntimeException('Unable to determine the source directory.'),
×
NEW
52
};
×
53

NEW
54
defined('CONFIGPATH') || define('CONFIGPATH', realpath($source . 'app/Config') . DIRECTORY_SEPARATOR);
×
NEW
55
defined('PUBLICPATH') || define('PUBLICPATH', realpath($source . 'public') . DIRECTORY_SEPARATOR);
×
NEW
56
unset($source);
×
57

NEW
58
require CONFIGPATH . 'Paths.php';
×
NEW
59
$paths = new Paths();
×
60

NEW
61
defined('CIPATH') || define('CIPATH', realpath($paths->systemDirectory . '/../') . DIRECTORY_SEPARATOR);
×
NEW
62
defined('FCPATH') || define('FCPATH', PUBLICPATH);
×
63

NEW
64
if (is_dir(HOMEPATH . 'vendor/')) {
×
NEW
65
    define('VENDORPATH', realpath(HOMEPATH . 'vendor/') . DIRECTORY_SEPARATOR);
×
NEW
66
    define('COMPOSER_PATH', (string) realpath(HOMEPATH . 'vendor/autoload.php'));
×
67
}
68

69
/*
70
 *---------------------------------------------------------------
71
 * BOOTSTRAP THE APPLICATION
72
 *---------------------------------------------------------------
73
 *
74
 * This process sets up the path constants, loads and registers
75
 * our autoloader, along with Composer's, loads our constants
76
 * and fires up an environment-specific bootstrapping.
77
 */
78

NEW
79
require $paths->systemDirectory . '/Boot.php';
×
NEW
80
Boot::bootConsole($paths);
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc