Skip to content

Commit

Permalink
Merge branch 'foodcritic'
Browse files Browse the repository at this point in the history
  • Loading branch information
jtimberman committed Aug 31, 2012
2 parents 7c2d057 + 24e17e5 commit 14ea3b7
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 26 deletions.
6 changes: 3 additions & 3 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@

default['php']['install_method'] = 'package'

case node["platform"]
when "centos", "redhat", "fedora"
case node["platform_family"]
when "rhel", "fedora"
default['php']['conf_dir'] = '/etc'
default['php']['ext_conf_dir'] = '/etc/php.d'
default['php']['fpm_user'] = 'nobody'
default['php']['fpm_group'] = 'nobody'
default['php']['ext_dir'] = "/usr/#{lib_dir}/php/modules"
when "debian", "ubuntu"
when "debian"
default['php']['conf_dir'] = '/etc/php5/cli'
default['php']['ext_conf_dir'] = '/etc/php5/conf.d'
default['php']['fpm_user'] = 'www-data'
Expand Down
8 changes: 4 additions & 4 deletions providers/pear.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
Chef::Log.info("Installing #{@new_resource} version #{install_version}")
status = install_package(@new_resource.package_name, install_version)
if status
@new_resource.updated_by_last_action(true)
new_resource.updated_by_last_action(true)
end
end
end
Expand All @@ -50,7 +50,7 @@
Chef::Log.info("Upgrading #{@new_resource} version from #{orig_version} to #{candidate_version}")
status = upgrade_package(@new_resource.package_name, candidate_version)
if status
@new_resource.updated_by_last_action(true)
new_resource.updated_by_last_action(true)
end
end
end
Expand All @@ -59,7 +59,7 @@
if removing_package?
Chef::Log.info("Removing #{@new_resource}")
remove_package(@current_resource.package_name, @new_resource.version)
@new_resource.updated_by_last_action(true)
new_resource.updated_by_last_action(true)
else
end
end
Expand All @@ -68,7 +68,7 @@
if removing_package?
Chef::Log.info("Purging #{@new_resource}")
purge_package(@current_resource.package_name, @new_resource.version)
@new_resource.updated_by_last_action(true)
new_resource.updated_by_last_action(true)
end
end

Expand Down
6 changes: 3 additions & 3 deletions recipes/module_apc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
# limitations under the License.
#

case node['platform']
when "centos", "redhat", "fedora", "scientific"
case node['platform_family']
when "rhel", "fedora"
%w{ httpd-devel pcre pcre-devel }.each do |pkg|
package pkg do
action :install
Expand All @@ -30,7 +30,7 @@
action :install
directives(:shm_size => "128M", :enable_cli => 0)
end
when "debian", "ubuntu"
when "debian"
package "php-apc" do
action :install
end
Expand Down
6 changes: 3 additions & 3 deletions recipes/module_curl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
# limitations under the License.
#

case node['platform']
when "centos", "redhat", "fedora", "scientific"
case node['platform_family']
when "rhel", "fedora"
# centos php compiled with curl
when "debian", "ubuntu"
when "debian"
package "php5-curl" do
action :upgrade
end
Expand Down
6 changes: 3 additions & 3 deletions recipes/module_fileinfo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
# limitations under the License.
#

case node['platform']
when "centos", "redhat", "fedora", "scientific"
case node['platform_family']
when "rhel", "fedora"
# enabled by default in php53
when "debian", "ubuntu"
when "debian"
package "php5-fileinfo" do
action :upgrade
end
Expand Down
6 changes: 3 additions & 3 deletions recipes/module_fpdf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
# limitations under the License.
#

case node['platform']
when "centos", "redhat", "fedora", "scientific"
case node['platform_family']
when "rhel", "fedora"
pearhub_chan = php_pear_channel "pearhub.org" do
action :discover
end
php_pear "FPDF" do
channel pearhub_chan.channel_name
action :install
end
when "debian", "ubuntu"
when "debian"
package "php-fpdf" do
action :install
end
Expand Down
6 changes: 3 additions & 3 deletions recipes/module_memcache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
# limitations under the License.
#

case node['platform']
when "centos", "redhat", "fedora", "scientific"
case node['platform_family']
when "rhel", "fedora"
%w{ zlib-devel }.each do |pkg|
package pkg do
action :install
Expand All @@ -30,7 +30,7 @@
action :install
#directives(:shm_size => "128M", :enable_cli => 0)
end
when "debian", "ubuntu"
when "debian"
package "php5-memcache" do
action :install
end
Expand Down
6 changes: 3 additions & 3 deletions recipes/module_sqlite3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
# limitations under the License.
#

case node['platform']
when "centos", "redhat", "fedora", "scientific"
case node['platform_family']
when "rhel", "fedora"
#already there in centos, --with-pdo-sqlite=shared
when "debian", "ubuntu"
when "debian"
package "php5-sqlite" do
action :install
end
Expand Down
1 change: 1 addition & 0 deletions resources/pear.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# limitations under the License.
#

default_action :install
actions :install, :upgrade, :remove, :purge

attribute :package_name, :kind_of => String, :name_attribute => true
Expand Down
3 changes: 2 additions & 1 deletion resources/pear_channel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
# limitations under the License.
#

default_action :discover
actions :discover, :add, :update, :remove

attribute :channel_name, :kind_of => String, :name_attribute => true
attribute :channel_xml, :kind_of => String

# TODO add authenticated channel support!
# attribute :username, :kind_of => String
# attribute :password, :kind_of => String
# attribute :password, :kind_of => String

0 comments on commit 14ea3b7

Please sign in to comment.