Beispiel #1
0
 /**
  * Constructor.
  *
  * @param  string  $host OPTIONAL Hostname of remote connection (default: 127.0.0.1)
  * @param  integer $port OPTIONAL Port number (default: null)
  * @throws Postman_Zend_Mail_Protocol_Exception
  * @return void
  */
 public function __construct($host = '127.0.0.1', $port = null)
 {
     $this->_validHost = new Postman_Zend_Validate();
     $this->_validHost->addValidator(new Postman_Zend_Validate_Hostname(Postman_Zend_Validate_Hostname::ALLOW_ALL));
     if (!$this->_validHost->isValid($host)) {
         /**
          * @see Postman_Zend_Mail_Protocol_Exception
          */
         //             require_once 'Zend/Mail/Protocol/Exception.php';
         throw new Postman_Zend_Mail_Protocol_Exception(join(', ', $this->_validHost->getMessages()));
     }
     $this->_host = $host;
     $this->_port = $port;
     $this->_maximumLog = PostmanOptions::getInstance()->getTranscriptSize();
 }
Beispiel #2
0
 /**
  * Adds a new default namespace
  *
  * @param array|string $namespace
  * @return null
  */
 public static function addDefaultNamespaces($namespace)
 {
     if (!is_array($namespace)) {
         $namespace = array((string) $namespace);
     }
     self::$_defaultNamespaces = array_unique(array_merge(self::$_defaultNamespaces, $namespace));
 }