Windows: DEFAULT_INCLUDE_PATH => .;c:\php4\pear PEAR_EXTENSION_DIR => c:\php4 PEAR_INSTALL_DIR => c:\php4\pear Debian GNU/Linux: DEFAULT_INCLUDE_PATH => .:/usr/share/php:/usr/share/pear PEAR_EXTENSION_DIR => /usr/lib/php4/20020429 PEAR_INSTALL_DIR => /usr/share/php */ if (@is_dir(FREEBEER_BASE . '/opt/pear')) { require_once FREEBEER_BASE . '/lib/System.php'; fbSystem::appendIncludePath(FREEBEER_BASE . '/opt/pear'); } if (defined('PEAR_INSTALL_DIR') && @is_dir(PEAR_INSTALL_DIR)) { require_once FREEBEER_BASE . '/lib/System.php'; fbSystem::appendIncludePath(PEAR_INSTALL_DIR); } /*! \class fbPear \brief PEAR support class */ class fbPear { /*! \return \c bool \static */ function isAvailable() { static $rv = null; if (is_null($rv)) {
echo 'isCLI=', fbSystem::isCLI(), "\n"; echo 'isApache=', fbSystem::isApache(), "\n"; echo 'directorySeparator=', fbSystem::directorySeparator(), "\n"; $nl = fbSystem::lineSeparator(); echo 'lineSeparator='; for ($i = 0; $i < strlen($nl); ++$i) { printf("%d: %d ", $i + 1, ord($nl[$i])); } echo "\n"; echo 'pathSeparator=', fbSystem::pathSeparator(), "\n"; echo 'tempDirectory=', fbSystem::tempDirectory(), "\n"; echo 'extensionSuffix=', fbSystem::extensionSuffix(), "\n"; echo 'hostname=', fbSystem::hostname(), "\n"; echo 'username='******'include_path=', ini_get('include_path'), "\n"; fbSystem::appendIncludePath('appendme'); echo 'include_path=', ini_get('include_path'), "\n"; fbSystem::prependIncludePath('prependme'); echo 'include_path=', ini_get('include_path'), "\n"; echo 'loadExtension(\'standard\')=', fbSystem::loadExtension('standard'), "\n"; echo 'loadExtension(\'curl\')=', fbSystem::loadExtension('curl'), "\n"; echo 'loadExtension(\'failme\')=', fbSystem::loadExtension('failme'), "\n"; echo 'getLastError()=', fbSystem::getLastError(), "\n"; ?> </pre> <address> $CVSHeader: _freebeer/www/demo/System.php,v 1.3 2004/03/07 19:16:21 ross Exp $ </address> </body> </html>
function test_appendIncludePath() { $old_include_path = ini_get('include_path'); $path = FREEBEER_BASE . '/lib/tests'; $rv = fbSystem::appendIncludePath($path); $include_path = ini_get('include_path'); $this->assertTrue(strpos($include_path, $path) > 0); ini_set('include_path', $old_include_path); }