Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})

* Fixed `@@tx_isolation` usage for MariaDB 10.4 compatibility
* Updated to [@lando/php@1.12.0](https://github.com/lando/php/releases/tag/v1.12.0) to enable mod_headers/mod_expires by default and fix xdebug log ownership

## v1.12.0 - [February 22, 2026](https://github.com/lando/pantheon/releases/tag/v1.12.0)

* Added `-vv`/`--verbose` and `-vvv`/`--debug` flag passthrough to all Terminus commands in `lando pull` and `lando push` [#215](https://github.com/lando/pantheon/issues/215)
Expand Down
8 changes: 8 additions & 0 deletions builders/pantheon-php.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ const path = require('path');
const LandoPhp = require('@lando/php/builders/php.js');
const utils = require('./../lib/utils.js');

// PHP versions that have generation 5 images; older versions top out at generation 4
const SUPPORTED_PHP_VERSIONS_GEN5 = ['8.0', '8.1', '8.2', '8.3', '8.4'];
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated PHP version lists risk going out of sync

Medium Severity

The supported PHP version list is hardcoded identically in both SUPPORTED_PHP_VERSIONS_GEN5 in builders/pantheon-php.js and SUPPORTED_PHP_VERSIONS in lib/utils.js. Since utils is already imported in the builder file, exporting the constant from utils and reusing it would prevent the two lists from drifting apart when a new PHP version is added.

Additional Locations (1)
Fix in Cursor Fix in Web


// Builder
module.exports = {
name: 'pantheon-php',
Expand All @@ -21,6 +24,11 @@ module.exports = {
if (options.php === '7' || options.php === 7) options.php = '7.0';
if (options.php === '8' || options.php === 8) options.php = '8.0';

// Safety check: fall back to generation 4 if the php+generation combo has no image
if (options.generation === '5' && !SUPPORTED_PHP_VERSIONS_GEN5.includes(String(options.php))) {
options.generation = '4';
}

// main event
options.version = options.php;
options.image = `devwithlando/pantheon-appserver:${options.php}-${options.generation}`;
Expand Down
2 changes: 1 addition & 1 deletion examples/drupal10/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ lando exec database -- "mysql -V" | grep 10.4.

# Should have the transaction isolation level set to READ-COMMITTED
cd drupal10
lando mysql -e "SELECT @@transaction_isolation;" | grep READ-COMMITTED
lando mysql -e "SELECT @@tx_isolation;" | grep READ-COMMITTED

# Should use a varnish http_resp_hdr_len setting of 25k
cd drupal10
Expand Down
2 changes: 1 addition & 1 deletion examples/drupal11/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ lando exec database -- "mysql -V" | grep 10.6.

# Should have the transaction isolation level set to READ-COMMITTED
cd drupal11
lando mysql -e "SELECT @@transaction_isolation;" | grep READ-COMMITTED
lando mysql -e "SELECT @@tx_isolation;" | grep READ-COMMITTED

# Should use a varnish http_resp_hdr_len setting of 25k
cd drupal11
Expand Down
15 changes: 14 additions & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,17 @@ exports.getPantheonCache = {
* @param {string[]} [files=['pantheon.upstream.yml', 'pantheon.yml']] - YAML files to process
* @return {Object} Merged configuration object
*/
// PHP versions that have generation 5 images on Docker Hub
const SUPPORTED_PHP_VERSIONS = ['8.0', '8.1', '8.2', '8.3', '8.4'];
const DEFAULT_PHP_VERSION = '8.3';

exports.getPantheonConfig = (files = ['pantheon.upstream.yml', 'pantheon.yml']) => _(files)
.filter(file => fs.existsSync(file))
.map(file => yaml.load(fs.readFileSync(file)))
.thru(data => _.merge({}, ...data))
.thru(data => {
// Set the php version
data.php = _.toString(_.get(data, 'php_version', '8.3'));
data.php = _.toString(_.get(data, 'php_version', DEFAULT_PHP_VERSION));
// Set the webroot
data.webroot = (_.get(data, 'web_docroot', false)) ? 'web' : '.';
// Set the drush version
Expand All @@ -230,6 +234,15 @@ exports.getPantheonConfig = (files = ['pantheon.upstream.yml', 'pantheon.yml'])
// @DEPRECATED: Pantheon php_runtime_generation: 1 is deprecated and will be removed April 2026.
const phpRuntimeGen = _.get(data, 'php_runtime_generation', 2);
data.generation = phpRuntimeGen === 1 ? '4' : '5';
// Warn and fall back to generation 4 if the configured PHP version has no generation 5 image
if (data.generation === '5' && !SUPPORTED_PHP_VERSIONS.includes(data.php)) {
console.warn([
`\n⚠️ WARNING: PHP ${data.php} does not have a generation 5 image.`,
` Falling back to the generation 4 image (devwithlando/pantheon-appserver:${data.php}-4).`,
` Consider updating php_version in your pantheon.yml to a supported version: ${SUPPORTED_PHP_VERSIONS.join(', ')}\n`,
].join('\n'));
data.generation = '4';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fallback to generation 4 instead of PHP 8.3 fails

High Severity

When an unsupported PHP version (e.g. 7.1) is detected with generation 5, the code falls back to generation 4 while keeping the old PHP version. However, generation 4 images likely don't exist on Docker Hub either, so the user would still get a manifest unknown Docker error — just with tag 7.1-4 instead of 7.1-5. The PR description states the intent is to fall back to PHP 8.3 (via the defined but unused-in-fallback DEFAULT_PHP_VERSION constant), which would actually resolve the issue since gen 5 images for 8.3 exist.

Additional Locations (1)
Fix in Cursor Fix in Web

}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

YAML-parsed PHP 8.0 incorrectly flagged as unsupported

High Severity

When php_version: 8.0 appears in pantheon.yml, js-yaml parses it as the number 8 (since 8.0 === 8 in JS). _.toString(8) produces '8', which doesn't match '8.0' in SUPPORTED_PHP_VERSIONS. This causes the version check to incorrectly flag PHP 8.0 as unsupported, emit a spurious warning, and change generation to '4'. The builder normalizes '8''8.0' on lines 24–25, but that happens too late — getPantheonConfig has already altered the generation. PHP 8.0 is a valid, supported version and this would break users who have it configured.

Fix in Cursor Fix in Web

// Set the tika version if specified in pantheon.yml
const tikaVersion = _.get(data, 'tika_version');
if (tikaVersion !== undefined) {
Expand Down
10 changes: 5 additions & 5 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 @@ -45,7 +45,7 @@
},
"dependencies": {
"@lando/mariadb": "^1.7.0",
"@lando/php": "^1.11.1",
"@lando/php": "^1.12.0",
"@lando/redis": "^1.2.3",
"@lando/solr": "^1.3.3",
"@lando/varnish": "^1.3.1",
Expand Down