From 4238875ebe784dfcac2d639ef48cae005923f86d Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Sun, 4 Oct 2015 15:57:11 +0200 Subject: [PATCH] autoloading of Crypt_AES and Crypt_RSA is easier --- plugins/LRDD/LRDDPlugin.php | 1 + plugins/OStatus/OStatusPlugin.php | 14 ++++++++++++++ 2 files changed, 15 insertions(+) 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 -- 2.39.5