cvs: php4 /pear/PEAR Config.php

From: Date: Mon, 01 Apr 2002 19:13:37 +0000
Subject: cvs: php4 /pear/PEAR Config.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-2963@lists.php.net to get a copy of this message
cox Mon Apr 1 14:13:37 2002 EDT Modified files: /php4/pear/PEAR Config.php Log: - Define the PEAR constants when they are not set (be nice with the "--wihout-pear" people who finally regrets) - Added method getLayers() Index: php4/pear/PEAR/Config.php diff -u php4/pear/PEAR/Config.php:1.14 php4/pear/PEAR/Config.php:1.15 --- php4/pear/PEAR/Config.php:1.14 Thu Mar 28 21:38:07 2002 +++ php4/pear/PEAR/Config.php Mon Apr 1 14:13:37 2002 @@ -16,7 +16,7 @@ // | Author: Stig Bakken <ssb@fast.no> | // +----------------------------------------------------------------------+ // -// $Id: Config.php,v 1.14 2002/03/29 02:38:07 ssb Exp $ +// $Id: Config.php,v 1.15 2002/04/01 19:13:37 cox Exp $ require_once 'PEAR.php'; @@ -28,6 +28,15 @@ define('PEAR_CONFIG_DEFAULT_DOCDIR', PHP_DATADIR.DIRECTORY_SEPARATOR.'pear'.DIRECTORY_SEPARATOR.'doc'); + +// in case a --without-pear PHP installation is used +if (!defined('PEAR_INSTALL_DIR')) { + define('PEAR_INSTALL_DIR', PHP_LIBDIR); +} +if (!defined('PEAR_EXTENSION_DIR')) { + define('PEAR_EXTENSION_DIR', PHP_EXTENSION_DIR); +} + /** * This is a class for storing simple configuration values keeping * track of which are system-defined, user-defined or defaulted. By @@ -766,6 +775,18 @@ } // }}} + + /** + * Returns the layers defined (except the 'default' one) + * + * @return array of the defined layers + */ + function getLayers() + { + $cf = $this->configuration; + unset($cf['default']); + return array_keys($cf); + } } ?>

« previous php.pear.cvs (#2963) next »