-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from jobee/update
!!!TASK: Neos 7.x support
- Loading branch information
Showing
4 changed files
with
40 additions
and
30 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
namespace Flowpack\Fusion\Tracing\Http\Middleware; | ||
|
||
use Flowpack\Fusion\Tracing\Aspect\RuntimeTracing; | ||
use Neos\Flow\Annotations as Flow; | ||
use Psr\Http\Message\ResponseInterface; | ||
use Psr\Http\Message\ServerRequestInterface; | ||
use Psr\Http\Server\MiddlewareInterface; | ||
use Psr\Http\Server\RequestHandlerInterface; | ||
|
||
/** | ||
* Look for a "X-Fusion-Tracing" request header and start tracing | ||
*/ | ||
class CheckEnabledMiddleware implements MiddlewareInterface | ||
{ | ||
/** | ||
* @Flow\Inject | ||
* @var RuntimeTracing | ||
*/ | ||
protected $runtimeTracing; | ||
|
||
/** | ||
* @param ServerRequestInterface $request | ||
* @param RequestHandlerInterface $handler | ||
* @return ResponseInterface | ||
*/ | ||
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface | ||
{ | ||
$traceNameHeader = $request->getHeaderLine('X-Fusion-Tracing'); | ||
if (!empty($traceNameHeader)) { | ||
$this->runtimeTracing->enable($traceNameHeader); | ||
} | ||
return $handler->handle($request); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
Neos: | ||
Flow: | ||
http: | ||
chain: | ||
'preprocess': | ||
chain: | ||
'flowpackFusionTracingCheckEnabled': | ||
component: 'Flowpack\Fusion\Tracing\Http\CheckEnabledComponent' | ||
middlewares: | ||
flowpackFusionTracingCheckEnabled: | ||
position: 'start 999' | ||
middleware: 'Flowpack\Fusion\Tracing\Http\Middleware\CheckEnabledMiddleware' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters