Skip to content

Instantly share code, notes, and snippets.

@ghoneycutt
Created March 15, 2015 21:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ghoneycutt/42ab87c20f84ec422535 to your computer and use it in GitHub Desktop.
Save ghoneycutt/42ab87c20f84ec422535 to your computer and use it in GitHub Desktop.
php_version fact
Facter.add("php_version") do
setcode do
test_exists = "which php 2>&1 >/dev/null ; echo $?"
if Facter::Util::Resolution.exec(test_exists) == '0'
php_output = Facter::Util::Resolution.exec('php --version')
php_output.split[1]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment