Skip to content

Bug fix: ensure to use autoload = false in class_exists() in low-hanging fruit in Factories::locateClass()#3772

Merged
samsonasik merged 2 commits intocodeigniter4:developfrom
samsonasik:autoload-false
Oct 15, 2020
Merged

Bug fix: ensure to use autoload = false in class_exists() in low-hanging fruit in Factories::locateClass()#3772
samsonasik merged 2 commits intocodeigniter4:developfrom
samsonasik:autoload-false

Conversation

@samsonasik
Copy link
Copy Markdown
Member

@samsonasik samsonasik commented Oct 15, 2020

I tried latest dev-develop when running test in a codeigniter4 module and without set autoload=false in 2nd parameter of class_exists() in Factories::locateClass(), I got the error:

Cannot declare class Config\App, because the name is already in use

at APPPATH/Config/App.php:7

Backtrace:
  1    [internal function]
       CodeIgniter\Debug\Exceptions()->shutdownHandler()


Fatal error: Cannot declare class Config\App, because the name is already in use in /Users/samsonasik/www/codeigniter4-files/vendor/codeigniter4/codeigniter4/app/Config/App.php on line 7

This patch fixed the issue.

Checklist:

  • Securely signed commits

@samsonasik
Copy link
Copy Markdown
Member Author

@MGatner above error happen when I tried to test your codeigniter4-files module in php 7.4.9. Update the autoload to false in 2nd class_exists above fix the issue.

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.

1 participant