Commit 83683875 authored by TheBigB's avatar TheBigB
Browse files

Changing instances of php://memory to php://temp. This should fix CI builds,...

Changing instances of php://memory to php://temp. This should fix CI builds, and may be more efficient for large data streams.
parent 70d1ec85
Pipeline #4004614 failed with stage
in 1 minute and 18 seconds
This diff is collapsed.
......@@ -96,7 +96,7 @@ class Curly implements HttpClientInterface
curl_exec($channel);
$status = curl_getinfo($channel, CURLINFO_HTTP_CODE);
return new Response($responseStream ?: 'php://memory', $status, $this->parseHeaderStream($headerStream));
return new Response($responseStream ?: 'php://temp', $status, $this->parseHeaderStream($headerStream));
}
/**
......@@ -115,7 +115,7 @@ class Curly implements HttpClientInterface
if ($options->outputHeaderStream === null)
{
$stream = fopen('php://memory', 'r+');
$stream = fopen('php://temp', 'r+');
$options->outputHeaderStream = $stream;
return new Stream($stream);
}
......@@ -141,7 +141,7 @@ class Curly implements HttpClientInterface
if ($options->outputStream === null)
{
$stream = fopen('php://memory', 'r+');
$stream = fopen('php://temp', 'r+');
$options->outputStream = $stream;
return new Stream($stream);
}
......
......@@ -33,7 +33,7 @@ class ExtendedServerRequest extends ServerRequest
*/
public function withStringBody($content)
{
$stream = new SharedStream('php://memory', 'r+');
$stream = new SharedStream('php://temp', 'r+');
BinarySafe::write($stream, $content);
$stream->rewind();
......@@ -242,4 +242,4 @@ class ExtendedServerRequest extends ServerRequest
}
#endregion
}
\ No newline at end of file
}
......@@ -93,7 +93,7 @@ class HandlerTest extends AbstractTestCase
*/
private function createRandomByteStream()
{
$stream = new SharedStream('php://memory', 'r+');
$stream = new SharedStream('php://temp', 'r+');
for ($i = 0; $i < self::BYTES_TO_READ; $i++)
{
......@@ -103,4 +103,4 @@ class HandlerTest extends AbstractTestCase
$stream->rewind();
return $stream;
}
}
\ No newline at end of file
}
......@@ -40,7 +40,7 @@ class OutputStreamTest extends AbstractTestCase
{
$curly = new Curly();
$stream = new SharedStream('php://memory', 'r+');
$stream = new SharedStream('php://temp', 'r+');
$curly->setCustomHandler(new StreamHandler(null, $stream));
$request = $this->buildRequest('GET', 'bytes', self::BYTES_TO_READ);
......@@ -57,7 +57,7 @@ class OutputStreamTest extends AbstractTestCase
{
$curly = new Curly();
$stream = new SharedStream('php://memory', 'r+');
$stream = new SharedStream('php://temp', 'r+');
$curly->getOptions()->outputStream = $stream->getResource();
$request = $this->buildRequest('GET', 'bytes', self::BYTES_TO_READ);
......@@ -66,4 +66,4 @@ class OutputStreamTest extends AbstractTestCase
$this->assertEquals(200, $response->getStatusCode());
$this->assertEquals(self::BYTES_TO_READ, $stream->getSize());
}
}
\ No newline at end of file
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment