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

refactor: remove Composer autoloading of email helper #872

Merged
merged 1 commit into from
Oct 2, 2023

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Oct 2, 2023

Description
See https://forum.codeigniter.com/showthread.php?tid=88545

The Email helper is used in a limited number of places, and it would be inefficient to load it on every page.

Also, if a library autoloads helpers by Composer, there is no way to stop that loading.
So I have changed my mind, it is better not using helper autoloading by Composer in libraries.
If autoloading is necessary, developers can set it up in Config\Autoload.

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

The Email helper is used in a limited number of places, and it would be inefficient to load it on every page.
@kenjis kenjis added the refactor Pull requests that refactor code label Oct 2, 2023
Copy link
Collaborator

@datamweb datamweb left a comment

Choose a reason for hiding this comment

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

two questions,
If we are going to be bound to CI 4.3, isn't it better to use on config/autoload.php for auth_helper?

Regarding filters, we load a lot of filters by default, what do you think?

@kenjis
Copy link
Member Author

kenjis commented Oct 2, 2023

If we are going to be bound to CI 4.3, isn't it better to use on config/autoload.php for auth_helper?

Yes, I will send another PR.

@kenjis
Copy link
Member Author

kenjis commented Oct 2, 2023

Regarding filters, we load a lot of filters by default, what do you think?

Probably no. Only the applied filters for the request URI are loaded.

@kenjis kenjis merged commit 9843f27 into codeigniter4:develop Oct 2, 2023
31 checks passed
@kenjis kenjis deleted the remove-autoload-email_helper branch October 2, 2023 22:42
@kenjis
Copy link
Member Author

kenjis commented Oct 10, 2023

I sent #893

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.

2 participants