From 1e3778dc4f05576f65881e126299ecc204a92263 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Wed, 20 Jun 2012 10:36:36 -0500 Subject: [PATCH] - auto loading fixes (thanks skydiablo) --- phpseclib/Crypt/RSA.php | 12 +++++++++--- phpseclib/Net/SSH1.php | 2 +- phpseclib/Net/SSH2.php | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/phpseclib/Crypt/RSA.php b/phpseclib/Crypt/RSA.php index bf1a58f2..d8df1932 100644 --- a/phpseclib/Crypt/RSA.php +++ b/phpseclib/Crypt/RSA.php @@ -72,17 +72,23 @@ /** * Include Math_BigInteger */ -require_once('Math/BigInteger.php'); +if (!class_exists('Math_BigInteger')) { + require_once('Math/BigInteger.php'); +} /** * Include Crypt_Random */ -require_once('Crypt/Random.php'); +if (!function_exists('crypt_random')) { + require_once('Crypt/Random.php'); +} /** * Include Crypt_Hash */ -require_once('Crypt/Hash.php'); +if (!class_exists('Crypt_Hash')) { + require_once('Crypt/Hash.php'); +} /**#@+ * @access public diff --git a/phpseclib/Net/SSH1.php b/phpseclib/Net/SSH1.php index efe23fe2..1e4ee7b1 100644 --- a/phpseclib/Net/SSH1.php +++ b/phpseclib/Net/SSH1.php @@ -104,7 +104,7 @@ if (!class_exists('Crypt_RC4')) { /** * Include Crypt_Random */ -if (!class_exists('Crypt_Random')) { +if (!function_exists('crypt_random')) { require_once('Crypt/Random.php'); } diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index 95a47a88..376b5a75 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -80,7 +80,7 @@ if (!class_exists('Math_BigInteger')) { /** * Include Crypt_Random */ -if (!class_exists('Crypt_Random')) { +if (!function_exists('crypt_random')) { require_once('Crypt/Random.php'); }