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.
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.
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