Permalink
Browse files

Import php version 1.0.2

  • Loading branch information...
1 parent 235f914 commit 3887996f0af8666e6ab03a2ad3b0195148288f87 Jenkins CI committed May 8, 2012
@@ -0,0 +1,253 @@
+Description
+===========
+
+Installs and configures PHP 5.3 and the PEAR package management system. Also includes LWRPs for managing PEAR (and PECL) packages along with PECL channels.
+
+---
+Requirements
+============
+
+Platform
+--------
+
+* Debian, Ubuntu
+* CentOS, Red Hat, Fedora
+
+Cookbooks
+---------
+
+* build-essential
+* xml
+* mysql
+
+These cookbooks are only used when building PHP from source.
+
+---
+Attributes
+==========
+
+* `node["php"]["install_method"]` = method to install php with, default `package`.
+
+The file also contains the following attribute types:
+
+* platform specific locations and settings.
+* source installation settings
+
+---
+Resource/Provider
+=================
+
+This cookbook includes LWRPs for managing:
+
+* PEAR channels
+* PEAR/PECL packages
+
+`php_pear_channel`
+------------------
+
+[PEAR Channels](http://pear.php.net/manual/en/guide.users.commandline.channels.php) are alternative sources for PEAR packages. This LWRP provides and easy way to manage these channels.
+
+# Actions
+
+- :discover: Initialize a channel from its server.
+- :add: Add a channel to the channel list, usually only used to add private channels. Public channels are usually added using the `:discover` action
+- :update: Update an existing channel
+- :remove: Remove a channel from the List
+
+# Attribute Parameters
+
+- channel_name: name attribute. The name of the channel to discover
+- channel_xml: the channel.xml file of the channel you are adding
+
+# Example
+
+ # discover the horde channel
+ php_pear_channel "pear.horde.org" do
+ action :discover
+ end
+
+ # download xml then add the symfony channel
+ remote_file "#{Chef::Config[:file_cache_path]}/symfony-channel.xml" do
+ source "http://pear.symfony-project.com/channel.xml"
+ mode 0644
+ end
+ php_pear_channel "symfony" do
+ channel_xml "#{Chef::Config[:file_cache_path]}/symfony-channel.xml"
+ action :add
+ end
+
+ # update the main pear channel
+ php_pear_channel 'pear.php.net' do
+ action :update
+ end
+
+ # update the main pecl channel
+ php_pear_channel 'pecl.php.net' do
+ action :update
+ end
+
+
+`php_pear`
+----------
+
+[PEAR](http://pear.php.net/) is a framework and distribution system for reusable PHP components. [PECL](http://pecl.php.net/) is a repository for PHP Extensions. PECL contains C extensions for compiling into PHP. As C programs, PECL extensions run more efficiently than PEAR packages. PEARs and PECLs use the same packaging and distribution system. As such this LWRP is clever enough to abstract away the small differences and can be used for managing either. This LWRP also creates the proper module .ini file for each PECL extension at the correct location for each supported platform.
+
+# Actions
+
+- :install: Install a pear package - if version is provided, install that specific version
+- :upgrade: Upgrade a pear package - if version is provided, upgrade to that specific version
+- :remove: Remove a pear package
+- :purge: Purge a pear package (this usually entails removing configuration files as well as the package itself). With pear packages this behaves the same as `:remove`
+
+# Attribute Parameters
+
+- package_name: name attribute. The name of the pear package to install
+- version: the version of the pear package to install/upgrade. If no version is given latest is assumed.
+- preferred_state: PEAR by default installs stable packages only, this allows you to install pear packages in a devel, alpha or beta state
+- directives: extra extension directives (settings) for a pecl. on most platforms these usually get rendered into the extension's .ini file
+- options: Add additional options to the underlying pear package command
+
+
+# Example
+
+ # upgrade a pear
+ php_pear "XML_RPC" do
+ action :upgrade
+ end
+
+
+ # install a specific version
+ php_pear "XML_RPC" do
+ version "1.5.4"
+ action :install
+ end
+
+
+ # install the mongodb pecl
+ php_pear "mongo" do
+ action :install
+ end
+
+
+ # install apc pecl with directives
+ php_pear "apc" do
+ action :install
+ directives(:shm_size => 128, :enable_cli => 1)
+ end
+
+
+ # install the beta version of Horde_Url
+ # from the horde channel
+ hc = php_pear_channel "pear.horde.org" do
+ action :discover
+ end
+ php_pear "Horde_Url" do
+ preferred_state "beta"
+ channel hc.channel_name
+ action :install
+ end
+
+
+ # install the YAML pear from the symfony project
+ sc = php_pear_channel "pear.symfony-project.com" do
+ action :discover
+ end
+ php_pear "YAML" do
+ channel sc.channel_name
+ action :install
+ end
+
+---
+Recipes
+=======
+
+default
+-------
+
+Include the default recipe in a run list, to get `php`. By default `php` is installed from packages but this can be changed by using the `install_method` attribute.
+
+package
+-------
+
+This recipe installs PHP from packages.
+
+source
+------
+
+This recipe installs PHP from source.
+
+---
+Deprecated Recipes
+==================
+
+The following recipes are deprecated and will be removed from a future version of this cookbook.
+
+* `module_apc`
+* `module_curl`
+* `module_fileinfo`
+* `module_fpdf`
+* `module_gd`
+* `module_ldap`
+* `module_memcache`
+* `module_mysql`
+* `module_pgsql`
+* `module_sqlite3`
+
+The installation of the php modules in these recipes can now be accomplished by installing from a native package or via the new php_pear LWRP. For example, the functionality of the `module_memcache` recipe can be enabled in the following ways:
+
+ # using apt
+ package "php5-memcache" do
+ action :install
+ end
+
+ # using pear LWRP
+ php_pear "memcache" do
+ action :install
+ end
+
+---
+Usage
+=====
+
+Simply include the `php` recipe where ever you would like php installed. To install from source override the `node['php']['install_method']` attribute with in a role:
+
+ name "php"
+ description "Install php from source"
+ override_attributes(
+ "php" => {
+ "install_method" => "source"
+ }
+ )
+ run_list(
+ "recipe[php]"
+ )
+
+Changes
+=======
+
+## v1.0.2:
+
+* [COOK-993] Add mhash-devel to centos php source libs
+* [COOK-989] - bump version of php to 5.3.10
+* Also download the .tar.gz instead of .tar.bz2 as bzip2 may not be in
+ the base OS (e.g., CentOS 6 minimal)
+
+License and Author
+==================
+
+Author:: Seth Chisamore (<schisamo@opscode.com>)
+Author:: Joshua Timberman (<joshua@opscode.com>)
+
+Copyright:: 2011, Opscode, Inc
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
@@ -0,0 +1,85 @@
+#
+# Author:: Seth Chisamore (<schisamo@opscode.com>)
+# Cookbook Name:: php
+# Attribute:: default
+#
+# Copyright 2011, Opscode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+lib_dir = kernel['machine'] =~ /x86_64/ ? 'lib64' : 'lib'
+
+default['php']['install_method'] = 'package'
+
+case node["platform"]
+when "centos", "redhat", "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"
+ default['php']['conf_dir'] = '/etc/php5/cli'
+ default['php']['ext_conf_dir'] = '/etc/php5/conf.d'
+ default['php']['fpm_user'] = 'www-data'
+ default['php']['fpm_group'] = 'www-data'
+else
+ default['php']['conf_dir'] = '/etc/php5/cli'
+ default['php']['ext_conf_dir'] = '/etc/php5/conf.d'
+ default['php']['fpm_user'] = 'www-data'
+ default['php']['fpm_group'] = 'www-data'
+end
+
+default['php']['url'] = 'http://us.php.net/distributions'
+default['php']['version'] = '5.3.10'
+default['php']['checksum'] = 'ee26ff003eaeaefb649735980d9ef1ffad3ea8c2836e6ad520de598da225eaab'
+default['php']['prefix_dir'] = '/usr/local'
+
+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']}
+ --with-pear
+ --enable-fpm
+ --with-fpm-user=#{php['fpm_user']}
+ --with-fpm-group=#{php['fpm_group']}
+ --with-zlib
+ --with-openssl
+ --with-kerberos
+ --with-bz2
+ --with-curl
+ --enable-ftp
+ --enable-zip
+ --enable-exif
+ --with-gd
+ --enable-gd-native-ttf
+ --with-gettext
+ --with-gmp
+ --with-mhash
+ --with-iconv
+ --with-imap
+ --with-imap-ssl
+ --enable-sockets
+ --enable-soap
+ --with-xmlrpc
+ --with-libevent-dir
+ --with-mcrypt
+ --enable-mbstring
+ --with-t1lib
+ --with-mysql
+ --with-mysqli=/usr/bin/mysql_config
+ --with-mysql-sock
+ --with-sqlite3
+ --with-pdo-mysql
+ --with-pdo-sqlite}
@@ -0,0 +1,50 @@
+{
+ "name": "php",
+ "description": "Installs and maintains php and php modules",
+ "long_description": "",
+ "maintainer": "Opscode, Inc.",
+ "maintainer_email": "cookbooks@opscode.com",
+ "license": "Apache 2.0",
+ "platforms": {
+ "debian": ">= 0.0.0",
+ "ubuntu": ">= 0.0.0",
+ "centos": ">= 0.0.0",
+ "redhat": ">= 0.0.0",
+ "fedora": ">= 0.0.0"
+ },
+ "dependencies": {
+ "build-essential": ">= 0.0.0",
+ "xml": ">= 0.0.0",
+ "mysql": ">= 0.0.0"
+ },
+ "recommendations": {
+ },
+ "suggestions": {
+ },
+ "conflicting": {
+ },
+ "providing": {
+ },
+ "replacing": {
+ },
+ "attributes": {
+ },
+ "groupings": {
+ },
+ "recipes": {
+ "php": "Installs php",
+ "php::package": "Installs php using packages.",
+ "php::source": "Installs php from source.",
+ "php::module_apc": "Install the php5-apc package",
+ "php::module_curl": "Install the php5-curl package",
+ "php::module_fileinfo": "Install the php5-fileinfo package",
+ "php::module_fpdf": "Install the php-fpdf package",
+ "php::module_gd": "Install the php5-gd package",
+ "php::module_ldap": "Install the php5-ldap package",
+ "php::module_memcache": "Install the php5-memcache package",
+ "php::module_mysql": "Install the php5-mysql package",
+ "php::module_pgsql": "Install the php5-pgsql packag",
+ "php::module_sqlite3": "Install the php5-sqlite3 package"
+ },
+ "version": "1.0.2"
+}
Oops, something went wrong.

0 comments on commit 3887996

Please sign in to comment.