diff --git a/CHANGELOG.md b/CHANGELOG.md index 05768d8e9..f2dd52235 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. This projec ## 4.0.2-dev +### Added + +- Added PHP Runtime Generation version to `env:info` command output (#2714) + ## 4.0.1 - 2025-05-19 ### Fixed diff --git a/src/Commands/Env/InfoCommand.php b/src/Commands/Env/InfoCommand.php index bd9ee0c08..c5c3ba80a 100644 --- a/src/Commands/Env/InfoCommand.php +++ b/src/Commands/Env/InfoCommand.php @@ -36,6 +36,7 @@ class InfoCommand extends TerminusCommand implements SiteAwareInterface * connection_mode: Connection Mode * php_version: PHP Version * drush_version: Drush Version + * php_runtime_generation: PHP Runtime Generation * @param string $site_env Site & environment in the format `site-name.env` * * @return \Consolidation\OutputFormatters\StructuredData\PropertyList @@ -67,6 +68,7 @@ public function getPropertyList(TerminusModel $model) unset($properties['drush_version']); unset($properties['php_version']); unset($properties['locked']); + unset($properties['php_runtime_generation']); } return new PropertyList($properties); } diff --git a/src/Models/Environment.php b/src/Models/Environment.php index d21a5f1ca..eb20899ee 100755 --- a/src/Models/Environment.php +++ b/src/Models/Environment.php @@ -683,6 +683,16 @@ public function getPHPVersion() : null; } + /** + * Gets the PHP runtime generation of this environment + * + * @return string + */ + public function getPHPRuntimeGeneration() + { + return $this->settings('appserver_runtime')->php_runtime_generation; + } + /** * @return UpstreamStatus */ @@ -947,6 +957,7 @@ public function serialize() 'initialized' => $this->isInitialized(), 'connection_mode' => $this->get('connection_mode'), 'php_version' => $this->getPHPVersion(), + 'php_runtime_generation' => $this->getPHPRuntimeGeneration(), ]; } diff --git a/tests/Functional/EnvCommandsTest.php b/tests/Functional/EnvCommandsTest.php index 6f28aca3c..31702cf25 100644 --- a/tests/Functional/EnvCommandsTest.php +++ b/tests/Functional/EnvCommandsTest.php @@ -310,6 +310,11 @@ public function testInfoCommand() $envInfo, 'Environment info should have "php_version" field.' ); + $this->assertArrayHasKey( + 'php_runtime_generation', + $envInfo, + 'Environment info should have "php_runtime_generation" field.' + ); } /**