From: Mikael Nordfeldth Date: Sun, 4 Oct 2015 13:57:11 +0000 (+0200) Subject: autoloading of Crypt_AES and Crypt_RSA is easier X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4238875ebe784dfcac2d639ef48cae005923f86d;p=quix0rs-gnu-social.git autoloading of Crypt_AES and Crypt_RSA is easier --- diff --git a/plugins/LRDD/LRDDPlugin.php b/plugins/LRDD/LRDDPlugin.php index 16eee335a3..a7bdb0edbb 100644 --- a/plugins/LRDD/LRDDPlugin.php +++ b/plugins/LRDD/LRDDPlugin.php @@ -41,6 +41,7 @@ class LRDDPlugin extends Plugin return parent::onAutoload($cls); } + public function onStartDiscoveryMethodRegistration(Discovery $disco) { $disco->registerMethod('LRDDMethod_WebFinger'); } diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php index 5b7147ebee..d1eea869a7 100644 --- a/plugins/OStatus/OStatusPlugin.php +++ b/plugins/OStatus/OStatusPlugin.php @@ -83,6 +83,20 @@ class OStatusPlugin extends Plugin return true; } + public function onAutoload($cls) + { + switch ($cls) { + case 'Crypt_AES': + case 'Crypt_RSA': + // Crypt_AES becomes Crypt/AES.php which is found in extlib/phpseclib/ + // which has been added to our include_path before + require_once str_replace('_', '/', $cls) . '.php'; + return false; + } + + return parent::onAutoload($cls); + } + /** * Set up queue handlers for outgoing hub pushes * @param QueueManager $qm