codeigniter4 / CodeIgniter4

Open Source PHP Framework (originally from EllisLab)
https://codeigniter.com/
MIT License
5.4k stars 1.9k forks source link

Bug: Latest 4.4.0 #7859

Closed ALTITUDE-DEV-FR closed 1 year ago

ALTITUDE-DEV-FR commented 1 year ago

PHP Version

8.2

CodeIgniter4 Version

4.4.0

CodeIgniter4 Installation Method

Composer (using codeigniter4/appstarter)

Which operating systems have you tested for this bug?

Windows

Which server did you use?

apache

Database

No response

What happened?

After latest update 4.4.0

Fatal error: Uncaught Error: Undefined constant "CodeIgniter\ENVIRONMENT" in C:\wamp64\www\vendor\codeigniter4\framework\system\CodeIgniter.php on line 581

Steps to Reproduce

Just composer Update (3.7.0 > 4.4.0)

Expected Output

Fatal error: Uncaught Error: Undefined constant "CodeIgniter\ENVIRONMENT" in C:\wamp64\www\vendor\codeigniter4\framework\system\CodeIgniter.php on line 581

Anything else?

No response

samsonasik commented 1 year ago

You may need to replace spark file

https://github.com/codeigniter4/CodeIgniter4/blob/94515959306c9678943b706cd03517f190c022f7/spark#L82

and various configs/files see changelog

https://github.com/codeigniter4/CodeIgniter4/blob/develop/user_guide_src/source/changelogs/v4.4.0.rst

ddevsr commented 1 year ago

@kenjis @samsonasik

I have another bug,

Uncaught Error: Class "Kint\Renderer\AbstractRenderer" not found in D:\Project\laragon\www\askred\app\Config\Kint.php on line 46

image

When install kint-php/kint to require-dev, appear other message

Uncaught Error: Call to undefined method Config\DocTypes::__set_state() in D:\Project\laragon\www\askred\writable\cache\FactoriesCache_config on line 681

image

samsonasik commented 1 year ago

I can't reproduce with fresh install appstarter, you may need to copy various files:

samsonasik commented 1 year ago

see list of upgrade guide https://github.com/codeigniter4/CodeIgniter4/blob/develop/user_guide_src/source/installation/upgrade_440.rst

samsonasik commented 1 year ago

upgrade guide: https://codeigniter4.github.io/userguide/installation/upgrade_440.html

changelog: https://codeigniter4.github.io/userguide/changelogs/v4.4.0.html

kenjis commented 1 year ago

@ddevsr If you use Config Caching, read: https://codeigniter4.github.io/CodeIgniter4/concepts/factories.html#prerequisite

ALTITUDE-DEV-FR commented 1 year ago

All are working now in my side, Good Job @kenjis best Update <3 next support 8.3 =)

ddevsr commented 1 year ago

@samsonasik @kenjis I cleared cache files, and refresh page its OK. and next refresh appear error.

I added BaseConfig in app\Config\DocTypes really done to me

--- a/app/Config/DocTypes.php
+++ b/app/Config/DocTypes.php
@@ -2,7 +2,9 @@

 namespace Config;

-class DocTypes
+use CodeIgniter\Config\BaseConfig;
+
+class DocTypes extends BaseConfig
paulbalandan commented 1 year ago

I think this is because config(DocTypes::class) is called even though it is not a config.

ddevsr commented 1 year ago

Yes, i called html helper in autoload helper BaseController

kenjis commented 1 year ago

Ah, yes, there are two config(DocTypes::class) in the src/.

Extending BaseConfig and using config(DocTypes::class) make very slow to load. If it is possible, I would like to use new DocTypes().