]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Imap/imapmanager.php
Merge branch '0.9.x' into 1.0.x
[quix0rs-gnu-social.git] / plugins / Imap / imapmanager.php
index 0bbd42e78f023deec1d45443848fbd21e1a6ef07..2d27ac97a87ecb37cdfa794e4726aa0007f4fa24 100644 (file)
  * @link      http://status.net/
  */
 
+if (!defined('STATUSNET')) {
+    exit(1);
+}
+
 class ImapManager extends IoManager
 {
     protected $conn = null;
@@ -44,7 +48,7 @@ class ImapManager extends IoManager
      */
     public static function get()
     {
-        throw new Exception('ImapManager should be created using it\'s constructor, not the static get method');
+        throw new Exception(_m('ImapManager should be created using its constructor, not the using the static get method.'));
     }
 
     /**
@@ -59,12 +63,14 @@ class ImapManager extends IoManager
     }
 
     /**
-     * Tell the i/o master we need one instance for each supporting site
-     * being handled in this process.
+     * Tell the i/o master we need one instance globally.
+     * Since this is a plugin manager, the plugin class itself will
+     * create one instance per site. This prevents the IoMaster from
+     * making more instances.
      */
     public static function multiSite()
     {
-        return IoManager::INSTANCE_PER_SITE;
+        return IoManager::GLOBAL_SINGLE_ONLY;
     }
 
     /**
@@ -92,12 +98,12 @@ class ImapManager extends IoManager
     {
         return $this->check_mailbox() > 0;
     }
-    
+
     function pollInterval()
     {
         return $this->plugin->poll_frequency;
     }
-    
+
     protected function connect()
     {
         $this->conn = imap_open($this->plugin->mailbox, $this->plugin->user, $this->plugin->password);