Skip to content

Commit a21845c

Browse files
authored
refactor: update places to use system/util_bootstrap.php (#9568)
1 parent 4fd4be1 commit a21845c

File tree

6 files changed

+15
-6
lines changed

6 files changed

+15
-6
lines changed

phpstan-bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require __DIR__ . '/system/Test/bootstrap.php';
3+
require __DIR__ . '/system/util_bootstrap.php';
44

55
if (! defined('OCI_COMMIT_ON_SUCCESS')) {
66
define('OCI_COMMIT_ON_SUCCESS', 32);

psalm_autoload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
require __DIR__ . '/system/Test/bootstrap.php';
5+
require __DIR__ . '/system/util_bootstrap.php';
66

77
$helperDirs = [
88
'system/Helpers',

rector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
])
7272
// do you need to include constants, class aliases or custom autoloader? files listed will be executed
7373
->withBootstrapFiles([
74-
__DIR__ . '/system/Test/bootstrap.php',
74+
__DIR__ . '/system/util_bootstrap.php',
7575
])
7676
->withPHPStanConfigs([
7777
__DIR__ . '/phpstan.neon.dist',

system/util_bootstrap.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@
6161
defined('CIPATH') || define('CIPATH', realpath($paths->systemDirectory . '/../') . DIRECTORY_SEPARATOR);
6262
defined('FCPATH') || define('FCPATH', PUBLICPATH);
6363

64+
if (is_dir($paths->testsDirectory . '/_support/') && ! defined('SUPPORTPATH')) {
65+
define('SUPPORTPATH', realpath($paths->testsDirectory . '/_support/') . DIRECTORY_SEPARATOR);
66+
}
67+
6468
if (is_dir(HOMEPATH . 'vendor/')) {
6569
define('VENDORPATH', realpath(HOMEPATH . 'vendor/') . DIRECTORY_SEPARATOR);
6670
define('COMPOSER_PATH', (string) realpath(HOMEPATH . 'vendor/autoload.php'));

user_guide_src/source/installation/running.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,10 +501,15 @@ See :ref:`Deployment <deployment-to-shared-hosting-services>`.
501501
Bootstrapping the App
502502
*********************
503503

504-
In some scenarios you will want to load the framework without actually running the whole
504+
In some scenarios, you will want to load the framework without actually running the whole
505505
application. This is particularly useful for unit testing your project, but may also be
506506
handy for using third-party tools to analyze and modify your code. The framework comes
507-
with a separate bootstrap script specifically for this scenario: **system/Test/bootstrap.php**.
507+
with two separate bootstrap scripts specifically for these scenarios:
508+
509+
- **system/Test/bootstrap.php**: This script is used primarily for unit testing.
510+
- **system/util_bootstrap.php**: This script is used for other scripts that need access to the
511+
framework. It is recommended for use in scripts that are not part for testing as this will NOT
512+
fail gracefully if an exception is thrown.
508513

509514
Most of the paths to your project are defined during the bootstrap process. You may use
510515
pre-defined constants to override these, but when using the defaults be sure that your

utils/check_tabs_in_rst.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
namespace Utils;
1515

16-
require __DIR__ . '/../system/Test/bootstrap.php';
16+
require __DIR__ . '/../system/util_bootstrap.php';
1717

1818
use CodeIgniter\CLI\CLI;
1919

0 commit comments

Comments
 (0)