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

fix: error on Config\Kint with Config Caching #8003

Merged
merged 2 commits into from
Oct 11, 2023

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Oct 4, 2023

Description
We do not need to share the Config file, or change the values with .env.
And if we enable Config Caching, it cannot be loaded from FactoriesCache when we run composer install --no-dev.

// Load Config Cache
// $factoriesCache = new \CodeIgniter\Cache\FactoriesCache();
// $factoriesCache->load('config');

Because the autoloader for Kint is registered in CodeIgniter::initialize().
spl_autoload_register(function ($class) {
$class = explode('\\', $class);
if (array_shift($class) !== 'Kint') {
return;
}
$file = SYSTEMPATH . 'ThirdParty/Kint/' . implode('/', $class) . '.php';
if (is_file($file)) {
require_once $file;
}
});

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

We do not need to share the Config file, and if we enable Config Caching,
it cannot be loaded from FactoriesCache when we run `composer install --no-dev`.
Because the autoloader for Kint is initialized in CodeIgniter::initialize().
@kenjis kenjis added bug Verified issues on the current code behavior or pull requests that will fix them 4.5 labels Oct 4, 2023
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.

I have a thread somewhere about splitting apart our Config folders - we should definitely think about separating "non-BaseConfig" classes into some other category.

@kenjis kenjis merged commit a8f589d into codeigniter4:4.5 Oct 11, 2023
54 checks passed
@kenjis kenjis deleted the fix-Config-Kint branch October 11, 2023 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.5 bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants