Re: Server Side Include translator as PHP functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Oct 8, 2011 at 8:48 PM, Tommy Pham <tommyhp2@xxxxxxxxx> wrote:
> On Sat, Oct 8, 2011 at 5:33 PM, Complex <complex.confusion@xxxxxxxxx> wrote:
>>
>> Thanks for the advice, I'm aware of all that, but I'm looking for a
>> specific PHP solution at the moment. Unless you have advice on how I
>> can update the SSI includes on the larger website *without* having to
>> also update the PHP includes for this smaller website?
>>
>> I take it that you don't know of such a function; do you have a
>> recommendation for a good function or program repository I could
>> search? The couple that I was looking at (such as
>> http://php.resourceindex.com/) don't look like they've received a
>> whole lot of attention lately, and may not be the best sources.
>
> Did you look at my suggestion as work around such as replacing the SSI
> mechanism for a particular path/URL with PHP?  Use of 'Conditional
> expressions' [1] maybe necessary which is beyond the scope of this list.
>
> "What are SSI?
>
> SSI (Server Side Includes) are directives that are placed in HTML pages, and
> evaluated on the server while the pages are being served. They let you add
> dynamically generated content to an existing HTML page, without having to
> serve the entire page via a CGI program, or other dynamic technology.
>
> The decision of when to use SSI, and when to have your page entirely
> generated by some program, is usually a matter of how much of the page is
> static, and how much needs to be recalculated every time the page is served.
> SSI is a great way to add small pieces of information, such as the current
> time. But if a majority of your page is being generated at the time that it
> is served, you need to look for some other solution." [1]
>
> Last time I checked, SSI, either on httpd or IIS, doesn't have any means to
> do dynamically, including generating headers, as you intended.
>
> Regards,
> Tommy
>
> [1] http://httpd.apache.org/docs/current/howto/ssi.html
>

Tommy,

Yes, thanks, I did see that:
    change  <!--#include virtual="/includes/old/file/B.inc" -->
    to <!--#include virtual="/path/to/php/code2exec.php" -->

<!--#include virtual="/path/to/php/code2exec.php" -->
does not work on our servers. (I hesitate to say that it doesn't work
anywhere; I don't have enough experience with that.)
What happened when I tried this is that the page displays the raw PHP
instead of the results of the PHP. The server executes the PHP first,
and then executes the SSI instructions, such that the following *does*
work.
    <?php include('/path/to/php/code2exec.php'); ?>
(mind you, I've seen plenty of notes that you should/have to use
virtual() instead)



Regarding SSI not doing anything dynamic: Yes, that's mostly true. The
only dynamism you can get is using if/elsif/else statements while
checkign things like the current URL path, which are ridiculously
clunky.

So the point of this question was to find an *existing and tested*
non-module set of functions that I could employ to translate a
particular include into a set of PHP commands, and then use PHP to add
some dynamic content.

And do you see my main point here, please? I'd use PHP to add some
dynamic content WITHOUT CHANGING THE MAIN CODEBASE that is
unfortunately but definitely stuck in SSI.

I'll probably have to skip that idea, but I'll try to look elsewhere
for such a set of functions. I'd like to write them in the future, but
that's not going to happen within the next couple days. And if anyone
is still scraping their brow at the absolute HORROR  that we are using
SSI instead of the PHP that we should be using, please note that the
whole point of keeping the codebase the same everywhere is to move
everything into a new, modern codebase *real soon*.
-- 
--> CC <---

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux