mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-11 00:14:50 +03:00
Better solutions for MEMORY issues regarding #331
This commit is contained in:
parent
fd28741cb8
commit
c682e49090
2 changed files with 9 additions and 5 deletions
|
|
@ -38,8 +38,12 @@ class TempFile
|
|||
*/
|
||||
public static function CreateStream(string $sHash, string &$sFileName = '')
|
||||
{
|
||||
$sFileName = self::STREAM_NAME.'://'.$sHash;
|
||||
return fopen($sFileName, 'r+b');
|
||||
return \fopen(self::STREAM_NAME.'://'.$sHash, 'r+b');
|
||||
}
|
||||
|
||||
public function stream_cast(int $cast_as) /*: resource*/
|
||||
{
|
||||
return $this->rStream;
|
||||
}
|
||||
|
||||
public function stream_open(string $sPath) : bool
|
||||
|
|
@ -61,7 +65,7 @@ class TempFile
|
|||
}
|
||||
else
|
||||
{
|
||||
$this->rSream = \fopen('php://memory', 'r+b');
|
||||
$this->rSream = \fopen('php://temp', 'r+b');
|
||||
self::$aStreams[$sHashName] = $this->rSream;
|
||||
|
||||
$bResult = true;
|
||||
|
|
|
|||
|
|
@ -1288,7 +1288,7 @@ trait Messages
|
|||
if ($sFingerprint) {
|
||||
$GPG = $this->GnuPG();
|
||||
$oBody = $oMessage->GetRootPart();
|
||||
$fp = \fopen('php://memory', 'r+b');
|
||||
$fp = \fopen('php://temp', 'r+b');
|
||||
$resource = $oBody->ToStream();
|
||||
$oBody->Body = null;
|
||||
$oBody->SubParts->Clear();
|
||||
|
|
@ -1326,7 +1326,7 @@ trait Messages
|
|||
if ($aFingerprints) {
|
||||
$GPG = $this->GnuPG();
|
||||
$oBody = $oMessage->GetRootPart();
|
||||
$fp = \fopen('php://memory', 'r+b');
|
||||
$fp = \fopen('php://temp', 'r+b');
|
||||
$resource = $oBody->ToStream();
|
||||
\stream_copy_to_stream($resource, $fp);
|
||||
foreach ($aFingerprints as $sFingerprint) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue