Creation of dynamic property Config\Cache::$file is deprecated - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Creation of dynamic property Config\Cache::$file is deprecated (/showthread.php?tid=87473) |
Creation of dynamic property Config\Cache::$file is deprecated - kabeza - 04-24-2023 Hi I'm having some problems after upgrading PHP in a server I'm getting an exception Code: Creation of dynamic property Config\Cache::$file is deprecated I've also upgraded CodeIgniter and have followed all the corresponding upgrade guide's steps from 4.2.10 up to 4.3.3 Any advise? Thanks RE: Creation of dynamic property Config\Cache::$file is deprecated - JustJohnQ - 04-24-2023 https://php.watch/versions/8.2/dynamic-properties-deprecated Also read this post for a temporary solution: https://forum.codeigniter.com/showthread.php?tid=82678&highlight=Dynamic+properties Just realized now that it’s an error in a system file so my above posts might not help you. RE: Creation of dynamic property Config\Cache::$file is deprecated - captain-sensible - 04-24-2023 it looks like your on Linux Code: rm -rf vendor So you removed dir vendor and contents. I don't do that when i update ; out of interest t what was the thinking behind doing that ? But the depreciated from my cursory look seems to be that classes have to have all properties defined. so i think that exception might be to do with: https://php.watch/versions/8.2/dynamic-properties-deprecated RE: Creation of dynamic property Config\Cache::$file is deprecated - kenjis - 04-24-2023 Fixing that error is very easy. Just add the property in the class. https://github.com/codeigniter4/CodeIgniter4/blob/8606a6bca21f41ea5e2485f293d71defee45713d/app/Config/Cache.php#L111-L114 But I don't know why your Config\Cache does not have the $file. RE: Creation of dynamic property Config\Cache::$file is deprecated - kabeza - 04-25-2023 (04-24-2023, 12:00 PM)captain-sensible Wrote: it looks like your on Linux removing vendor and reinstalling; upgrading composer; etc. were listed as steps for upgrading from 4.2.10 to 4.3.3 (04-24-2023, 03:56 PM)kenjis Wrote: Fixing that error is very easy. Just add the property in the class. Yes, I knew that I could solve by adding the property in the class, but also wonder why that class doesn't have the property (even after upgraded) RE: Creation of dynamic property Config\Cache::$file is deprecated - kenjis - 04-25-2023 `composer update` does not change any your project files. It only updates files under vendor/. If you created your app with older version of CI4, the config file may not have the property.. RE: Creation of dynamic property Config\Cache::$file is deprecated - kabeza - 04-26-2023 (04-25-2023, 05:38 PM)kenjis Wrote: `composer update` does not change any your project files. It only updates files under vendor/. Yes I had to do a similar stuff. I've downloaded a new appStarter project, then moved controllers, models, libraries, views, etc. from old application RE: Creation of dynamic property Config\Cache::$file is deprecated - kenjis - 04-26-2023 If you don't want to update your project files manually, Tatter\Patches does it automatically. https://github.com/tattersoftware/codeigniter4-patches RE: Creation of dynamic property Config\Cache::$file is deprecated - kabeza - 04-26-2023 (04-26-2023, 04:43 AM)kenjis Wrote: If you don't want to update your project files manually, Tatter\Patches does it automatically. Wow, didn't know about it Thanks a lot for the suggestion |