From: Michael M Slusarz Date: Tue, 30 Jun 2009 05:04:50 +0000 (-0600) Subject: Make php temp memory limit a bit lower - 1 MB instead of default 2 MB X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=a44e9444588746edf6d1792a45255429c91e5f1b;p=horde.git Make php temp memory limit a bit lower - 1 MB instead of default 2 MB --- diff --git a/framework/Mime/lib/Horde/Mime/Part.php b/framework/Mime/lib/Horde/Mime/Part.php index 9ebc3128c..09edfb84f 100644 --- a/framework/Mime/lib/Horde/Mime/Part.php +++ b/framework/Mime/lib/Horde/Mime/Part.php @@ -36,6 +36,13 @@ class Horde_Mime_Part static public $defaultCharset = 'us-ascii'; /** + * The memory limit for use with the PHP temp stream. + * + * @var integer + */ + static public $memoryLimit = 1048576; + + /** * Valid encoding types. * * @var array @@ -1096,7 +1103,7 @@ class Horde_Mime_Part } $fp = $this->_writeStream($text); - $newfp = fopen('php://temp', 'r+'); + $newfp = fopen('php://temp/maxmemory:' . self::$memoryLimit, 'r+'); rewind($fp); while ($line = fgets($fp)) { @@ -1418,7 +1425,7 @@ class Horde_Mime_Part protected function _writeStream($data, $options = array()) { if (empty($options['fp'])) { - $fp = fopen('php://temp', 'r+'); + $fp = fopen('php://temp/maxmemory:' . self::$memoryLimit, 'r+'); } else { $fp = $options['fp']; fseek($fp, 0, SEEK_END);