Skip to content

Commit 6e79ae0

Browse files
committed
Cache PHP instance
Signed-off-by: Matteo Collina <[email protected]>
1 parent eb8ad87 commit 6e79ae0

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/plugin.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,16 @@ export async function plugin (server, opts) {
2828
done(null, body)
2929
})
3030

31+
const php = new Php({
32+
argv: process.argv,
33+
docroot
34+
})
35+
3136
for (const method of HTTP_METHODS) {
3237
server.route({
3338
method,
3439
url: '/*',
3540
handler: async (req, reply) => {
36-
// TODO(mcollina): this should be cached outside
37-
const php = new Php({
38-
argv: process.argv,
39-
docroot
40-
})
41-
4241
const url = urlForRequest(req)
4342

4443
// Php needs capitalized headers

0 commit comments

Comments
 (0)