Skip to content

Conversation

paulbalandan
Copy link
Member

Description
Replaces and closes #9558
Ref: #9558 (comment)
Depends on: #9561

This was trickier than I initially thought, due to the following:

  • We cannot use bootWeb() as it will require a CLI route registered to / (currently throws an Error 404)
  • We cannot use bootSpark() as it will also print spark's list of commands
  • We cannot use bootTest() due to the reason outlined in the previous PRs

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

@paulbalandan paulbalandan added the refactor Pull requests that refactor code label May 15, 2025
@michalsn
Copy link
Member

I'm just wondering - should we really be putting this file in the system folder, considering it's mainly for our internal use?

@paulbalandan
Copy link
Member Author

Good question - we cannot put it in utils/ as that folder is ignored by .gitattributes and we have scripts in other repos like translations that will depend on the bootstrap file.

@michalsn
Copy link
Member

Ah, I hadn’t thought about that. But if we want to reuse it outside this repo, then placing it in the utils folder might not be ideal. I guess it makes sense to keep it where it is.

@paulbalandan paulbalandan merged commit c8f8ff7 into codeigniter4:develop May 18, 2025
49 checks passed
@paulbalandan paulbalandan deleted the util-bootstrap branch May 18, 2025 09:55
@ddevsr
Copy link
Collaborator

ddevsr commented Jul 29, 2025

I want to ask in section, this is related to permission? my preload fail @paulbalandan, not passed in is_dir('vendor/codeigniter4/framework/')

$source = match (true) {
    is_dir(HOMEPATH . 'app/')                   => HOMEPATH,
    is_dir('vendor/codeigniter4/framework/')    => 'vendor/codeigniter4/framework/',
    is_dir('vendor/codeigniter4/codeigniter4/') => 'vendor/codeigniter4/codeigniter4/',
    default                                     => throw new RuntimeException('Unable to determine the source directory.'),
};

Jul 29 17:00:53 devserver php-fpm8.3[8148]:

Jul 29 17:00:53 devserver php-fpm8.3[8148]: Fatal error: Uncaught RuntimeException: Unable to determine the source directory. in /home/xxx/xxxx/vendor/codeigniter4/framewo>Jul 29 17:00:53 devserver php-fpm8.3[8148]: Stack trace:
Jul 29 17:00:53 devserver php-fpm8.3[8148]: #0 /home/xxx/xxxx/preload.php(104): require_once()
Jul 29 17:00:53 devserver php-fpm8.3[8148]: #1 /home/xxx/xxxx/preload.php(111): preload->load()
Jul 29 17:00:53 devserver php-fpm8.3[8148]: #2 {main}
Jul 29 17:00:53 devserver php-fpm8.3[8148]: thrown in /home/xxx/xxxx/vendor/codeigniter4/framework/system/util_bootstrap.php on line 51

@ddevsr
Copy link
Collaborator

ddevsr commented Jul 29, 2025

My bad, i have solution exclude '/system/util_bootstrap.php',

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Pull requests that refactor code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants