diff options
author | Siebrand Mazeland <s.mazeland@xs4all.nl> | 2010-01-13 23:10:00 +0100 |
---|---|---|
committer | Siebrand Mazeland <s.mazeland@xs4all.nl> | 2010-01-13 23:10:00 +0100 |
commit | 108c51fa6859ec56269078ef9bd0459fdbd9b1ba (patch) | |
tree | c45dc1036d80ba0fdc58473819cde12bcc03eb32 /plugins/Imap/ImapPlugin.php | |
parent | f7f82982ec9a8671195efdc278c2987aa92c083c (diff) | |
parent | 25ed2d2c872e59fd99b54fdf0dec1ca448feca00 (diff) |
Merge branch '0.9.x' of git://gitorious.org/statusnet/mainline into 0.9.x
Diffstat (limited to 'plugins/Imap/ImapPlugin.php')
-rw-r--r-- | plugins/Imap/ImapPlugin.php | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/plugins/Imap/ImapPlugin.php b/plugins/Imap/ImapPlugin.php index d9768b680..89a775a16 100644 --- a/plugins/Imap/ImapPlugin.php +++ b/plugins/Imap/ImapPlugin.php @@ -46,8 +46,6 @@ class ImapPlugin extends Plugin public $user; public $password; public $poll_frequency = 60; - public static $instances = array(); - public static $daemon_added = array(); function initialize(){ if(!isset($this->mailbox)){ @@ -63,24 +61,34 @@ class ImapPlugin extends Plugin throw new Exception("must specify a poll_frequency"); } - 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 onStartIoManagerClasses(&$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) |