On Wed, 13 Feb 2002, David Brown wrote:

> The standard RedHat PHP module rpms edit php.ini directly to indicate that a
> particular module is installed and available.  This step would need to be
> replaced with a template fragment, a config database entry or some other
> method to document the new "policy" change.

Yep, the first of the above. But as I've said, I don't have a problem with 
that.

And now that I look at what the RedHat RPMs do, it'd be very simple to 
emulate the same behaviour in the standard template. Here are the scripts:

[charlieb@vegemite i386]$ rpm -qp --scripts php-*4.0.6*
postinstall program: /sbin/ldconfig
postuninstall program: /sbin/ldconfig
postinstall scriptlet (through /bin/sh):
/usr/bin/perl -pi -e "s|^;extension=imap.so|extension=imap.so|" 
/etc/php.ini
preuninstall scriptlet (through /bin/sh):
if [ $1 = 0 -a -f /etc/php.ini ] ; then
  /usr/bin/perl -pi -e "s|^extension=imap.so|;extension=imap.so|" 
/etc/php.ini
fi
postinstall scriptlet (through /bin/sh):
/usr/bin/perl -pi -e "s|^;extension=ldap.so|extension=ldap.so|" 
/etc/php.ini
preuninstall scriptlet (through /bin/sh):
if [ $1 = 0 -a -f /etc/php.ini ] ; then
  /usr/bin/perl -pi -e "s|^extension=ldap.so|;extension=ldap.so|" 
/etc/php.ini
fi
postinstall scriptlet (through /bin/sh):
/usr/bin/perl -pi -e "s|^;extension=mysql.so|extension=mysql.so|" 
/etc/php.ini
preuninstall scriptlet (through /bin/sh):
if [ $1 = 0 -a -f /etc/php.ini ] ; then
  /usr/bin/perl -pi -e "s|^extension=mysql.so|;extension=mysql.so|" 
/etc/php.ini
fi
postinstall scriptlet (through /bin/sh):
/usr/bin/perl -pi -e "s|^;extension=pgsql.so|extension=pgsql.so|" 
/etc/php.ini
preuninstall scriptlet (through /bin/sh):
if [ $1 = 0 -a -f /etc/php.ini ] ; then
  /usr/bin/perl -pi -e "s|^extension=pgsql.so|;extension=pgsql.so|" 
/etc/php.ini
fi
[charlieb@vegemite i386]$ 

So all you do is:

{
    foreach my $file (qw(imap ldap mysql pgsql))
    {
        if (-f "/usr/lib/php4/${file}.so")
        {
            $OUT .= "extension=${file}.so\n";
        }
    }
    $OUT .= "";
}

Done.

--
Charlie Brady                         [EMAIL PROTECTED]
Lead Product Developer
Network Server Solutions Group        http://www.e-smith.com/
Mitel Networks Corporation            http://www.mitel.com/
Phone: +1 (613) 368 4376 or 564 8000  Fax: +1 (613) 564 7739



--
Please report bugs to [EMAIL PROTECTED]
Please mail [EMAIL PROTECTED] (only) to discuss security issues
Support for registered customers and partners to [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Archives by mail and http://www.mail-archive.com/devinfo%40lists.e-smith.org

Reply via email to