• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CI 3.1.1 Index/index gives 404

#1
I believe there is a bug in 3.1.1, or at least when migrating from 3.1.0 to 3.1.1 - the index method of Index controller stops working and gives 404.
I used this migration guide. http://www.codeigniter.com/user_guide/in...e_311.html
Reply

#2
Index::index() has always been a "reserved" name because it's a PHP4-style constructor. It has never worked without causing problems, nothing to do with CI 3.1.1, nor with CI at all for that matter.
Reply

#3
(10-24-2016, 10:11 AM)Narf Wrote: Index::index() has always been a "reserved" name because it's a PHP4-style constructor. It has never worked without causing problems, nothing to do with CI 3.1.1, nor with CI at all for that matter.

It works perfectly well in CI 3.1.0. I'll rename it for 3.1.1.
Reply

#4
(10-24-2016, 10:17 AM)RBX Wrote:
(10-24-2016, 10:11 AM)Narf Wrote: Index::index() has always been a "reserved" name because it's a PHP4-style constructor. It has never worked without causing problems, nothing to do with CI 3.1.1, nor with CI at all for that matter.

It works perfectly well in CI 3.1.0. I'll rename it for 3.1.1.

It maybe didn't trigger a 404, but it deffinately didn't work "perfectly well".
Reply

#5
(10-24-2016, 10:27 AM)Narf Wrote:
(10-24-2016, 10:17 AM)RBX Wrote:
(10-24-2016, 10:11 AM)Narf Wrote: Index::index() has always been a "reserved" name because it's a PHP4-style constructor. It has never worked without causing problems, nothing to do with CI 3.1.1, nor with CI at all for that matter.

It works perfectly well in CI 3.1.0. I'll rename it for 3.1.1.

It maybe didn't trigger a 404, but it deffinately didn't work "perfectly well".

I believe Index::index() isn't treated as a constructor if an explicit __construct is present, so why does this cause an issue?
Reply

#6
(10-24-2016, 11:45 AM)RBX Wrote:
(10-24-2016, 10:27 AM)Narf Wrote:
(10-24-2016, 10:17 AM)RBX Wrote:
(10-24-2016, 10:11 AM)Narf Wrote: Index::index() has always been a "reserved" name because it's a PHP4-style constructor. It has never worked without causing problems, nothing to do with CI 3.1.1, nor with CI at all for that matter.

It works perfectly well in CI 3.1.0. I'll rename it for 3.1.1.

It maybe didn't trigger a 404, but it deffinately didn't work "perfectly well".

I believe Index::index() isn't treated as a constructor if an explicit __construct is present, so why does this cause an issue?

You're right to believe that, but we can't arbitrarily require a (often otherwise useless) __construct() for Index::index().
Reply

#7
PHP 4 constructors are deprecated in PHP 7.0, but at least until they are removed such Index::index names won't be just a normal combination.
So its not usable, the same way as it wasn't in the past..
Once this PHP 4 constructors are fully removed in some future 7.x or even at PHP 8, this combination will be ok I think to exists and work.
Best VPS Hosting : Digital Ocean
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.