summaryrefslogtreecommitdiff
path: root/lib/ohai/plugins/php.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ohai/plugins/php.rb')
-rw-r--r--lib/ohai/plugins/php.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ohai/plugins/php.rb b/lib/ohai/plugins/php.rb
index 7489b52f..49d8cb74 100644
--- a/lib/ohai/plugins/php.rb
+++ b/lib/ohai/plugins/php.rb
@@ -28,10 +28,10 @@ Ohai.plugin(:PHP) do
so = shell_out("php -v")
if so.exitstatus == 0
- output = so.stdout.split
- if output.length >= 6
+ output = /PHP (\S+).+built: ([^)]+)/.match(so.stdout)
+ if output
php[:version] = output[1]
- php[:builddate] = "%s %s %s" % [output[4],output[5],output[6]]
+ php[:builddate] = output[2]
end
languages[:php] = php if php[:version]
end