Skip to content
This repository has been archived by the owner on Jun 30, 2020. It is now read-only.

Adds support for selection of PHP version #8

Merged
merged 2 commits into from Oct 31, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
104 changes: 0 additions & 104 deletions Gemfile.lock

This file was deleted.

9 changes: 8 additions & 1 deletion README.md
Expand Up @@ -37,6 +37,7 @@ The following Opscode cookbooks are dependencies:
* `['xdebug']['profiler_enable_trigger']` = Defaults to `0`.
* `['xdebug']['profiler_enable']` = Defaults to `0`.
* `['xdebug']['profiler_output_dir']` = Defaults to `/tmp/cachegrind`.
* `['php']['ius']` = Defaults to `5.3`.

# Providers

Expand All @@ -60,6 +61,10 @@ Install the additional PHP modules not part of the Opscode cookbook.

Installs and configures a standard set of tools used in development of PHP projects. This will install the standard set of static code analysis tools for PHP as well as testing and quality assurance tools.

## package

Installs the php5 package. The version can be controlled on yum based systems using the `['php']['ius']` value. Possible vaulues are '5.4', '5.3' or false (to install the latest php package from the default repository).

## module_dev

Installs the php5_dev module that is required by xdebug.
Expand Down Expand Up @@ -149,7 +154,9 @@ If you are setting up a development environment you can use the single recipe th

# License and Author

Author:: Alistair Stead (alistair@inviqa.com) Author:: Marcello Duarte (marcello@inviqa.com)
Author:: Alistair Stead (alistair@inviqa.com)
Author:: Marcello Duarte (marcello@inviqa.com)
Author:: Ben Longden (blongden@inviqa.com)

Copyright 2012, Inviqa

Expand Down
3 changes: 2 additions & 1 deletion attributes/default.rb
Expand Up @@ -8,4 +8,5 @@
default['xdebug']['file_link_format'] = "txmt://open?url=file://%f&line=%1"
default['xdebug']['profiler_enable_trigger'] = 0
default['xdebug']['profiler_enable'] = 0
default['xdebug']['profiler_output_dir'] = "/tmp/cachegrind"
default['xdebug']['profiler_output_dir'] = "/tmp/cachegrind"
default['php']['ius'] = "5.3"
10 changes: 4 additions & 6 deletions recipes/module_dev.rb
Expand Up @@ -19,12 +19,10 @@

include_recipe "chef-php-extra"

if node['platform_version'].to_f < 6.0
if File.exists?("/etc/yum.repos.d/ius.repo")
packages = %w{ php53u-devel }
else
packages = %w{ php53-devel }
end
if node['php']['ius'] == "5.4"
packages = %w{ php54-devel }
elsif node['php']['ius'] == "5.3"
packages = %w{ php53u-devel }
else
packages = %w{ php-devel }
end
Expand Down
10 changes: 4 additions & 6 deletions recipes/module_gd.rb
Expand Up @@ -19,12 +19,10 @@

include_recipe "chef-php-extra"

if node['platform_version'].to_f < 6.0
if File.exists?("/etc/yum.repos.d/ius.repo")
packages = %w{ php53u-gd }
else
packages = %w{ php53-gd }
end
if node['php']['ius'] == "5.4"
packages = %w{ php54-gd }
elsif node['php']['ius'] == "5.3"
packages = %w{ php53u-gd }
else
packages = %w{ php-gd }
end
Expand Down
10 changes: 4 additions & 6 deletions recipes/module_imagick.rb
Expand Up @@ -19,12 +19,10 @@

include_recipe "chef-php-extra"

if node['platform_version'].to_f < 6.0
if File.exists?("/etc/yum.repos.d/ius.repo")
packages = %w{ php53u-imagick }
else
packages = %w{ php53-imagick }
end
if node['php']['ius'] == "5.4"
packages = %w{ php54-imagick }
elsif node['php']['ius'] == "5.3"
packages = %w{ php53u-imagick }
else
packages = %w{ php-imagick }
end
Expand Down
16 changes: 5 additions & 11 deletions recipes/module_mcrypt.rb
Expand Up @@ -19,18 +19,12 @@

include_recipe "chef-php-extra"

if platform?("redhat", "centos", "fedora", "amazon", "scientific")
include_recipe "yum::ius"
end

if node['platform_version'].to_f < 6.0
if File.exists?("/etc/yum.repos.d/ius.repo")
if node['php']['ius'] == "5.4"
packages = %w{ php54-mcrypt }
elsif node['php']['ius'] == "5.3"
packages = %w{ php53u-mcrypt }
else
packages = %w{ php-mcrypt }
end
else
packages = %w{ php-mcrypt }
packages = %w{ php-mcrypt }
end

pkgs = value_for_platform(
Expand All @@ -50,4 +44,4 @@

template "#{node['php']['ext_conf_dir']}/mcrypt.ini" do
mode "0644"
end
end
10 changes: 4 additions & 6 deletions recipes/module_mysql.rb
Expand Up @@ -19,14 +19,12 @@

include_recipe "chef-php-extra"

if node['platform_version'].to_f < 6.0
if File.exists?("/etc/yum.repos.d/ius.repo")
if node['php']['ius'] == "5.4"
packages = %w{ php54-mysql }
elsif node['php']['ius'] == "5.3"
packages = %w{ php53u-mysql }
else
packages = %w{ php53-mysql }
end
else
packages = %w{ php-mysql }
packages = %w{ php-mysql }
end

pkgs = value_for_platform(
Expand Down
10 changes: 4 additions & 6 deletions recipes/module_soap.rb
Expand Up @@ -19,14 +19,12 @@

include_recipe "chef-php-extra"

if node['platform_version'].to_f < 6.0
if File.exists?("/etc/yum.repos.d/ius.repo")
if node['php']['ius'] == "5.4"
packages = %w{ php54-soap }
elsif node['php']['ius'] == "5.3"
packages = %w{ php53u-soap }
else
packages = %w{ php53-soap }
end
else
packages = %w{ php-soap }
packages = %w{ php-soap }
end

pkgs = value_for_platform(
Expand Down
10 changes: 4 additions & 6 deletions recipes/module_xml.rb
Expand Up @@ -19,14 +19,12 @@

include_recipe "chef-php-extra"

if node['platform_version'].to_f < 6.0
if File.exists?("/etc/yum.repos.d/ius.repo")
if node['php']['ius'] == "5.4"
packages = %w{ php54-xml }
elsif node['php']['ius'] == "5.3"
packages = %w{ php53u-xml }
else
packages = %w{ php53-xml }
end
else
packages = %w{ php-xml }
packages = %w{ php-xml }
end

pkgs = value_for_platform(
Expand Down
10 changes: 8 additions & 2 deletions recipes/package.rb
@@ -1,5 +1,11 @@
if node['platform_version'].to_f < 6.0
centos_packages = %w{ php53 php53-devel php53-cli php-pear }
if node['php']['ius'] != false and platform?("redhat", "centos", "fedora", "amazon", "scientific")
include_recipe "yum::ius"
end

if node['php']['ius'] == "5.4"
centos_packages = %w{ php54 php54-devel php54-cli php54-pear }
elsif node['php']['ius'] == "5.3"
centos_packages = %w{ php53u php53u-devel php53u-cli php53u-pear }
else
centos_packages = %w{ php php-devel php-cli php-pear }
end
Expand Down
2 changes: 1 addition & 1 deletion recipes/xdebug.rb
Expand Up @@ -25,7 +25,7 @@
# end

if platform?(%w{debian ubuntu})
package "php5-xdebug"
package "php5-xdebug"
elsif platform?(%w{centos redhat fedora amazon scientific})
php_pear "xdebug" do
action :install
Expand Down