apache - SSI parser written in PHP? -


ok, might sound little crazy, bear me here minute.

i'm working on site standard use ssi include page headers, footers, , menus. included files use ssi conditionals handle different browsers, #include nesting, , #set / #if trickery highlight current page in menu. in other words, it's more #include directives in ssi.

i'm sure might argue aesthetics, works quite nicely, static html.

now, problem: i'd "#include" same ssi-parsed header , footer html files php scripts, avoiding code duplication , still maintaining site's uniform look. if php running in usual mod_php environment, i'd able using php's virtual() function. unfortunately, site using fastcgi/suexec run php (so each virtualhost can run different user), , breaks virtual().

i've been using simple ssi parser wrote in php (it handles #includes, , simple #if statements), i'd more general solution. so, before go nuts , write probably-buggy, more complete ssi parser, know of complete ssi parser written in php? naturally, i'm open other solutions work under constraints i've outlined.

thanks time.

take @ esi : http://en.wikipedia.org/wiki/edge_side_includes

you can create php-proxy handle them, it's httpcache in symfony2 : https://github.com/fabpot/symfony/blob/master/src/symfony/component/httpkernel/httpcache/esi.php

or use http proxy varnish, more performant symfony2...


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -