|
[F] $lang-object not accessible from run_shutdown()
|
|
08-24-2008, 07:23 PM
Post: #1
|
|||
|
|||
|
[F] $lang-object not accessible from run_shutdown()
On MyBB 1.4.1 running with PHP 5.2.5 or 5.2.6 the $lang object seems to be deconstructed before run_shutdown() is called, resulting for example in the task-log displaying the execution time, but no text. Of course only afflicts installations using the PHP shutdown-functionality.
As a fix the run_shutdown() function should reconstruct the object. My idea is to change two files to do that. a) functions.php, e.g. line 196 Code: // Lang object deconstructed? reconstructb) class_language.php, line 125 The fix above didn't work at first, only after I changed class_language.php, function load(), line 125. Replaced two required_onces by requireds. Apparently php still knows it once loaded the files. Reading them again does no harm, so... here is the changed code: Code: function load($section, $isdatahandler=false, $supress_error=false)After both changes the task logging works as expected on 1.4.1 with PHP 5.2.5 and 5.2.6. Zakkinen |
|||
|
08-24-2008, 11:04 PM
Post: #2
|
|||
|
|||
|
That reminds me, here's a question for the developers: why not use register_shutdown_function() for all PHP versions?
PHP Code: // Old version of PHP, need to register_shutdown_functionShutdown functions are first in PHP's shutdown sequence, before object destruction, so they shouldn't have the "missing object" problem, and all that dodgy "reconstruct" code in MyBB's run_shutdown() function could be deleted. ![]() PHP Code: // If our DB has been deconstructed already (bad PHP 5.2.0), reconstruct It looks like the PHP developers don't plan on changing this, and it still happens in 5.2.6... |
|||
|
08-26-2008, 03:38 AM
Post: #3
|
|||
|
|||
|
[F] $lang-object not accessible from run_shutdown()
Thank you for your bug report.
This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated. ![]() My Blog - My Mods - My Site |
|||
|
« Next Oldest | Next Newest »
|
Search
Member List
Calendar
Help





![[Image: ryangordon.png]](http://belloman.rctgo.net/stuff/signatures/ryangordon.png)