comparison modules/php/lib/facter/phpversion.rb @ 386:3fce34f642f1

Add a PHP module to handle platform differences
author IBBoard <dev@ibboard.co.uk>
date Mon, 03 Jan 2022 17:09:39 +0000
parents
children adf6fe9bbc17
comparison
equal deleted inserted replaced
385:d9009f54eb23 386:3fce34f642f1
1 Facter.add(:phpversion) do
2 setcode do
3 output = Facter::Util::Resolution.exec('php -v')
4
5 unless output.nil?
6 output.split("\n").first.split(' ').
7 select { |x| x =~ %r{^(?:(\d+)\.)(?:(\d+)\.)?(\*|\d+)} }.first
8 end
9 end
10 end