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][Autoloader] Allow autoloading non-class files #4611

Merged
merged 2 commits into from
Apr 29, 2021

Conversation

paulbalandan
Copy link
Member

Description
This PR now allows Autoloader to load non-class files beside classes. This is similar to Composer's files array in composer.json. A user will now need to put the list of paths to the files in `Config\Autoload::$files`` and CI4 will autoload these on autoload registration.

Fixes #4447

Checklist:

  • Securely signed commits
  • Component(s) with PHPdocs
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

Copy link
Member

@MGatner MGatner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks snazzy, and a fine PR. Might I ask what is the typical use case for such a feature?

@paulbalandan
Copy link
Member Author

Looks snazzy, and a fine PR. Might I ask what is the typical use case for such a feature?

This is akin to composer's files autoloading where you can just include the paths to non-class files you want to include automatically.

@samsonasik samsonasik merged commit 06eb51a into codeigniter4:develop Apr 29, 2021
@samsonasik
Copy link
Member

Thank you @paulbalandan

@paulbalandan paulbalandan deleted the autoloader-files branch April 29, 2021 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: modules - config - constants not loaded
3 participants