From 35b1ad81373f477a61594298ad146118c8188870 Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Tue, 3 Jun 2025 09:57:24 +0200 Subject: [PATCH] Cached php engine Signed-off-by: Matteo Collina --- lib/plugin.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/plugin.js b/lib/plugin.js index 58cbdcc..ebb5cf8 100644 --- a/lib/plugin.js +++ b/lib/plugin.js @@ -28,17 +28,16 @@ export async function plugin (server, opts) { done(null, body) }) + const php = new Php({ + argv: process.argv, + docroot + }) + for (const method of HTTP_METHODS) { server.route({ method, url: '/*', handler: async (req, reply) => { - // TODO(mcollina): this should be cached outside - const php = new Php({ - argv: process.argv, - docroot - }) - const url = urlForRequest(req) // Php needs capitalized headers