1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'Closed Suggestions' started by digitalpoint, Jan 11, 2013.

  1. digitalpoint

    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.

        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. :)
    Chris D, Adam Howard and HWS like this.
  2. digitalpoint

    digitalpoint Well-Known Member

    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
    Chris D likes this.
  3. Chris D

    Chris D XenForo Developer Staff Member

    Crap! When did you go live on XF! I had no idea! :D

    Very happy :)
  4. digitalpoint

    digitalpoint Well-Known Member

    I dunno... few hours ago.
    Adam Howard, vVv and James like this.
  5. James

    James Well-Known Member

    Looks good Shawn!
  6. Mike Edge

    Mike Edge Formerly Da Bookie Mon

    oh my, congrats!
  7. Mike Edge

    Mike Edge Formerly Da Bookie Mon

    Loading wicked fast too Shawn, good job!
  8. digitalpoint

    digitalpoint Well-Known Member

    Not really... trying to figure out how to make it faster actually. lol
  9. Mike Edge

    Mike Edge Formerly Da Bookie Mon

    It's already instant load for me, already much faster then your vB version was.
  10. Slavik

    Slavik XenForo Moderator Staff Member

    Once everything loads its pretty quick, but the initial loads are always quite slow.
  11. Ditto

    Ditto Member

    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.

Share This Page