biow0lf / evedev-kb

Automatically exported from code.google.com/p/evedev-kb
1 stars 0 forks source link

Git HEAD as of 6.11.2011 16:55 EVT; Fatal error in class.cacheable.php #166

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have an issue with the latest git head on one host but for some reason can't 
reproduce it on another one. The only error message I can coax out of the KB is:

Fatal error: Call to undefined function get_called_class() in 
/var/www/virtual/eve-co2.org/htdocs/common/includes/class.cacheable.php on line 
53

Error occurs on all pages showing kills, but post mail -page and admin pages 
work. Tried to disable memcached and all caching but didn't help on the issue. 

Tried cloning DB from the working host to this one in case something went wrong 
with the DB updates 024 and 025 but that didn't change anything.

Also getting same error from cron scripts (feed, fetcher, idfeed).
Only difference between the hosts should be PHP version, the working one has:
PHP 5.3.6-12 with Suhosin-Patch (cli) (built: Jun 15 2011 15:47:56)
While the broken one has:
PHP 5.2.6-1+lenny13 with Suhosin-Patch 0.9.6.2 (cli) (built: Jul  1 2011 
17:03:36)

My limited understanding of php and the edk fail me on where to look for more 
details of the cause of this error. Last known working revision was from Sun 
Oct 23, 2011 01:37.

Original issue reported on code.google.com by palmuves...@gmail.com on 6 Nov 2011 at 5:07

GoogleCodeExporter commented 9 years ago
Reverting class.cache.php and class.cacheable.php to before the addition of the 
factory method (11588be6969888d2cf142c6a045a66b51d048b1f) brings us to new 
error:

Fatal error: Call to undefined method Ship::getbyid() in 
/var/www/virtual/eve-co2.org/htdocs/common/includes/class.killwrapper.php on 
line 401 

Original comment by palmuves...@gmail.com on 6 Nov 2011 at 5:44

GoogleCodeExporter commented 9 years ago
Solved the cause, php function get_called_class is marked as php 5.3 so the php 
5.2 doesn't have it, any alternatives to upgrading php?

Original comment by palmuves...@gmail.com on 6 Nov 2011 at 6:04

GoogleCodeExporter commented 9 years ago
Eugh. I missed that. The alternatives to 5.3 are adding some fairly ugly code 
based on debug backtraces to replace the function in 5.2 or duplicating code in 
each subclass of cacheable.

Requiring 5.3 is tempting. That gets us a lot of other nice features we could 
use too. I'll have to think about this.

If you need a fix right now, then try adding the replacement function described 
here to the end of globals.php: 
http://www.php.net/manual/en/function.get-called-class.php#93799 (In the 
comment from 30-Sep-2009 07:32).

Original comment by kovellia on 6 Nov 2011 at 11:32

GoogleCodeExporter commented 9 years ago
Seems to work with that replacement get_called_class

Original comment by palmuves...@gmail.com on 7 Nov 2011 at 6:14

GoogleCodeExporter commented 9 years ago
So far everything other than api sync seems to work, not sure if api fetching 
is broken because of this replacement function or otherwise.

Original comment by palmuves...@gmail.com on 7 Nov 2011 at 6:40

GoogleCodeExporter commented 9 years ago
getByID methods were added to the classes to avoid this issue in PHP 5.2 
installations.

Original comment by kovellia on 18 Dec 2011 at 2:53