Skip to content

Commit 6ef1e17

Browse files
authored
add symfony http kernel terminate hook (#86)
1 parent 0f8369c commit 6ef1e17

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/LaravelRunner.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,7 @@ public function handle(Request $request, Response $response): void
5757

5858
$response->status($sfResponse->getStatusCode());
5959
$response->end($sfResponse->getContent());
60+
61+
$this->application->terminate($sfRequest, $sfResponse);
6062
}
6163
}

src/SymfonyRunner.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Symfony\Component\HttpFoundation\HeaderBag;
88
use Symfony\Component\HttpFoundation\Request as SymfonyRequest;
99
use Symfony\Component\HttpKernel\HttpKernelInterface;
10+
use Symfony\Component\HttpKernel\TerminableInterface;
1011
use Symfony\Component\Runtime\RunnerInterface;
1112

1213
/**
@@ -57,5 +58,9 @@ public function handle(Request $request, Response $response): void
5758

5859
$response->status($sfResponse->getStatusCode());
5960
$response->end($sfResponse->getContent());
61+
62+
if ($this->application instanceof TerminableInterface) {
63+
$this->application->terminate($sfRequest, $sfResponse);
64+
}
6065
}
6166
}

0 commit comments

Comments
 (0)