Created
March 15, 2015 21:10
-
-
Save ghoneycutt/42ab87c20f84ec422535 to your computer and use it in GitHub Desktop.
php_version fact
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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