Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add new predis recipe

Download source and make install the php redis extension.
  • Loading branch information...
commit 0da7c9f688c4156e5a881666285108f657f7a631 1 parent 023350a
@alistairstead alistairstead authored
Showing with 66 additions and 0 deletions.
  1. +7 −0 README.md
  2. +2 −0  metadata.rb
  3. +57 −0 recipes/predis.rb
View
7 README.md
@@ -19,6 +19,9 @@ Chef 0.10.12 or higher required (for Chef environment use).
The following Opscode cookbooks are dependencies:
+* git
+* yum
+* apt
* php
# Attributes
@@ -118,6 +121,10 @@ Installs phploc so that you can gather statistics about your PHP code.
Installs PHPUnit and dependencies for unit testing your PHP code.
+## predis
+
+Installs the php redis extension configure and make install from source after a checkout from GitHub from the master branch
+
## vfsStream
Installs vfsStream which allows you to create mock file system resources for unit testing.
View
2  metadata.rb
@@ -5,7 +5,9 @@
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.0.2"
+depends "git"
depends "yum"
+depends "apt"
depends "php"
depends "chef-php-extra"
View
57 recipes/predis.rb
@@ -0,0 +1,57 @@
+#
+# Cookbook Name:: chef-php-extra
+# Recipe:: predis
+#
+# Copyright 2012, Alistair Stead
+#
+# 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.
+#
+
+include_recipe "git"
+
+directory "/tmp/phpredis" do
+ owner "vagrant"
+ group "vagrant"
+ mode "0755"
+ action :create
+end
+
+
+git "/tmp/phpredis" do
+ repository "git://github.com/nicolasff/phpredis.git"
+ revision "master"
+ action :sync
+ not_if "php -m | grep redis"
+end
+
+bash "make & install phpredis" do
+ cwd "/tmp/phpredis"
+ code <<-EOF
+ phpize
+ ./configure
+ make && make install
+ EOF
+ not_if "php -m | grep redis"
+end
+
+template "#{node['php']['ext_conf_dir']}/redis.ini" do
+ source "extension.ini.erb"
+ cookbook "chef-php-extra"
+ owner "root"
+ group "root"
+ mode "0644"
+ variables(:name => "redis", :directives => [])
+ not_if "php -m | grep redis"
+end
+
+
Please sign in to comment.
Something went wrong with that request. Please try again.