Skip to content

Instantly share code, notes, and snippets.

@sheldonh
Created June 8, 2009 12:42
Show Gist options
  • Select an option

  • Save sheldonh/125792 to your computer and use it in GitHub Desktop.

Select an option

Save sheldonh/125792 to your computer and use it in GitHub Desktop.
[4, 5].each do |version|
fact = "php#{version}_extensions".to_sym
Facter.add(fact) do
setcode do
extensions = []
IO.popen("php#{version} -i").each do |line|
line.chomp!
line.gsub!(/^ionCube Loader$/, "ioncube")
line.gsub!(/^Zend Optimizer$/, "zend_optimizer")
if line =~ /^[a-z0-9_]+$/
extensions << line
end
end
extensions.sort.join(" ")
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment