php-const replacement type
| From: | Greg Beaver | Date: | Thu, 14 Oct 2004 11:22:25 +0000 |
| Subject: | php-const replacement type | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-33836@lists.php.net to get a copy of this message | ||
Hi all,
I would like to remove the completely unnecessary php-const replacement type from the installer, both 1.0 and 2.0 versions of package.xml.
Why? It is completely useless and adds unneeded complexity :). Why use a replacement for a constant that you should be accessing directly? It also makes the task of installing locally from a remote pear.ini for a shared install impossible, a task that would be not only possible but simple to implement otherwise.
To illustrate the issue:
<?php
$os = substr(PHP_OS, 0, 3) == 'WIN' ? 'windows' : 'other';
?>
This is common code.
<?php
$os = substr('@PHP-OS@', 0, 3) == 'WIN' ? 'windows' : 'other';
?>
to use this instead, and have the installer replace @PHP-OS@ with the value of PHP_OS is just stupid, as it guarantees your script cannot be used without the installer, and provides no gains of any type. In addition, replacements are not documented anywhere outside of PEAR_PackageFileManager, so there is no chance that a package is using the php-const replacement type.
Comments?
Greg