Skip to content

Commit

Permalink
Resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
tas50 authored and Rockstar04 committed Jul 6, 2015
1 parent 21a349a commit 6002523
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 68 deletions.
12 changes: 6 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ desc 'Run all style checks'
task style: ['style:chef', 'style:ruby']

# Rspec and ChefSpec
desc "Run ChefSpec examples"
desc 'Run ChefSpec examples'
RSpec::Core::RakeTask.new(:spec)

# Integration tests. Kitchen.ci
Expand All @@ -33,21 +33,21 @@ namespace :integration do
instance.test(:always)
end
end

desc 'Run Test Kitchen with cloud plugins'
task :cloud do
run_kitchen = true
if ENV['TRAVIS'] == 'true' && ENV['TRAVIS_PULL_REQUEST'] != 'false'
run_kitchen = false
end

if run_kitchen
Kitchen.logger = Kitchen.default_file_logger
@loader = Kitchen::Loader::YAML.new(project_config: './.kitchen.cloud.yml')
config = Kitchen::Config.new( loader: @loader)
config = Kitchen::Config.new(loader: @loader)
config.instances.each do |instance|
instance.test(:always)
end
instance.test(:always)
end
end
end
end
Expand Down
38 changes: 19 additions & 19 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
default['php']['fpm_group'] = 'nobody'
default['php']['ext_dir'] = "/usr/#{lib_dir}/php/modules"
if node['platform_version'].to_f < 6
default['php']['packages'] = %w{ php53 php53-devel php53-cli php-pear }
default['php']['packages'] = %w(php53 php53-devel php53-cli php-pear)
else
default['php']['packages'] = %w{ php php-devel php-cli php-pear }
default['php']['packages'] = %w(php php-devel php-cli php-pear)
default['php']['fpm_package'] = 'php-fpm'
default['php']['fpm_pooldir'] = '/etc/php-fpm.d'
default['php']['fpm_default_conf'] = '/etc/php-fpm.d/www.conf'
Expand All @@ -59,7 +59,7 @@
else
default['php']['ext_conf_dir'] = '/etc/php5/conf.d'
end
default['php']['packages'] = %w{ php5-cgi php5 php5-dev php5-cli php-pear }
default['php']['packages'] = %w(php5-cgi php5 php5-dev php5-cli php-pear)
default['php']['fpm_package'] = 'php5-fpm'
default['php']['fpm_pooldir'] = '/etc/php5/fpm/pool.d'
default['php']['fpm_user'] = 'www-data'
Expand All @@ -71,7 +71,7 @@
default['php']['ext_conf_dir'] = '/etc/php5/conf.d'
default['php']['fpm_user'] = 'wwwrun'
default['php']['fpm_group'] = 'www'
default['php']['packages'] = %w{ apache2-mod_php5 php5-pear }
default['php']['packages'] = %w(apache2-mod_php5 php5-pear)
lib_dir = node['kernel']['machine'] =~ /x86_64/ ? 'lib64' : 'lib'
when 'windows'
default['php']['windows']['msi_name'] = 'PHP 5.3.28'
Expand All @@ -80,16 +80,16 @@
default['php']['conf_dir'] = 'C:\Program Files (x86)\PHP'
default['php']['ext_conf_dir'] = node['php']['conf_dir']
# These extensions are installed by default by the GUI MSI
default['php']['packages'] = %w{ cgi ScriptExecutable PEAR
iis4FastCGI ext_php_bz2 ext_php_curl
ext_php_exif ext_php_gd2 ext_php_gettext
ext_php_gmp ext_php_imap ext_php_mbstring
ext_php_mysql ext_php_mysqli ext_php_openssl
ext_php_pdo_mysql ext_php_pdo_odbc ext_php_pdo_sqlite
ext_php_pgsql ext_php_soap ext_php_sockets
ext_php_sqlite3 ext_php_tidy ext_php_xmlrpc
}
default['php']['package_options'] = "" # Use this to customise your yum or apt command
default['php']['packages'] = %w(cgi ScriptExecutable PEAR
iis4FastCGI ext_php_bz2 ext_php_curl
ext_php_exif ext_php_gd2 ext_php_gettext
ext_php_gmp ext_php_imap ext_php_mbstring
ext_php_mysql ext_php_mysqli ext_php_openssl
ext_php_pdo_mysql ext_php_pdo_odbc ext_php_pdo_sqlite
ext_php_pgsql ext_php_soap ext_php_sockets
ext_php_sqlite3 ext_php_tidy ext_php_xmlrpc
)
default['php']['package_options'] = '' # Use this to customise your yum or apt command
default['php']['pear'] = 'pear.bat'
default['php']['pecl'] = 'pecl.bat'
when 'freebsd'
Expand All @@ -103,15 +103,15 @@
default['php']['ext_conf_dir'] = '/etc/php5/conf.d'
default['php']['fpm_user'] = 'www-data'
default['php']['fpm_group'] = 'www-data'
default['php']['packages'] = %w{ php5-cgi php5 php5-dev php5-cli php-pear }
default['php']['packages'] = %w(php5-cgi php5 php5-dev php5-cli php-pear)
end

