Re: php-const replacement type
| From: | Stig S. Bakken | Date: | Thu, 14 Oct 2004 11:27:35 +0000 |
| Subject: | Re: php-const replacement type | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-33838@lists.php.net to get a copy of this message | ||
I really hope nobody is using it like in your example! But package-2.0
gives a good opportunity to review replacements and such features to see
how they are used and if another solution would work better. So no
objections here.
- Stig
On Thu, 14 Oct 2004, Greg Beaver wrote:
> 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
>
>