Skip to content

[4.5] fix: Composer autoload.psr4#8569

Merged
kenjis merged 1 commit into
codeigniter4:4.5from
kenjis:fix-composer-autoload-psr-4
Mar 25, 2024
Merged

[4.5] fix: Composer autoload.psr4#8569
kenjis merged 1 commit into
codeigniter4:4.5from
kenjis:fix-composer-autoload-psr-4

Conversation

@kenjis

@kenjis kenjis commented Feb 22, 2024

Copy link
Copy Markdown
Member

Description
Follow-up #8005

  • remove Config\\ from autoload.psr4

If we use this repository from appstarter, the Config files in app/Config/ in this repository are loaded first.

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

If we use this repository from appstarter, the Config files in
app/Config/ in this repository are loaded first.
@kenjis kenjis added bug Verified issues on the current code behavior or pull requests that will fix them 4.5 labels Feb 22, 2024
@kenjis

kenjis commented Mar 5, 2024

Copy link
Copy Markdown
Member Author

This is a bug fix in 4.5. Please review.

@lonnieezell

Copy link
Copy Markdown
Member

How does this affect those that do manual installs and don't use Composer?

@kenjis

kenjis commented Mar 5, 2024

Copy link
Copy Markdown
Member Author

See composer.json in develop below. It is the same as this PR.

"autoload": {
"psr-4": {
"CodeIgniter\\": "system/"
},
"exclude-from-classmap": [
"**/Database/Migrations/**"
]
},

and the namespace CodeIgniter and Config are registered in AutoloadConfig. So they work without Composer autoloader.

protected $corePsr4 = [
'CodeIgniter' => SYSTEMPATH,
'Config' => APPPATH . 'Config',
];

@kenjis kenjis merged commit 8c91b0d into codeigniter4:4.5 Mar 25, 2024
@kenjis kenjis deleted the fix-composer-autoload-psr-4 branch March 25, 2024 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

3 participants