default['php']['url'] = 'http://us1.php.net/get'
default['php']['version'] = '5.5.9'
default['php']['checksum'] = '378de162efdaeeb725ed38d7fe956c9f0b9084ff'
default['php']['prefix_dir'] = '/usr/local'

default['php']['configure_options'] = %W{--prefix=#{php['prefix_dir']}
default['php']['configure_options'] = %W(--prefix=#{php['prefix_dir']}
--with-libdir=#{lib_dir}
--with-config-file-path=#{php['conf_dir']}
--with-config-file-scan-dir=#{php['ext_conf_dir']}
Expand Down Expand Up @@ -147,7 +147,7 @@
--with-mysql-sock
--with-sqlite3
--with-pdo-mysql
--with-pdo-sqlite}
--with-pdo-sqlite)

default['php']['ini']['template'] = "php.ini.erb"
default['php']['ini']['cookbook'] = "php"
default['php']['ini']['template'] = 'php.ini.erb'
default['php']['ini']['cookbook'] = 'php'
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
depends 'windows'
depends 'iis'

%w{ debian ubuntu centos redhat fedora scientific amazon windows oracle }.each do |os|
%w(debian ubuntu centos redhat fedora scientific amazon windows oracle).each do |os|
supports os
end

Expand Down
36 changes: 18 additions & 18 deletions providers/pear.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ def current_installed_version
@current_installed_version ||= begin
v = nil
version_check_cmd = "#{@bin} -d "
version_check_cmd << " preferred_state=#{can_haz(@new_resource, "preferred_state")}"
version_check_cmd << " list#{expand_channel(can_haz(@new_resource, "channel"))}"
version_check_cmd << " preferred_state=#{can_haz(@new_resource, 'preferred_state')}"
version_check_cmd << " list#{expand_channel(can_haz(@new_resource, 'channel'))}"
p = shell_out(version_check_cmd)
response = nil
response = grep_for_version(p.stdout, @new_resource.package_name) if p.stdout =~ /\.?Installed packages/i
Expand All @@ -131,8 +131,8 @@ def current_installed_version
def candidate_version
@candidate_version ||= begin
candidate_version_cmd = "#{@bin} -d "
candidate_version_cmd << "preferred_state=#{can_haz(@new_resource, "preferred_state")}"
candidate_version_cmd << " search#{expand_channel(can_haz(@new_resource, "channel"))}"
candidate_version_cmd << "preferred_state=#{can_haz(@new_resource, 'preferred_state')}"
candidate_version_cmd << " search#{expand_channel(can_haz(@new_resource, 'channel'))}"
candidate_version_cmd << "#{@new_resource.package_name}"
p = shell_out(candidate_version_cmd)
response = nil
Expand All @@ -143,9 +143,9 @@ def candidate_version

