Skip to content
This repository
Browse code

Add new predis recipe

Download source and make install the php redis extension.
  • Loading branch information...
commit 0da7c9f688c4156e5a881666285108f657f7a631 1 parent 023350a
Alistair Stead alistairstead authored

Showing 3 changed files with 66 additions and 0 deletions. Show diff stats Hide diff stats

  1. +7 0 README.md
  2. +2 0  metadata.rb
  3. +57 0 recipes/predis.rb
7 README.md
Source Rendered
@@ -19,6 +19,9 @@ Chef 0.10.12 or higher required (for Chef environment use).
19 19
20 20 The following Opscode cookbooks are dependencies:
21 21
  22 +* git
  23 +* yum
  24 +* apt
22 25 * php
23 26
24 27 # Attributes
@@ -118,6 +121,10 @@ Installs phploc so that you can gather statistics about your PHP code.
118 121
119 122 Installs PHPUnit and dependencies for unit testing your PHP code.
120 123
  124 +## predis
  125 +
  126 +Installs the php redis extension configure and make install from source after a checkout from GitHub from the master branch
  127 +
121 128 ## vfsStream
122 129
123 130 Installs vfsStream which allows you to create mock file system resources for unit testing.
2  metadata.rb
@@ -5,7 +5,9 @@
5 5 long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
6 6 version "0.0.2"
7 7
  8 +depends "git"
8 9 depends "yum"
  10 +depends "apt"
9 11 depends "php"
10 12 depends "chef-php-extra"
11 13
57 recipes/predis.rb
... ... @@ -0,0 +1,57 @@
  1 +#
  2 +# Cookbook Name:: chef-php-extra
  3 +# Recipe:: predis
  4 +#
  5 +# Copyright 2012, Alistair Stead
  6 +#
  7 +# Licensed under the Apache License, Version 2.0 (the "License");
  8 +# you may not use this file except in compliance with the License.
  9 +# You may obtain a copy of the License at
  10 +#
  11 +# http://www.apache.org/licenses/LICENSE-2.0
  12 +#
  13 +# Unless required by applicable law or agreed to in writing, software
  14 +# distributed under the License is distributed on an "AS IS" BASIS,
  15 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16 +# See the License for the specific language governing permissions and
  17 +# limitations under the License.
  18 +#
  19 +
  20 +include_recipe "git"
  21 +
  22 +directory "/tmp/phpredis" do
  23 + owner "vagrant"
  24 + group "vagrant"
  25 + mode "0755"
  26 + action :create
  27 +end
  28 +
  29 +
  30 +git "/tmp/phpredis" do
  31 + repository "git://github.com/nicolasff/phpredis.git"
  32 + revision "master"
  33 + action :sync
  34 + not_if "php -m | grep redis"
  35 +end
  36 +
  37 +bash "make & install phpredis" do
  38 + cwd "/tmp/phpredis"
  39 + code <<-EOF
  40 + phpize
  41 + ./configure
  42 + make && make install
  43 + EOF
  44 + not_if "php -m | grep redis"
  45 +end
  46 +
  47 +template "#{node['php']['ext_conf_dir']}/redis.ini" do
  48 + source "extension.ini.erb"
  49 + cookbook "chef-php-extra"
  50 + owner "root"
  51 + group "root"
  52 + mode "0644"
  53 + variables(:name => "redis", :directives => [])
  54 + not_if "php -m | grep redis"
  55 +end
  56 +
  57 +

0 comments on commit 0da7c9f

Please sign in to comment.
Something went wrong with that request. Please try again.