Re: what is the meaning of the following construct
| From: | Kamesh Jayachandran | Date: | Sat, 17 Apr 2004 12:14:37 +0000 |
| Subject: | Re: what is the meaning of the following construct | ||
| References: | 1 2 3 4 5 6 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-27846@lists.php.net to get a copy of this message | ||
Let me make the following statement please correct me if I am wrong.
This 'if check' is there to ensure that if the installer fails to
replace the string '@include_path@' with something appropriate
value('/usr/local/lib/php'), this piece of code sets the include_path to
a default value '/usr/local/lib/php' at php runtime.
If the above is the objective the comparison should be '==' not '!='
And regarding the argument passed to php cli when invoking the pear
command has an option -d include_path='somevalue'
This 'somevalue' default to /usr/local/lib/php.
In case the user want to set some other install dir for whatever reason.
He will set the environment variable 'PHP_PEAR_INSTALL_DIR' may be with
a value '/usr/myphpexperiment' before running the pear command.
According to the above code pearcmd runtime will always end up having
the include_path setting to '/usr/local/lib/php' because of all pass if
check.
Correct me if I am wrong
With regards
Kamesh Jayachandran
On Sat, 2004-04-17 at 17:05, Cipriano Groenendal wrote:
> > if ('@include_path@' != '@'.'include_path'.'@') {
> > ini_set('include_path', '@include_path@');
> > }
> > I am not knowledgable about which program replaces these @include_path@
> > with '/usr/local/lib/php'.
> The PEAR installer does this when it's installing a package.
>
> > Any way finally the installed code looks like the following
> > if ('/usr/local/lib/php' !=
> > '@'.'include_path'.'@') {
> > ini_set('include_path', '/usr/local/lib/php');
> > }
> > So the if condition is absolutely not necessary.
> > Please correct me if I am wrong
> It is indeed quite strange code. It seems to check if it wasn't done
> correctly, and if so spcify the path itself, but that code wouldn't be done
> right anyway sine the @include_path@ never got translated...
>
> Cipri
>