Re: what is the meaning of the following construct
| From: | Kamesh Jayachandran | Date: | Sun, 18 Apr 2004 14:49:30 +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-27919@lists.php.net to get a copy of this message | ||
Thanks Greg.
I could see similar checks in the pear shell script also.
Can I add a small documentation near this code stating their purpose and
flow of execution? in both pearcmd.php and pear.sh/pearcmd.bat scripts
too.
Will it make some sense to document or too trivial to document?
Let me know
With regards
Kamesh Jayachandran
On Sun, 2004-04-18 at 00:22, Greg Beaver wrote:
> Kamesh Jayachandran wrote:
>
> > Hi,
> > I could not see pear.in anymore in the CVS Tree.(I persume it has been
> > renamed as pearcmd.php)
> > "don't set include path if running 'pear.in' without substitutions
> > made by the installer"
> > -is the comment given to the corresponding commit.
> >
> >
> > 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'.
> >
> > 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
>
> I'll try :)
>
> The program that does the replacements is the PEAR installer. See [1]
> for a brief description of how replacements work. They are defined in
> the package.xml, so take a look at the package.xml that ships with the
> PEAR package, and you will see that in fact @include_path@ is replaced
> with the value.
>
> If someone were to simply download PEAR-1.3.1.tgz and attempt to run it,
> for instance, then without this check, it would simply set the
> include_path to a completely borked value and fail for no apparent
> reason. Then, we would get people complaining all of the time about the
> stupid code that sets include_path to '@include_path@' when php.ini had
> set it to the correct value just fine.
>
> pear.in was renamed to "pear" as in the shell script named "pear"
>
> Greg
>
> [1]
>
> http://pear.php.net/manual/en/package.pear.pear-packagefilemanager.pear-packagefilemanager.addreplacement.php