Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Boot class and refactor index.php/spark/CodeIgniter::initialize() #8558

Closed
wants to merge 36 commits into from

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Feb 18, 2024

Description
Closes #7824

  • move Kint loading to Autoloader
  • add Boot class, then index.php, spark, and Test/bootstrap.php use it
  • add Config\Optimize::$configCacheEnabled
  • add Config\Optimize::$locatorCacheEnabled
  • deprecate system/bootstrap.php

Screenshot 2024-02-21 12 05 44

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@kenjis kenjis added refactor Pull requests that refactor code 4.5 labels Feb 18, 2024
@kenjis kenjis marked this pull request as draft February 18, 2024 11:28
@kenjis kenjis force-pushed the move-kint-loader branch 6 times, most recently from 42b1d95 to 6bab1e1 Compare February 18, 2024 13:33
@kenjis kenjis changed the title refactor: move Kint loading to Autoloader refactor: CodeIgniter::initialize() and bootstrap.php Feb 18, 2024
@kenjis kenjis force-pushed the move-kint-loader branch 5 times, most recently from 72138c7 to 0392a18 Compare February 19, 2024 02:39
@kenjis kenjis added breaking change Pull requests that may break existing functionalities enhancement PRs that improve existing functionalities labels Feb 19, 2024
@kenjis kenjis marked this pull request as ready for review February 19, 2024 04:36
@kenjis kenjis added the bug Verified issues on the current code behavior or pull requests that will fix them label Feb 19, 2024
@kenjis
Copy link
Member Author

kenjis commented Feb 19, 2024

I found that spark does not show back trace in production environment.
Is this intentional?

development:

(develop *$=)$ ./spark 

CodeIgniter v4.4.5 Command Line Tool - Server Time: 2024-02-19 10:33:30 UTC+00:00

[ParseError]
syntax error, unexpected token "protected", expecting "," or ";"
at SYSTEMPATH/Commands/ListCommands.php:38

Backtrace:
  1    SYSTEMPATH/Autoloader/Autoloader.php:253
       CodeIgniter\Autoloader\Autoloader()->includeFile('/Users/kenji/work/codeigniter/official/CodeIgniter4/vendor/composer/../../system/Commands/ListCommands.php')

  2    [internal function]
       CodeIgniter\Autoloader\Autoloader()->loadClassmap('CodeIgniter\\Commands\\ListCommands')

  3    SYSTEMPATH/CLI/Commands.php:105
       class_exists('CodeIgniter\\Commands\\ListCommands')

  4    SYSTEMPATH/CLI/Commands.php:46
       CodeIgniter\CLI\Commands()->discoverCommands()

  5    SYSTEMPATH/Config/Services.php:174
       CodeIgniter\CLI\Commands()->__construct()

  6    SYSTEMPATH/Config/BaseService.php:258
       CodeIgniter\Config\Services::commands(false)

  7    SYSTEMPATH/Config/BaseService.php:199
       CodeIgniter\Config\BaseService::__callStatic('commands', [...])

  8    SYSTEMPATH/Config/Services.php:171
       CodeIgniter\Config\BaseService::getSharedInstance('commands')

  9    SYSTEMPATH/Config/BaseService.php:258
       CodeIgniter\Config\Services::commands()

 10    SYSTEMPATH/CLI/Console.php:41
       CodeIgniter\Config\BaseService::__callStatic('commands', [])

 11    ROOTPATH/spark:102
       CodeIgniter\CLI\Console()->run()

production:

(develop *$=)$ ./spark 

CodeIgniter v4.4.5 Command Line Tool - Server Time: 2024-02-19 10:33:42 UTC+00:00

[ParseError]
syntax error, unexpected token "protected", expecting "," or ";"
at SYSTEMPATH/Commands/ListCommands.php:38

(develop *$=)$ 

@kenjis kenjis marked this pull request as draft February 19, 2024 12:15
@kenjis kenjis force-pushed the move-kint-loader branch 4 times, most recently from 97e6cb0 to 20c827f Compare February 19, 2024 23:00
@kenjis kenjis marked this pull request as ready for review February 19, 2024 23:11
@kenjis kenjis changed the title refactor: CodeIgniter::initialize() and bootstrap.php feat: add Boot class and refactor index.php/spark/CodeIgniter::initialize() Feb 19, 2024
kenjis added a commit to kenjis/CodeIgniter4 that referenced this pull request Mar 4, 2024
The Cache Config class that extends BaseConfig is very slow to instantiate..
See codeigniter4#8558 (comment)
@kenjis
Copy link
Member Author

kenjis commented Mar 4, 2024

Since this PR was too large, I divided it into three parts: #8603, #8604, #8605

@kenjis kenjis closed this Mar 4, 2024
@kenjis kenjis mentioned this pull request Mar 4, 2024
5 tasks
kenjis added a commit to kenjis/CodeIgniter4 that referenced this pull request Mar 7, 2024
The Cache Config class that extends BaseConfig is very slow to instantiate..
See codeigniter4#8558 (comment)
@kenjis kenjis mentioned this pull request Mar 8, 2024
5 tasks
kenjis added a commit to kenjis/CodeIgniter4 that referenced this pull request Mar 10, 2024
The Cache Config class that extends BaseConfig is very slow to instantiate..
See codeigniter4#8558 (comment)
kenjis added a commit to kenjis/CodeIgniter4 that referenced this pull request Mar 18, 2024
The Cache Config class that extends BaseConfig is very slow to instantiate..
See codeigniter4#8558 (comment)
kenjis added a commit to kenjis/CodeIgniter4 that referenced this pull request Mar 26, 2024
The Cache Config class that extends BaseConfig is very slow to instantiate..
See codeigniter4#8558 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.5 breaking change Pull requests that may break existing functionalities bug Verified issues on the current code behavior or pull requests that will fix them enhancement PRs that improve existing functionalities refactor Pull requests that refactor code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants