Author Topic: SSI templates and PHP  (Read 2473 times)

Mike

  • Jackass In Charge
  • Posts: 11257
  • Karma: +168/-32
  • Ex Asshole - a better and more caring person.
SSI templates and PHP
« on: October 22, 2007, 12:56:33 PM »
So the state came up with this great idea of using templates on the internet pages so they have a similar look to them.  That's fine and all but I'm running into a problem. 

The templates are setup to use SSI and some SSI files might contain their own SSI calls.  Well I've been given a project that will need to be coded in PHP and put on the internet server.  PHP doesn't process SSI calls and the output isn't ran through the SSI parser.  So either I recreate all the pages myself or I do some magic.

I'm thinking of using preg_replace_callback to parse the SSI file and look for other SSI files and then use include() and some logic to recursively handle the file includes.

But before I go and do all of that, does anyone know of any scripts that handle that already and/or a better way of handling this?

Mike

  • Jackass In Charge
  • Posts: 11257
  • Karma: +168/-32
  • Ex Asshole - a better and more caring person.
Re: SSI templates and PHP
« Reply #1 on: October 24, 2007, 10:40:12 AM »
Ended up writing my own parser for this.  Works well on the intranet server where the DOCUMENT_ROOT is set correctly.  The staging server is a flaming turd and isn't configured properly so I can't test it immediately and instead must wait the 15 minutes or so it takes to sync the internet server with the staging server.

Who knows, maybe one day I'll get bored enough and write a parser for the entire SSI set.