From 720e9b5bd662add2b0c02c65023d16fe21c1267d Mon Sep 17 00:00:00 2001 From: Alec Reynolds Date: Fri, 24 Nov 2023 13:14:58 -0800 Subject: [PATCH 1/3] Explicitly load php-nginx into the registry for inheriting plugins. --- builders/php.js | 1 + 1 file changed, 1 insertion(+) diff --git a/builders/php.js b/builders/php.js index e02b6ef..c2b43db 100644 --- a/builders/php.js +++ b/builders/php.js @@ -192,6 +192,7 @@ module.exports = { const nginxOpts = nginxConfig(options); // Merge in any user specifified + factory.add(path.resolve(__dirname, './php-nginx.js')); const PhpNginx = factory.get('php-nginx'); const data = new PhpNginx(nginxOpts.name, nginxOpts); // If the user has overriden this service lets make sure we include that as well From 49445f70e6409dbe220194abd07fa3c2f28798c4 Mon Sep 17 00:00:00 2001 From: Alec Reynolds Date: Mon, 27 Nov 2023 13:05:39 -0800 Subject: [PATCH 2/3] Make the php-nginx service type overwritable. --- builders/php.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builders/php.js b/builders/php.js index c2b43db..ab3d204 100644 --- a/builders/php.js +++ b/builders/php.js @@ -21,7 +21,7 @@ const nginxConfig = options => ({ project: options.project, root: options.root, ssl: options.nginxSsl, - type: 'php-nginx', + type: options.nginxServiceType, userConfRoot: options.userConfRoot, webroot: options.webroot, version: options.via.split(':')[1], @@ -132,6 +132,7 @@ module.exports = { via: 'apache', volumes: ['/usr/local/bin'], webroot: '.', + nginxServiceType: 'php-nginx', }, parent: '_appserver', builder: (parent, config) => class LandoPhp extends parent { @@ -192,8 +193,7 @@ module.exports = { const nginxOpts = nginxConfig(options); // Merge in any user specifified - factory.add(path.resolve(__dirname, './php-nginx.js')); - const PhpNginx = factory.get('php-nginx'); + const PhpNginx = factory.get(nginxOpts.type); const data = new PhpNginx(nginxOpts.name, nginxOpts); // If the user has overriden this service lets make sure we include that as well const userOverrides = _.get(options, `_app.config.services.${nginxOpts.name}.overrides`, {}); From e13651b1d5f4479c9e87f2019b3b1150ed468220 Mon Sep 17 00:00:00 2001 From: Alec Reynolds Date: Mon, 27 Nov 2023 13:33:12 -0800 Subject: [PATCH 3/3] Include nginx builder from relative path. --- builders/php-nginx.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builders/php-nginx.js b/builders/php-nginx.js index 6968c11..7237c85 100644 --- a/builders/php-nginx.js +++ b/builders/php-nginx.js @@ -1,7 +1,7 @@ 'use strict'; const _ = require('lodash'); -const LandoNginx = require('./../node_modules/@lando/nginx/builders/nginx.js'); +const LandoNginx = require('@lando/nginx/builders/nginx.js'); // Builder module.exports = {