Просмотр исходного кода

ZF-9876 Zend_Mail | Made maximum log size configurable

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@22601 44c647ce-9c0f-0410-b52a-842ac1e357ba
freak 15 лет назад
Родитель
Сommit
bc2729d60e
1 измененных файлов с 25 добавлено и 2 удалено
  1. 25 2
      library/Zend/Mail/Protocol/Abstract.php

+ 25 - 2
library/Zend/Mail/Protocol/Abstract.php

@@ -62,8 +62,9 @@ abstract class Zend_Mail_Protocol_Abstract
 
     /**
      * Maximum of the transaction log
+     * @var integer
      */
-    const MAXIMUM_LOG = 64;
+    protected $_maximumLog = 64;
 
 
     /**
@@ -159,6 +160,28 @@ abstract class Zend_Mail_Protocol_Abstract
         $this->_disconnect();
     }
 
+    /**
+     * Set the maximum log size 
+     * 
+     * @param integer $maximumLog Maximum log size
+     * @return void
+     */
+    public function setMaximumLog($maximumLog)
+    {
+        $this->_maximumLog = (int) $maximumLog;
+    }
+    
+    
+    /**
+     * Get the maximum log size 
+     * 
+     * @return int the maximum log size
+     */
+    public function setMaximumLog($maximumLog)
+    {
+        return $this->_maximumLog;
+    }
+    
 
     /**
      * Create a connection to the remote host
@@ -219,7 +242,7 @@ abstract class Zend_Mail_Protocol_Abstract
      */
     protected function _addLog($value)
     {
-        if (count($this->_log) >= self::MAXIMUM_LOG) {
+        if ($this->_maximumLog >= 0 && count($this->_log) >= $this->_maximumLog) {
             array_shift($this->_log);
         }