Re: cvs: pear /Text_Wiki/doc BBtest.txt test_Text_Wiki.php
| From: | Pierre-Alain Joye | Date: | Tue, 19 Jul 2005 09:30:59 +0000 |
| Subject: | Re: cvs: pear /Text_Wiki/doc BBtest.txt test_Text_Wiki.php | ||
| References: | 1 2 3 4 | Groups: | php.pear.cvs |
| Request: | Send a blank email to pear-cvs+get-33139@lists.php.net to get a copy of this message | ||
On Tue, 19 Jul 2005 11:18:55 +0200
mj@php.net (Martin Jansen) wrote:
> On Mon Jul 18, 2005 at 08:3149PM +0200, bertrand Gugger wrote:
> > Martin Jansen wrote:
> > >On Mon Jul 18, 2005 at 04:3552PM -0000, bertrand GUGGER wrote:
> > >>+if ($_SERVER['PHP_SELF']) {
> > >>+ $html = true;
> > >
> > >Why don't you check for the return value of php_sapi_name()
> > >instead?
> > >
> > I'm really not sure it's an easy/correct way ...
> > How decrypt that in the list of possible sapi_names ?
>
> I'd suggest something like the following:
>
> <?php
> $html = true;
> if (php_sapi_name() == "cli") {
> $html = false;
> }
> ?>
Do you mean:
if (php_sapi_name == 'cli') {
$html = true;
} else {
$html = false;
}
:)
--Pierre