MyBB Community Forums

Full Version: Shutdown Functions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
As I read through MyBB source, there are a couple places that include this check:

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.
Did you enabled this feature on admin cp.

Server optimization xxx.

You can use it shut_down php function if you enable it there.

I supose you have this enabled maybe, but in both cases do the same thing ??

Some plugins run this function for some purposes, but i never test it.
(2014-03-07, 09:45 PM)Dark Neo Wrote: [ -> ]Did you enabled this feature on admin cp.

Server optimization xxx.

There is no setting in ACP under Server and Optimization Options that controls this.
In some versions of MyBB it's there, i attach an image, but i think some other versions not have this option,but i see there a few weeks ago when i translate to spanish 1.7 alpha, then i see right now on my current MyBB version, i use 1.6.12.

It appears on 1.7 alpha too.
Thanks.

When I first started searching for this I could have sworn I saw that setting, but then I checked some of my localhost installations (I have many) and none of them had the setting that I checked.

But still I am confused. The setting (when it is present) is named 'useshutdownfunc', but doing a global search for that string (in the entire installation and subfolders) yielded 0 results.

As did a search for $mybb->use_shutdown being assigned a value.
http://www.mybbsecurity.net/docs/functio...tdown.html

http://www.mybb.com/sourcedocs/nav.html?...index.html

I think when you run clean up task filling the cache for most_viewed_threads this function was loaded, but i don't know exactly because i never use this yet.

But i pnly know it's for the firts link purposes.


P.D: I've never used but i think have to be some of the Admin CP option.