svn: /pear/pear-core/trunk/ PEAR.php

From: Date: Sat, 08 May 2010 19:42:27 +0000
Subject: svn: /pear/pear-core/trunk/ PEAR.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-9394@lists.php.net to get a copy of this message
dufuz Sat, 08 May 2010 19:42:27 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=299151 Log: clean up the code block for loadExtension() Changed paths: U pear/pear-core/trunk/PEAR.php Modified: pear/pear-core/trunk/PEAR.php =================================================================== --- pear/pear-core/trunk/PEAR.php 2010-05-08 19:32:23 UTC (rev 299150) +++ pear/pear-core/trunk/PEAR.php 2010-05-08 19:42:27 UTC (rev 299151) @@ -735,32 +735,32 @@ */ function loadExtension($ext) { - if (!extension_loaded($ext)) { - // if either returns true dl() will produce a FATAL error, stop that - if ( - function_exists('dl') === false || - ini_get('enable_dl') != 1 || - ini_get('safe_mode') == 1 - ) { - return false; - } + if (extension_loaded($ext)) { + return true; + } - if (OS_WINDOWS) { - $suffix = '.dll'; - } elseif (PHP_OS == 'HP-UX') { - $suffix = '.sl'; - } elseif (PHP_OS == 'AIX') { - $suffix = '.a'; - } elseif (PHP_OS == 'OSX') { - $suffix = '.bundle'; - } else { - $suffix = '.so'; - } + // if either returns true dl() will produce a FATAL error, stop that + if ( + function_exists('dl') === false || + ini_get('enable_dl') != 1 || + ini_get('safe_mode') == 1 + ) { + return false; + } - return @dl('php_'.$ext.$suffix) || @dl($ext.$suffix); + if (OS_WINDOWS) { + $suffix = '.dll'; + } elseif (PHP_OS == 'HP-UX') { + $suffix = '.sl'; + } elseif (PHP_OS == 'AIX') { + $suffix = '.a'; + } elseif (PHP_OS == 'OSX') { + $suffix = '.bundle'; + } else { + $suffix = '.so'; } - return true; + return @dl('php_'.$ext.$suffix) || @dl($ext.$suffix); } // }}}

« previous php.pear.core (#9394) next »