def install_package(name, version)
command = "echo \"\r\" | #{@bin} -d"
command << " preferred_state=#{can_haz(@new_resource, "preferred_state")}"
command << " preferred_state=#{can_haz(@new_resource, 'preferred_state')}"
command << " install -a#{expand_options(@new_resource.options)}"
command << " #{prefix_channel(can_haz(@new_resource, "channel"))}#{name}"
command << " #{prefix_channel(can_haz(@new_resource, 'channel'))}#{name}"
command << "-#{version}" if version && !version.empty?
pear_shell_out(command)
manage_pecl_ini(name, :create, can_haz(@new_resource, 'directives'), can_haz(@new_resource, 'zend_extensions')) if pecl?
Expand All @@ -154,9 +154,9 @@ def install_package(name, version)

def upgrade_package(name, version)
command = "echo \"\r\" | #{@bin} -d"
command << " preferred_state=#{can_haz(@new_resource, "preferred_state")}"
command << " preferred_state=#{can_haz(@new_resource, 'preferred_state')}"
command << " upgrade -a#{expand_options(@new_resource.options)}"
command << " #{prefix_channel(can_haz(@new_resource, "channel"))}#{name}"
command << " #{prefix_channel(can_haz(@new_resource, 'channel'))}#{name}"
command << "-#{version}" if version && !version.empty?
pear_shell_out(command)
manage_pecl_ini(name, :create, can_haz(@new_resource, 'directives'), can_haz(@new_resource, 'zend_extensions')) if pecl?
Expand All @@ -166,7 +166,7 @@ def upgrade_package(name, version)
def remove_package(name, version)
command = "#{@bin} uninstall"
command << " #{expand_options(@new_resource.options)}"
command << " #{prefix_channel(can_haz(@new_resource, "channel"))}#{name}"
command << " #{prefix_channel(can_haz(@new_resource, 'channel'))}#{name}"
command << "-#{version}" if version && !version.empty?
pear_shell_out(command)
disable_package(name)
Expand Down Expand Up @@ -231,12 +231,12 @@ def manage_pecl_ini(name, action, directives, zend_extensions)
files = get_extension_files(name)

extensions = Hash[
files.map do |filepath|
rel_file = filepath.clone
rel_file.slice! ext_prefix if rel_file.start_with? ext_prefix
zend = zend_extensions.include?(rel_file)
[(zend ? filepath : rel_file) , zend]
end
files.map do |filepath|
rel_file = filepath.clone
rel_file.slice! ext_prefix if rel_file.start_with? ext_prefix
zend = zend_extensions.include?(rel_file)
[(zend ? filepath : rel_file), zend]
end
]

template "#{node['php']['ext_conf_dir']}/#{name}.ini" do
Expand Down Expand Up @@ -274,9 +274,9 @@ def pecl?
@pecl ||=
begin
# search as a pear first since most 3rd party channels will report pears as pecls!
search_args = String.new
search_args << " -d preferred_state=#{can_haz(@new_resource, "preferred_state")}"
search_args << " search#{expand_channel(can_haz(@new_resource, "channel"))} #{@new_resource.package_name}"
search_args = ''
search_args << " -d preferred_state=#{can_haz(@new_resource, 'preferred_state')}"
search_args << " search#{expand_channel(can_haz(@new_resource, 'channel'))} #{@new_resource.package_name}"

if grep_for_version(shell_out(node['php']['pear'] + search_args).stdout, @new_resource.package_name)
false
Expand Down
10 changes: 4 additions & 6 deletions providers/pear_channel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,8 @@ def load_current_resource
private

def exists?
begin
shell_out!("#{node['php']['pear']} channel-info #{@current_resource.channel_name}")
true
rescue Mixlib::ShellOut::ShellCommandFailed
false
end
shell_out!("#{node['php']['pear']} channel-info #{@current_resource.channel_name}")
true
rescue Mixlib::ShellOut::ShellCommandFailed
false
end
2 changes: 1 addition & 1 deletion recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@
action :update
end

