Cannot access protected property CodeIgniter\HTTP\IncomingRequest::$uri |
Hello I followed the steps to upgrade from 4.4.8 to 4.5.0 ,
but i get this error Cannot access protected property CodeIgniter\HTTP\IncomingRequest::$uri on line 75 PHP Code: // $this->language->setLocale($this->session->lang); Any ideas on the cause of the issue? thx (04-09-2024, 06:34 AM)ramonpuig Wrote: Hello I followed the steps to upgrade from 4.4.8 to 4.5.0 ,This is how to getSegment in new upgrades, Code: if (!function_exists('getSegment')) {
If you are using CI 4.4, you can see the PHPDoc in the IncomingRequest class.
See @deprecated. PHP Code: /**
(04-09-2024, 06:34 AM)ramonpuig Wrote: Hello I followed the steps to upgrade from 4.4.8 to 4.5.0 ,Change $this->request->uri and instead use: $this->request->getUri()
who was the idiot that did that....
it breaks an entire system. Why do standards keep changing so much to render an entire system needing an upgrade cause someone changes the syntax. ridiclous.
In this business it helps if one is a masochist.
![]() Consider minor syntactical changes that do result in breakages as hors d'oeuvres... it's the more subtle changes that don't cause outright breakages- which are typically harder to notice and often have an implication for site security- that are the real nut-shots (like the modifications to CI's routing). (04-25-2024, 02:10 PM)xsPurX Wrote: who was the idiot that did that....I would have not phrased it that way, but I agree with your sentiment. I chose this framework as a replacement for long term supported Laravel in an enterprise environment. In Codeigniter, only the most current version is patched. I chose Codeigniter for the increased speed, especially since I was not using many of Laravel’s included features. Currently I have locked my version to < 4.5.0 and am trying to standardize on that for now. I am currently working on migrating an older 4.4.x project and then I know I have a 4.3.x one that needs to be moved to my new standard. We can confidently use the latest PHP 8.3 version without fear of breakage, In my experience, the same cannot be said for Codeigniter. (05-03-2024, 03:39 AM)Bosborne Wrote:(04-25-2024, 02:10 PM)xsPurX Wrote: who was the idiot that did that....I would have not phrased it that way, but I agree with your sentiment. I chose this framework as a replacement for long term supported Laravel in an enterprise environment. In Codeigniter, only the most current version is patched. I chose Codeigniter for the increased speed, especially since I was not using many of Laravel’s included features. Yeah I was in a bit of a pissy mood, cause I was trying 4.5.1 and I decided to just keep 4.4.1 for now and lock down that version for now. I started my project back in Novemeber of last year, and it sat for a few months, and now a bunch of stuff changes again. It's frustrating, but I will build another application on 4.5.x most likely. I think its a better to approach an EOL for a software instead of updating it too much. So I will take that aproach instead of updating all the time. I love codeigniter for the same reasons light weight and speed. Been using it since Version 1.8ish days. So yeah things change, but sometimes I wonder if some people get a kick out of breaking peoples code and making them work to get their applications updated lol. (05-03-2024, 07:17 AM)xsPurX Wrote:(05-03-2024, 03:39 AM)Bosborne Wrote:(04-25-2024, 02:10 PM)xsPurX Wrote: who was the idiot that did that....I would have not phrased it that way, but I agree with your sentiment. I chose this framework as a replacement for long term supported Laravel in an enterprise environment. In Codeigniter, only the most current version is patched. I chose Codeigniter for the increased speed, especially since I was not using many of Laravel’s included features. You can probably use the latest 4.4 (4.4.8?) That is what I chose, at least until I get confidence in 4.5 It was patches 2 weeks after release.
Do you use automatic routing? Or do you create all routes manually?
Without autorouting, you can change your filter to match the route names. This is a more reliable option. It does not depend on URLs. Try to implement this and you will be surprised how much less you need to edit new CI4 changes. See https://codeigniter4.github.io/userguide...med-routes Example code: PHP Code: // Routes with names "as": users, about,... |
Welcome Guest, Not a member yet? Register Sign In |