Re[2]: [PEAR-DEV] XML_RPC
| From: | anatoly techtonik | Date: | Tue, 07 Dec 2004 03:26:36 +0000 |
| Subject: | Re[2]: [PEAR-DEV] XML_RPC | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-34863@lists.php.net to get a copy of this message | ||
Hello Greg,
>>GB> Until PEAR no longer supports PHP 4.2, it will not be possible to fix
>>GB> this, as php 4.2 does not like "register_argc_argv=On"
>>
>>Is it possible to calculate PHP version in install procedure?
>>And include something like @PHP_ABOVE_4_2_ARGC_ARGUMENT@ in pear.bat?
>>
GB> Yes it is possible, but the installer does not support conditional
GB> replacements for package.xml version 1.0 (or 2.0, actually, although
GB> this can be more easily changed). It would have to be in native batch
GB> file language.
GB> This would mean the code would have to first write out a temporary file
GB> using PHP like so
GB> "%PHP_PEAR_PHP_BIN%" -v > ~~~testver.inf
GB> echo "<?php preg_match('/PHP
GB>
GB> (\d.\d)/',implode('',file('~~~testver.inf')),$m);if(count($m)){if(version_compare($m[1],
GB>
'4.2', >>)return 1;else return 0;}" > ~tv.php
GB> IF "%PHP_PEAR_PHP_BIN%" ~tv.php (
GB> SET %PHP_PEAR_ARGC%="register_argc_argv=On"
GB> ) ELSE (
GB> SET %PHP_PEAR_ARGC%=
GB> )
GB> As you can see, this will be a major headache to debug, and since the
GB> better solution is to upgrade PHP (not always possible, I know), and my
GB> time is finite, I would ask that you take the above code, test it, and
GB> tweak it until it works, then send me the results for inclusion in the
GB> next release of PEAR.
%PHP_PEAR_BIN_DIR%\cli\php.exe -r "exit((version_compare(phpversion(), '4.2',
'>'))?1:0);"
IF ERRORLEVEL 1 (
SET PHP_PEAR_ARGC=register_argc_argv=On
) ELSE (
SET PHP_PEAR_ARGC=
)
I'm not sure about exit(code) syntax. Seems, that it has been added
from 4.2 version. This need to be tested on 4.2
What is the lowest PHP version supported by PEAR?
t
--