diff --git a/composer-dist.json b/composer-dist.json index 400cc5b6f..d93dcba68 100644 --- a/composer-dist.json +++ b/composer-dist.json @@ -26,6 +26,7 @@ "zf1/zend-search-lucene": "*", "symfony/http-foundation": "^5.4", "php-di/php-di": "^6.4", + "slim/psr7": "^1.7", "seeddms/core": "dev-master", "seeddms/lucene": "dev-master", "seeddms/preview": "dev-master", diff --git a/restapi/index.php b/restapi/index.php index 8540a0924..92ebf2ac0 100644 --- a/restapi/index.php +++ b/restapi/index.php @@ -1296,7 +1296,7 @@ final class SeedDMS_RestapiController { /* {{{ */ if(!($fh = @fopen($file, 'rb'))) { return $this->renderer->json($response, array('success'=>false, 'message'=>'', 'data'=>''))->withStatus(500); } - $stream = new \Slim\Http\Stream($fh); // create a stream instance for the response body + $stream = new \Slim\Psr7\Stream($fh); // create a stream instance for the response body return $response->withHeader('Content-Type', $lc->getMimeType()) ->withHeader('Content-Description', 'File Transfer') @@ -1372,7 +1372,7 @@ final class SeedDMS_RestapiController { /* {{{ */ if(!($fh = @fopen($file, 'rb'))) { return $this->renderer->json($response, array('success'=>false, 'message'=>'', 'data'=>''))->withStatus(500); } - $stream = new \Slim\Http\Stream($fh); // create a stream instance for the response body + $stream = new \Slim\Psr7\Stream($fh); // create a stream instance for the response body return $response->withHeader('Content-Type', $lc->getMimeType()) ->withHeader('Content-Description', 'File Transfer') @@ -1477,7 +1477,7 @@ final class SeedDMS_RestapiController { /* {{{ */ if(!($fh = @fopen($file, 'rb'))) { return $this->renderer->json($response, array('success'=>false, 'message'=>'', 'data'=>''))->withStatus(500); } - $stream = new \Slim\Http\Stream($fh); // create a stream instance for the response body + $stream = new \Slim\Psr7\Stream($fh); // create a stream instance for the response body return $response->withHeader('Content-Type', $lc->getMimeType()) ->withHeader('Content-Description', 'File Transfer') @@ -1623,7 +1623,7 @@ final class SeedDMS_RestapiController { /* {{{ */ if(!($fh = @fopen($file, 'rb'))) { return $this->renderer->json($response, array('success'=>false, 'message'=>'', 'data'=>''))->withStatus(500); } - $stream = new \Slim\Http\Stream($fh); // create a stream instance for the response body + $stream = new \Slim\Psr7\Stream($fh); // create a stream instance for the response body return $response->withHeader('Content-Type', 'image/png') ->withHeader('Content-Description', 'File Transfer')