Skip to content

Commit

Permalink
[OHAI-509] fix build date parsing from php if php patched with suhosin:
Browse files Browse the repository at this point in the history
$ php -v
PHP 5.3.27 with Suhosin-Patch (cli) (built: Aug 30 2013 04:30:30)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies

Conflicts:
	lib/ohai/plugins/php.rb
  • Loading branch information
glensc authored and btm committed Nov 25, 2013
1 parent bed2a6a commit 0221aed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/ohai/plugins/php.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@

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
Expand Down

0 comments on commit 0221aed

Please sign in to comment.