Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion phpstan-bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require __DIR__ . '/system/Test/bootstrap.php';
require __DIR__ . '/system/util_bootstrap.php';

if (! defined('OCI_COMMIT_ON_SUCCESS')) {
define('OCI_COMMIT_ON_SUCCESS', 32);
Expand Down
2 changes: 1 addition & 1 deletion psalm_autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

require __DIR__ . '/system/Test/bootstrap.php';
require __DIR__ . '/system/util_bootstrap.php';

$helperDirs = [
'system/Helpers',
Expand Down
2 changes: 1 addition & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
])
// do you need to include constants, class aliases or custom autoloader? files listed will be executed
->withBootstrapFiles([
__DIR__ . '/system/Test/bootstrap.php',
__DIR__ . '/system/util_bootstrap.php',
])
->withPHPStanConfigs([
__DIR__ . '/phpstan.neon.dist',
Expand Down
4 changes: 4 additions & 0 deletions system/util_bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@
defined('CIPATH') || define('CIPATH', realpath($paths->systemDirectory . '/../') . DIRECTORY_SEPARATOR);
defined('FCPATH') || define('FCPATH', PUBLICPATH);

if (is_dir($paths->testsDirectory . '/_support/') && ! defined('SUPPORTPATH')) {
define('SUPPORTPATH', realpath($paths->testsDirectory . '/_support/') . DIRECTORY_SEPARATOR);
}

if (is_dir(HOMEPATH . 'vendor/')) {
define('VENDORPATH', realpath(HOMEPATH . 'vendor/') . DIRECTORY_SEPARATOR);
define('COMPOSER_PATH', (string) realpath(HOMEPATH . 'vendor/autoload.php'));
Expand Down
9 changes: 7 additions & 2 deletions user_guide_src/source/installation/running.rst
Original file line number Diff line number Diff line change
Expand Up @@ -501,10 +501,15 @@ See :ref:`Deployment <deployment-to-shared-hosting-services>`.
Bootstrapping the App
*********************

In some scenarios you will want to load the framework without actually running the whole
In some scenarios, you will want to load the framework without actually running the whole
application. This is particularly useful for unit testing your project, but may also be
handy for using third-party tools to analyze and modify your code. The framework comes
with a separate bootstrap script specifically for this scenario: **system/Test/bootstrap.php**.
with two separate bootstrap scripts specifically for these scenarios:

- **system/Test/bootstrap.php**: This script is used primarily for unit testing.
- **system/util_bootstrap.php**: This script is used for other scripts that need access to the
framework. It is recommended for use in scripts that are not part for testing as this will NOT
fail gracefully if an exception is thrown.

Most of the paths to your project are defined during the bootstrap process. You may use
pre-defined constants to override these, but when using the defaults be sure that your
Expand Down
2 changes: 1 addition & 1 deletion utils/check_tabs_in_rst.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace Utils;

require __DIR__ . '/../system/Test/bootstrap.php';
require __DIR__ . '/../system/util_bootstrap.php';

use CodeIgniter\CLI\CLI;

Expand Down
Loading