Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ncou committed Oct 21, 2019
1 parent b3d65e4 commit 24fce65
Show file tree
Hide file tree
Showing 33 changed files with 61 additions and 3,223 deletions.
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@
"ext-json": "*",
"ext-xml": "*",
"ext-mbstring": "*",
"ext-intl": "*",
"psr/http-server-middleware": "^1.0",
"psr/log": "^1.0",
"nikic/fast-route": "^1.3",
"chiron/http-exceptions": "^2.0",
"chiron/psr17factoryfinder": "^0.1",
"chiron/crypt-engine": "^0.1",
"chiron/container": "^3.1",
"chiron/pipeline": "^3.2",
"chiron/config": "^1.1",
"chiron/router-fastroute": "^0.2",
"nyholm/psr7-server": "^0.3",
"vlucas/phpdotenv": "^3.3",
"monolog/monolog": "^1.24",
Expand Down
2 changes: 2 additions & 0 deletions src/Chiron/Http/Emitter/EmitterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

use Psr\Http\Message\ResponseInterface;

//https://github.com/yiisoft/yii-web/blob/master/src/Emitter/EmitterInterface.php

interface EmitterInterface
{
/**
Expand Down
1 change: 1 addition & 0 deletions src/Chiron/Http/Emitter/ResponseEmitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ public function respond(ResponseInterface $response)
*
* @return ResponseInterface
*/
//https://github.com/symfony/http-foundation/blob/master/Response.php#L253
// TODO : regarder aussi ici : https://github.com/cakephp/cakephp/blob/master/src/Http/Response.php#L593 notamment pour le charset !!!!!
// TODO : méthode à déplacer dans la classe Response ???? OUI et à renommer en finalize ou prepare !!!!!
// TODO : regarder plutot cette méthode "$response->prepare()" : https://github.com/symfony/http-foundation/blob/master/Response.php#L256
Expand Down
2 changes: 2 additions & 0 deletions src/Chiron/Http/Middleware/ContentLengthMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
} elseif (! $response->hasHeader('Content-Length')) {
$size = $response->getBody()->getSize();

//die(var_dump($size));

if ($size !== null) {
$response = $response->withHeader('Content-Length', (string) $size);
}
Expand Down
61 changes: 0 additions & 61 deletions src/Chiron/Http/Middleware/DispatcherMiddleware.php

This file was deleted.

4 changes: 4 additions & 0 deletions src/Chiron/Http/Middleware/RequestIdMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

// TODO : regarder pour conditionner l'ajout du header sur la réponse seulement si c'est défini par l'utilisateur, et possibilité d'utiliser un autre header name
// https://github.com/qandidate-labs/stack-request-id/blob/master/src/Qandidate/Stack/RequestId.php#L58
//https://github.com/yiisoft/yii-web/blob/master/src/Middleware/TagRequest.php

class RequestIdMiddleware implements MiddlewareInterface
{
Expand All @@ -30,6 +31,9 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface

// generate an "unique user id" if not already present.
if (empty($uuid)) {
//$uuid = dechex(microtime(true) * 1000000);
//$uuid = md5(uniqid(mt_rand(), true));
//$uuid = sha1(microtime(true).mt_rand(10000, 90000));
$uuid = $this->uuid();
$request = $request->withHeader(self::HEADER_NAME, $uuid);
}
Expand Down
87 changes: 0 additions & 87 deletions src/Chiron/Http/Middleware/RoutingMiddleware.php

This file was deleted.

Loading

0 comments on commit 24fce65

Please sign in to comment.