Lack of interest Allow exec() to run on XenForo_Template_FileHandler::_destruct()

This suggestion has been closed automatically because it did not receive enough votes over an extended period of time. If you wish to see this, please search for an open suggestion and, if you don't find any, post a new one.

digitalpoint

Well-known member
It would be really nice if the XenForo_Template_FileHandler class had a __destruct() method that could trigger an exec() command.

More or less any time that class is used, it's writing or deleting templates stored in the file system... Now if you have multiple web servers running, you want those new template files to be written to all web servers.

Right now I added the following __destruct() method, but it would be nice if you could just define a command in the options and not have to hack on the files.

PHP:
	public function __destruct()
	{
		exec('sudo /usr/sbin/csync2 -x');
	}

There are of course other ways to do this (a NAS system, lsyncd to monitor for file changes automatically, etc.) but I won't get into the reasons I'm not using those options. :)
 
Upvote 3
This suggestion has been closed. Votes are no longer accepted.
BTW - this didn't work so great when live. lol... was calling csync2 every page view since that class does things like figure out the file name of a template. Needed to make it a little more selective. lol
 
BTW - this didn't work so great when live. lol... was calling csync2 every page view since that class does things like figure out the file name of a template. Needed to make it a little more selective. lol
Crap! When did you go live on XF! I had no idea! :D

Very happy :)
 
Not really... trying to figure out how to make it faster actually. lol

Noticed same, the vBulletin 4 forum before was running faster. Could tell right away visiting and browsing around, but expect you'll sort that out later, you've only just installed it.

Well done on finally converting over though, Internet Brands will love you now... not.
 
Back
Top Bottom