Skip to content

Commit

Permalink
Merge pull request #119 from lando/update-php-v1.7.1
Browse files Browse the repository at this point in the history
Updated acquia to use lando/php@v1.7.1
  • Loading branch information
AaronFeledy authored Jan 29, 2025
2 parents 2b98261 + 44ceeee commit cf014a0
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 25 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})

* Updated lando/php to v1.7.1.

## v1.6.1 - [December 11, 2024](https://github.com/lando/acquia/releases/tag/v1.6.1)

* Optimized for `midcore`
Expand Down
36 changes: 18 additions & 18 deletions builders/acquia-php.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
'use strict';

const _ = require('lodash');
const fs = require('fs');
const path = require('path');
const landoPhpPath = path.join(__dirname, '../node_modules/@lando/php');
const LandoPhp = require(`${landoPhpPath}/builders/php.js`);

const loadScripts = options => {
const lando = _.get(options, '_app._lando');
// Move the script to the confDir and make executable.
if (fs.existsSync(path.join(landoPhpPath, 'scripts'))) {
const confDir = path.join(lando.config.userConfRoot, 'scripts');
const dest = lando.utils.moveConfig(path.join(landoPhpPath, 'scripts'), confDir);
lando.utils.makeExecutable(fs.readdirSync(dest), dest);
lando.log.debug('automoved scripts from %s to %s and set to mode 755',
path.join(landoPhpPath, 'scripts'), confDir);
}
};

// Builder
/**
* Acquia PHP builder class that extends Lando PHP builder.
* Uses the bundled version of @lando/php plugin instead of user's version.
*
* @module acquia-php
*/
module.exports = {
name: 'acquia-php',
parent: '_appserver',
builder: (parent, config) => class AcquiaPhp extends LandoPhp.builder(parent, LandoPhp.config) {
/**
* Builder function that returns the AcquiaPhp class
* @param {Object} parent - Parent builder class
* @return {Class} AcquiaPhp class extending LandoPhp builder
*/
builder: parent => class AcquiaPhp extends LandoPhp.builder(parent, LandoPhp.config) {
/**
* Create a new AcquiaPhp instance
* @param {string} id - Service id
* @param {Object} options - Service options
* @param {Object} factory - App factory instance
*/
constructor(id, options = {}, factory) {
options = _.merge({}, config, options);
loadScripts(options);
super(id, options, factory);
}
},
Expand Down
11 changes: 5 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@lando/mailhog": "^1.2.3",
"@lando/memcached": "^1.3.3",
"@lando/mysql": "^1.4.4",
"@lando/php": "^1.6.3",
"@lando/php": "^1.7.1",
"@lando/postgres": "^1.4.4",
"axios": "^1.6.7",
"js-yaml": "^4.1.0",
Expand Down

0 comments on commit cf014a0

Please sign in to comment.