From 2c9e10b88fe1beba3605000e20c46b5a1f60c8d2 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 12 Feb 2025 20:54:46 +0100 Subject: [PATCH 1/2] require slim/psr7 --- composer-dist.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer-dist.json b/composer-dist.json index 538af9e5f..5126ea1ce 100644 --- a/composer-dist.json +++ b/composer-dist.json @@ -25,6 +25,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", From d27b762945c347a7b8bfd857d8e84211c2dda11a Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 12 Feb 2025 20:56:07 +0100 Subject: [PATCH 2/2] use Slim/Psr7/Stream --- restapi/index.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/restapi/index.php b/restapi/index.php index a5b17dfc1..943d1b79a 100644 --- a/restapi/index.php +++ b/restapi/index.php @@ -1286,7 +1286,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') @@ -1362,7 +1362,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') @@ -1467,7 +1467,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') @@ -1613,7 +1613,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')