include_recipe "php::ini"
include_recipe 'php::ini'
10 changes: 5 additions & 5 deletions recipes/ini.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
#

template "#{node['php']['conf_dir']}/php.ini" do
source node['php']['ini']['template']
cookbook node['php']['ini']['cookbook']
unless platform?('windows')
source node['php']['ini']['template']
cookbook node['php']['ini']['cookbook']
unless platform?('windows')
owner 'root'
group node['root_group']
mode '0644'
end
variables(:directives => node['php']['directives'])
end
variables(:directives => node['php']['directives'])
end
2 changes: 1 addition & 1 deletion recipes/module_apc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

case node['platform_family']
when 'rhel', 'fedora'
%w{ httpd-devel pcre pcre-devel }.each do |pkg|
%w(httpd-devel pcre pcre-devel).each do |pkg|
package pkg do
action :install
end
Expand Down
2 changes: 1 addition & 1 deletion recipes/module_memcache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

case node['platform_family']
when 'rhel', 'fedora'
%w{ zlib-devel }.each do |pkg|
%w(zlib-devel).each do |pkg|
package pkg do
action :install
end
Expand Down
12 changes: 6 additions & 6 deletions recipes/package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
source node['php']['windows']['msi_source']
installer_type :msi

options %W[
/quiet
INSTALLDIR="#{install_dir}"
ADDLOCAL=#{node['php']['packages'].join(',')}
].join(' ')
options %W(
/quiet
INSTALLDIR="#{install_dir}"
ADDLOCAL=#{node['php']['packages'].join(',')}
).join(' ')
end

# WARNING: This is not the out-of-the-box go-pear.phar. It's been modified to patch this bug:
Expand Down Expand Up @@ -63,4 +63,4 @@
end
end

include_recipe "php::ini"
include_recipe 'php::ini'
8 changes: 4 additions & 4 deletions recipes/source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
end

pkgs = value_for_platform_family(
%w{ rhel fedora } => %w{ bzip2-devel libc-client-devel curl-devel freetype-devel gmp-devel libjpeg-devel krb5-devel libmcrypt-devel libpng-devel openssl-devel t1lib-devel mhash-devel },
%w{ debian ubuntu } => %w{ libbz2-dev libc-client2007e-dev libcurl4-gnutls-dev libfreetype6-dev libgmp3-dev libjpeg62-dev libkrb5-dev libmcrypt-dev libpng12-dev libssl-dev libt1-dev },
'default' => %w{ libbz2-dev libc-client2007e-dev libcurl4-gnutls-dev libfreetype6-dev libgmp3-dev libjpeg62-dev libkrb5-dev libmcrypt-dev libpng12-dev libssl-dev libt1-dev }
%w(rhel fedora) => %w(bzip2-devel libc-client-devel curl-devel freetype-devel gmp-devel libjpeg-devel krb5-devel libmcrypt-devel libpng-devel openssl-devel t1lib-devel mhash-devel),
%w(debian ubuntu) => %w(libbz2-dev libc-client2007e-dev libcurl4-gnutls-dev libfreetype6-dev libgmp3-dev libjpeg62-dev libkrb5-dev libmcrypt-dev libpng12-dev libssl-dev libt1-dev),
'default' => %w(libbz2-dev libc-client2007e-dev libcurl4-gnutls-dev libfreetype6-dev libgmp3-dev libjpeg62-dev libkrb5-dev libmcrypt-dev libpng12-dev libssl-dev libt1-dev)
)

pkgs.each do |pkg|
Expand Down Expand Up @@ -86,4 +86,4 @@
recursive true
end

include_recipe "php::ini"
include_recipe 'php::ini'

0 comments on commit 6002523

Please sign in to comment.