2014-03-07, 06:35 PM
As I read through MyBB source, there are a couple places that include this check:
But when I actually took the time to trace it down, $use_shutdown is defined as a property of the core object as true and (unless I missed it somehow) is never altered.
So why does init.php and task.php check if it is true when the value never changes?
Also, I don't quite understand the __destruct method of the core object:
I think that this is so if the shutdown functions haven't run so far it will here?
I realize that I may just have it figured out wrong, but when I create a test script with a registered shutdown function and an instantiated class (that has a __destruct), in debug the shutdown function runs first and then the __destruct magic method of the class is ran.
Any guidance would be appreciated.
if($mybb->use_shutdown == true)
But when I actually took the time to trace it down, $use_shutdown is defined as a property of the core object as true and (unless I missed it somehow) is never altered.
So why does init.php and task.php check if it is true when the value never changes?
Also, I don't quite understand the __destruct method of the core object:
function __destruct()
{
// Run shutdown function
if(function_exists("run_shutdown"))
{
run_shutdown();
}
}
I think that this is so if the shutdown functions haven't run so far it will here?
I realize that I may just have it figured out wrong, but when I create a test script with a registered shutdown function and an instantiated class (that has a __destruct), in debug the shutdown function runs first and then the __destruct magic method of the class is ran.
Any guidance would be appreciated.