X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FImap%2FImapPlugin.php;h=8d8dbf223f1a80f57822a1995c574acdce8f1d95;hb=9567308b70ff4ef5aa4f8d2e65916b7eb1979876;hp=d9768b680205e8e31b3aed737fa9adae7bacf523;hpb=ecb3abf84c8b6e868a523b8e721484cb7a4e0f63;p=quix0rs-gnu-social.git diff --git a/plugins/Imap/ImapPlugin.php b/plugins/Imap/ImapPlugin.php index d9768b6802..8d8dbf223f 100644 --- a/plugins/Imap/ImapPlugin.php +++ b/plugins/Imap/ImapPlugin.php @@ -21,8 +21,9 @@ * * @category Plugin * @package StatusNet - * @author Zach Copley + * @author Craig Andrews mailbox)){ - throw new Exception("must specify a mailbox"); + throw new Exception(_m("A mailbox must be specified.")); } if(!isset($this->user)){ - throw new Exception("must specify a user"); + throw new Exception(_m("A user must be specified.")); } if(!isset($this->password)){ - throw new Exception("must specify a password"); + throw new Exception(_m("A password must be specified.")); } if(!isset($this->poll_frequency)){ - throw new Exception("must specify a poll_frequency"); + throw new Exception(_m("A poll_frequency must be specified.")); } - self::$instances[] = $this; return true; } - function cleanup(){ - $index = array_search($this, self::$instances); - unset(self::$instances[$index]); - return true; + /** + * Load related modules when needed + * + * @param string $cls Name of the class to be loaded + * + * @return boolean hook value; true means continue processing, false means stop. + */ + function onAutoload($cls) + { + $dir = dirname(__FILE__); + + switch ($cls) + { + case 'ImapManager': + case 'IMAPMailHandler': + include_once $dir . '/'.strtolower($cls).'.php'; + return false; + default: + return true; + } } - function onGetValidDaemons($daemons) + function onStartQueueDaemonIoManagers(&$classes) { - if(! self::$daemon_added){ - array_push($daemons, INSTALLDIR . - '/plugins/Imap/imapdaemon.php'); - self::$daemon_added = true; - } - return true; + $classes[] = new ImapManager($this); } function onPluginVersion(&$versions)