- Added createStream methods and fixed multiple errors views

This commit is contained in:
Dave M. 2025-12-20 12:44:13 -05:00 committed by Dave Mc Nicoll
parent ca388e8a52
commit d74c916558
8 changed files with 20 additions and 18 deletions

View File

@ -5,7 +5,9 @@ namespace Lean\Factory;
use Laminas\Diactoros\Response\{EmptyResponse, HtmlResponse, JsonResponse, RedirectResponse, TextResponse}; use Laminas\Diactoros\Response\{EmptyResponse, HtmlResponse, JsonResponse, RedirectResponse, TextResponse};
use Lean\Response\{ DownloadResponse, ImageResponse, FileDownloadResponse, PdfResponse }; use Lean\Response\{ DownloadResponse, ImageResponse, FileDownloadResponse, PdfResponse };
use Laminas\Diactoros\Response; use Laminas\Diactoros\Response;
use Laminas\Diactoros\StreamFactory;
use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\StreamInterface;
class HttpFactory implements HttpFactoryInterface class HttpFactory implements HttpFactoryInterface
{ {
@ -58,4 +60,9 @@ class HttpFactory implements HttpFactoryInterface
{ {
return new FileDownloadResponse($path, $code, $headers); return new FileDownloadResponse($path, $code, $headers);
} }
public static function createStream(string $content): StreamInterface
{
return new StreamFactory()->createStream($content);
}
} }

View File

@ -3,6 +3,7 @@
namespace Lean\Factory; namespace Lean\Factory;
use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\StreamInterface;
interface HttpFactoryInterface interface HttpFactoryInterface
{ {
@ -16,4 +17,6 @@ interface HttpFactoryInterface
public static function createDownloadableResponse(string $data, string $filename, int $code = 200, array $headers = []) : ResponseInterface; public static function createDownloadableResponse(string $data, string $filename, int $code = 200, array $headers = []) : ResponseInterface;
public static function createImageResponse(string $data, int $code = 200, array $headers = []) : ResponseInterface; public static function createImageResponse(string $data, int $code = 200, array $headers = []) : ResponseInterface;
public static function createFileDownloadResponse(string $path, int $code = 200, array $headers = []) : ResponseInterface; public static function createFileDownloadResponse(string $path, int $code = 200, array $headers = []) : ResponseInterface;
public static function createStream(string $content) : StreamInterface;
} }

View File

@ -22,5 +22,5 @@
{% section "head.css" %} {% section "head.css" %}
.title {font-size:2rem} .title {font-size:2rem}
.subtitle {font-size:1.25rem; padding-top: 1rem;} .subtitle {font-size:1.25rem; padding-top: 1rem;}
.content {padding-top:1rem} .content {background: #f7f7f7;padding: 7px;color: #8c3c3c;max-height:300px;overflow-y:auto}
{% endsection %} {% endsection %}

View File

@ -18,9 +18,3 @@
{% view "lean/picto/undraw_lost" %} {% view "lean/picto/undraw_lost" %}
</div> </div>
{% endsection %} {% endsection %}
{% section "head.css" %}
.title {font-size:2rem}
.subtitle {font-size:1.25rem; padding-top: 1rem;}
.content {padding-top:1rem}
{% endsection %}

View File

@ -17,10 +17,4 @@
<div class="picto-login"> <div class="picto-login">
{% view "lean/picto/undraw_error" %} {% view "lean/picto/undraw_error" %}
</div> </div>
{% endsection %} {% endsection %}
{% section "head.css" %}
.title {font-size:2rem}
.subtitle {font-size:1.25rem; padding-top: 1rem;}
.content {background: #f7f7f7;padding: 7px;color: #8c3c3c;max-height:300px;overflow-y:auto}
{% endsection %}

View File

@ -10,14 +10,14 @@
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.1/css/bulma.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.1/css/bulma.min.css">
<style> <style>
body {background:#272822} body {background:#272822;min-height:100vh;}
#main-content {min-height: 100vh;width: 100vw;align-items:center;justify-content: center;} #main-content {min-height: 100vh;width: 100vw;align-items:center;justify-content: center;}
#wrapper-content {max-width:960px; max-height:65vh;flex-direction:row-reverse; margin:0 10vw} #wrapper-content {max-width:960px; max-height:65vh;flex-direction:row-reverse; margin:0 10vw}
#wrapper-content .content-right {background:#efefef;padding:5vh 2vw;align-items:center;display:flex;justify-content:center; width:100%;border-radius:6px 0 0 6px} #wrapper-content .content-right {background:#efefef;padding:5vh 2vw;align-items:center;display:flex;justify-content:center; width:100%;border-radius:6px 0 0 6px}
#wrapper-content .content-left {background:#ffffff;padding:5vh 2vw;border-radius:0 6px 6px 0;display:flex;align-items:center;justify-content: center} #wrapper-content .content-left {background:#ffffff;padding:5vh 2vw;border-radius:0 6px 6px 0;display:flex;align-items:center;justify-content: center}
.form-user-login {width:80%;} .form-user-login {width:80%;}
.picto-login svg {max-width:100%;} .picto-login svg {max-width:100%;width:100%;max-height:33vh}
{% section "head.css" %}{% endsection %} {% section "head.css" %}{% endsection %}
</style> </style>

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 42 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB