- add second function_exists call to prevent require_once from being called if autoloader was called

This commit is contained in:
terrafrost 2012-06-27 20:56:36 -05:00
parent 6cd2d154b4
commit f0e1b2deec
3 changed files with 9 additions and 3 deletions

View File

@ -81,7 +81,9 @@ if (!class_exists('Math_BigInteger')) {
*/
// the class_exists() will only be called if the crypt_random function hasn't been defined and
// will trigger a call to __autoload() if you're wanting to auto-load classes
if (!function_exists('crypt_random') && !class_exists('Crypt_Random')) {
// call function_exists() a second time to stop the require_once from being called outside
// of the auto loader
if (!function_exists('crypt_random') && !class_exists('Crypt_Random') && !function_exists('crypt_random')) {
require_once('Crypt/Random.php');
}

View File

@ -106,7 +106,9 @@ if (!class_exists('Crypt_RC4')) {
*/
// the class_exists() will only be called if the crypt_random function hasn't been defined and
// will trigger a call to __autoload() if you're wanting to auto-load classes
if (!function_exists('crypt_random') && !class_exists('Crypt_Random')) {
// call function_exists() a second time to stop the require_once from being called outside
// of the auto loader
if (!function_exists('crypt_random') && !class_exists('Crypt_Random') && !function_exists('crypt_random')) {
require_once('Crypt/Random.php');
}

View File

@ -82,7 +82,9 @@ if (!class_exists('Math_BigInteger')) {
*/
// the class_exists() will only be called if the crypt_random function hasn't been defined and
// will trigger a call to __autoload() if you're wanting to auto-load classes
if (!function_exists('crypt_random') && !class_exists('Crypt_Random')) {
// call function_exists() a second time to stop the require_once from being called outside
// of the auto loader
if (!function_exists('crypt_random') && !class_exists('Crypt_Random') && !function_exists('crypt_random')) {
require_once('Crypt/Random.php');
}