summaryrefslogtreecommitdiff
path: root/lib/ohai/plugins/php.rb
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2016-07-17 12:14:04 -0700
committerTim Smith <tsmith@chef.io>2016-07-17 12:14:04 -0700
commitd8d56362fce3db05bb85eacda45a686074b2c813 (patch)
treea9218f33046e69db1feec5d7b934618c9c0d38f2 /lib/ohai/plugins/php.rb
parentf4f28b23ed7ad8fb0357851e371da720a45ade01 (diff)
downloadohai-php7.tar.gz
Properly detect PHP 7php7
PHP 7 strings have changed and our old regex broke as the build date is no longer included. Update the regex to make the build data optional and add tests for the new strings Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/ohai/plugins/php.rb')
-rw-r--r--lib/ohai/plugins/php.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ohai/plugins/php.rb b/lib/ohai/plugins/php.rb
index 45c43f53..a1f6770c 100644
--- a/lib/ohai/plugins/php.rb
+++ b/lib/ohai/plugins/php.rb
@@ -33,7 +33,7 @@ Ohai.plugin(:PHP) do
php = Mash.new
so.stdout.each_line do |line|
case line
- when /PHP (\S+).+built: ([^)]+)/
+ when /^PHP (\S+)(?:.*built: ([^)]+))?/
php[:version] = $1
php[:builddate] = $2
when /Zend Engine v([^\s]+),/