megalodon 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +4 -0
- data/README.md +80 -0
- data/bin/megalodon +68 -0
- data/config/rake.rb +60 -0
- data/config/run_list.json +5 -0
- data/config/run_vhosts.json +5 -0
- data/config/solo.rb +20 -0
- data/cookbooks/dnsmasq/recipies/default.rb +28 -0
- data/cookbooks/elasticsearch/recipies/default.rb +23 -0
- data/cookbooks/erlang/README.rdoc +8 -0
- data/cookbooks/erlang/metadata.rb +6 -0
- data/cookbooks/erlang/recipes/default.rb +8 -0
- data/cookbooks/git/README.rdoc +8 -0
- data/cookbooks/git/metadata.rb +6 -0
- data/cookbooks/git/recipes/default.rb +24 -0
- data/cookbooks/git/templates/default/dot.gitconfig.erb +47 -0
- data/cookbooks/homebrew/README.rdoc +73 -0
- data/cookbooks/homebrew/libraries/homebrew_package.rb +85 -0
- data/cookbooks/homebrew/metadata.json +33 -0
- data/cookbooks/homebrew/metadata.rb +9 -0
- data/cookbooks/homebrew/recipes/default.rb +11 -0
- data/cookbooks/jenkins/metadata.rb +9 -0
- data/cookbooks/jenkins/recipes/default.rb +21 -0
- data/cookbooks/maatkit/recipes/default.rb +10 -0
- data/cookbooks/megalodon/attributes/default.rb +3 -0
- data/cookbooks/megalodon/definitions/megalodon_app.rb +21 -0
- data/cookbooks/megalodon/recipes/apache_vhosts.rb +46 -0
- data/cookbooks/megalodon/recipes/default.rb +55 -0
- data/cookbooks/megalodon/recipes/misc.rb +14 -0
- data/cookbooks/megalodon/templates/default/default.conf.erb +26 -0
- data/cookbooks/megalodon/templates/default/default.json.erb +5 -0
- data/cookbooks/megalodon/templates/default/dot.profile.erb +22 -0
- data/cookbooks/megalodon/templates/default/php5.conf.erb +12 -0
- data/cookbooks/megalodon/templates/default/vhost.conf.erb +28 -0
- data/cookbooks/memcached/README.rdoc +8 -0
- data/cookbooks/memcached/metadata.rb +2 -0
- data/cookbooks/memcached/recipes/default.rb +9 -0
- data/cookbooks/mongodb/recipes/default.rb +23 -0
- data/cookbooks/mvim/README.rdoc +8 -0
- data/cookbooks/mvim/metadata.rb +6 -0
- data/cookbooks/mvim/recipes/default.rb +47 -0
- data/cookbooks/mvim/templates/default/dot.vimrc.erb +23 -0
- data/cookbooks/mysql/README.rdoc +143 -0
- data/cookbooks/mysql/attributes/server.rb +58 -0
- data/cookbooks/mysql/metadata.rb +78 -0
- data/cookbooks/mysql/recipes/default.rb +24 -0
- data/cookbooks/mysql/recipes/mariadb.rb +41 -0
- data/cookbooks/mysql/templates/default/my.cnf.erb +161 -0
- data/cookbooks/nginx/recipes/default.rb +66 -0
- data/cookbooks/nginx/templates/default/app_nginx.conf.erb +42 -0
- data/cookbooks/nginx/templates/default/default.conf.erb +40 -0
- data/cookbooks/nginx/templates/default/fastcgi_params.erb +23 -0
- data/cookbooks/nginx/templates/default/nginx.conf.erb +33 -0
- data/cookbooks/node/README.rdoc +8 -0
- data/cookbooks/node/metadata.rb +6 -0
- data/cookbooks/node/recipes/default.rb +12 -0
- data/cookbooks/php/attributes/default.rb +3 -0
- data/cookbooks/php/metadata.rb +2 -0
- data/cookbooks/php/providers/pear.rb +229 -0
- data/cookbooks/php/providers/pear_channel.rb +91 -0
- data/cookbooks/php/recipes/default.rb +25 -0
- data/cookbooks/php/recipes/fpm.rb +45 -0
- data/cookbooks/php/recipes/module_apc.rb +12 -0
- data/cookbooks/php/recipes/module_memcached.rb +12 -0
- data/cookbooks/php/recipes/module_mongo.rb +11 -0
- data/cookbooks/php/recipes/module_xdebug.rb +11 -0
- data/cookbooks/php/resources/pear.rb +28 -0
- data/cookbooks/php/resources/pear_channel.rb +28 -0
- data/cookbooks/php/templates/default/mods/apc.ini.erb +4 -0
- data/cookbooks/php/templates/default/mods/memcached.ini.erb +1 -0
- data/cookbooks/php/templates/default/mods/mongo.ini.erb +1 -0
- data/cookbooks/php/templates/default/mods/xdebug.ini.erb +39 -0
- data/cookbooks/php/templates/default/net.php.php-fpm.plist.erb +23 -0
- data/cookbooks/php/templates/default/php-fpm.conf.erb +323 -0
- data/cookbooks/php/templates/default/php.ini.erb +1854 -0
- data/cookbooks/php.tgz +0 -0
- data/cookbooks/phpunit/metadata.rb +8 -0
- data/cookbooks/phpunit/recipes/default.rb +38 -0
- data/cookbooks/python/README.rdoc +8 -0
- data/cookbooks/python/metadata.rb +6 -0
- data/cookbooks/python/recipes/default.rb +6 -0
- data/cookbooks/redis/recipes/default.rb +23 -0
- data/cookbooks/siege/recipes/default.rb +4 -0
- data/cookbooks/solr/metadata.json +36 -0
- data/cookbooks/solr/metadata.rb +9 -0
- data/cookbooks/solr/recipes/default.rb +18 -0
- data/cookbooks/varnish/attributes/default.rb +2 -0
- data/cookbooks/varnish/recipes/default.rb +24 -0
- data/cookbooks/varnish/templates/default/default.vcl.erb +268 -0
- data/cookbooks/varnish/templates/default/ubuntu-default.erb +103 -0
- data/cookbooks/xhprof/metadata.json +36 -0
- data/cookbooks/xhprof/metadata.rb +12 -0
- data/cookbooks/xhprof/recipes/default.rb +43 -0
- data/cookbooks/xhprof/templates/default/xhprof.ini.erb +2 -0
- data/formulas/apc.rb +63 -0
- data/formulas/cclient.rb +57 -0
- data/formulas/megalodon.rb +27 -0
- data/formulas/memcached-php.rb +24 -0
- data/formulas/mongo-php.rb +25 -0
- data/formulas/mongodb-php.rb +31 -0
- data/formulas/php-memcached.rb +31 -0
- data/formulas/php.rb +261 -0
- data/formulas/xdebug.rb +36 -0
- data/formulas/xhprof.rb +33 -0
- data/lib/megalodon/version.rb +3 -0
- data/megalodon.gemspec +14 -0
- data/roles/nginx_web_server.json +23 -0
- data/roles/web_server.json +19 -0
- metadata +170 -0
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Author:: Seth Chisamore <schisamo@opscode.com>
|
|
3
|
+
# Cookbook Name:: php
|
|
4
|
+
# Provider:: pear_package
|
|
5
|
+
#
|
|
6
|
+
# Copyright:: 2011, Opscode, Inc <legal@opscode.com>
|
|
7
|
+
#
|
|
8
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
# you may not use this file except in compliance with the License.
|
|
10
|
+
# You may obtain a copy of the License at
|
|
11
|
+
#
|
|
12
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
#
|
|
14
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
# See the License for the specific language governing permissions and
|
|
18
|
+
# limitations under the License.
|
|
19
|
+
#
|
|
20
|
+
|
|
21
|
+
require 'chef/mixin/shell_out'
|
|
22
|
+
require 'chef/mixin/language'
|
|
23
|
+
include Chef::Mixin::ShellOut
|
|
24
|
+
|
|
25
|
+
# the logic in all action methods mirror that of
|
|
26
|
+
# the Chef::Provider::Package which will make
|
|
27
|
+
# refactoring into core chef easy
|
|
28
|
+
|
|
29
|
+
action :install do
|
|
30
|
+
# If we specified a version, and it's not the current version, move to the specified version
|
|
31
|
+
if @new_resource.version != nil && @new_resource.version != @current_resource.version
|
|
32
|
+
install_version = @new_resource.version
|
|
33
|
+
# If it's not installed at all, install it
|
|
34
|
+
elsif @current_resource.version == nil
|
|
35
|
+
install_version = candidate_version
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
if install_version
|
|
39
|
+
Chef::Log.info("Installing #{@new_resource} version #{install_version}")
|
|
40
|
+
status = install_package(@new_resource.package_name, install_version)
|
|
41
|
+
if status
|
|
42
|
+
@new_resource.updated_by_last_action(true)
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
action :upgrade do
|
|
48
|
+
if @current_resource.version != candidate_version
|
|
49
|
+
orig_version = @current_resource.version || "uninstalled"
|
|
50
|
+
Chef::Log.info("Upgrading #{@new_resource} version from #{orig_version} to #{candidate_version}")
|
|
51
|
+
status = upgrade_package(@new_resource.package_name, candidate_version)
|
|
52
|
+
if status
|
|
53
|
+
@new_resource.updated_by_last_action(true)
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
action :remove do
|
|
59
|
+
if removing_package?
|
|
60
|
+
Chef::Log.info("Removing #{@new_resource}")
|
|
61
|
+
remove_package(@current_resource.package_name, @new_resource.version)
|
|
62
|
+
@new_resource.updated_by_last_action(true)
|
|
63
|
+
else
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
action :purge do
|
|
68
|
+
if removing_package?
|
|
69
|
+
Chef::Log.info("Purging #{@new_resource}")
|
|
70
|
+
purge_package(@current_resource.package_name, @new_resource.version)
|
|
71
|
+
@new_resource.updated_by_last_action(true)
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def removing_package?
|
|
76
|
+
if @current_resource.version.nil?
|
|
77
|
+
false # nothing to remove
|
|
78
|
+
elsif @new_resource.version.nil?
|
|
79
|
+
true # remove any version of a package
|
|
80
|
+
elsif @new_resource.version == @current_resource.version
|
|
81
|
+
true # remove the version we have
|
|
82
|
+
else
|
|
83
|
+
false # we don't have the version we want to remove
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
def expand_options(options)
|
|
88
|
+
options ? " #{options}" : ""
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# these methods are the required overrides of
|
|
92
|
+
# a provider that extends from Chef::Provider::Package
|
|
93
|
+
# so refactoring into core Chef should be easy
|
|
94
|
+
|
|
95
|
+
def load_current_resource
|
|
96
|
+
@current_resource = Chef::Resource::PhpPear.new(@new_resource.name)
|
|
97
|
+
@current_resource.package_name(@new_resource.package_name)
|
|
98
|
+
@bin = 'pear'
|
|
99
|
+
if pecl?
|
|
100
|
+
Chef::Log.debug("#{@new_resource} smells like a pecl...installing package in Pecl mode.")
|
|
101
|
+
@bin = 'pecl'
|
|
102
|
+
end
|
|
103
|
+
Chef::Log.debug("#{@current_resource}: Installed version: #{current_installed_version} Candidate version: #{candidate_version}")
|
|
104
|
+
|
|
105
|
+
unless current_installed_version.nil?
|
|
106
|
+
@current_resource.version(current_installed_version)
|
|
107
|
+
Chef::Log.debug("Current version is #{@current_resource.version}") if @current_resource.version
|
|
108
|
+
end
|
|
109
|
+
@current_resource
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
def current_installed_version
|
|
113
|
+
@current_installed_version ||= begin
|
|
114
|
+
v = nil
|
|
115
|
+
version_check_cmd = "#{@bin} -d preferred_state=#{can_haz(@new_resource, "preferred_state")} list#{expand_channel(can_haz(@new_resource, "channel"))}"
|
|
116
|
+
p = shell_out(version_check_cmd)
|
|
117
|
+
response = nil
|
|
118
|
+
if p.stdout =~ /\.?Installed packages/i
|
|
119
|
+
response = grep_for_version(p.stdout, @new_resource.package_name)
|
|
120
|
+
end
|
|
121
|
+
response
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
def candidate_version
|
|
126
|
+
@candidate_version ||= begin
|
|
127
|
+
candidate_version_cmd = "#{@bin} -d preferred_state=#{can_haz(@new_resource, "preferred_state")} search#{expand_channel(can_haz(@new_resource, "channel"))} #{@new_resource.package_name}"
|
|
128
|
+
p = shell_out(candidate_version_cmd)
|
|
129
|
+
response = nil
|
|
130
|
+
if p.stdout =~ /\.?Matched packages/i
|
|
131
|
+
response = grep_for_version(p.stdout, @new_resource.package_name)
|
|
132
|
+
end
|
|
133
|
+
response
|
|
134
|
+
end
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
def install_package(name, version)
|
|
138
|
+
pear_shell_out("echo -e \"\\r\" | #{@bin} -d preferred_state=#{can_haz(@new_resource, "preferred_state")} install -a#{expand_options(@new_resource.options)} #{prefix_channel(can_haz(@new_resource, "channel"))}#{name}-#{version}")
|
|
139
|
+
manage_pecl_ini(name, :create, can_haz(@new_resource, "directives")) if pecl?
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
def upgrade_package(name, version)
|
|
143
|
+
pear_shell_out("echo -e \"\\r\" | #{@bin} -d preferred_state=#{can_haz(@new_resource, "preferred_state")} upgrade -a#{expand_options(@new_resource.options)} #{prefix_channel(can_haz(@new_resource, "channel"))}#{name}-#{version}")
|
|
144
|
+
manage_pecl_ini(name, :create, can_haz(@new_resource, "directives")) if pecl?
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
def remove_package(name, version)
|
|
148
|
+
command = "#{@bin} uninstall #{expand_options(@new_resource.options)} #{prefix_channel(can_haz(@new_resource, "channel"))}#{name}"
|
|
149
|
+
command << "-#{version}" if version and !version.empty?
|
|
150
|
+
pear_shell_out(command)
|
|
151
|
+
manage_pecl_ini(name, :delete) if pecl?
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
def pear_shell_out(command)
|
|
155
|
+
p = shell_out!(command)
|
|
156
|
+
# pear/pecl commands return a 0 on failures...we'll grep for it
|
|
157
|
+
if p.stdout.split("\n").last =~ /^ERROR:.+/i
|
|
158
|
+
p.invalid!
|
|
159
|
+
end
|
|
160
|
+
p
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
def purge_package(name, version)
|
|
164
|
+
remove_package(name, version)
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
def expand_channel(channel)
|
|
168
|
+
channel ? " -c #{channel}" : ""
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
def prefix_channel(channel)
|
|
172
|
+
channel ? "#{channel}/" : ""
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
def manage_pecl_ini(name, action, directives)
|
|
176
|
+
template "#{node['php']['ext_conf_dir']}/#{name}.ini" do
|
|
177
|
+
source "extension.ini.erb"
|
|
178
|
+
cookbook "php"
|
|
179
|
+
owner "root"
|
|
180
|
+
group "root"
|
|
181
|
+
mode "0644"
|
|
182
|
+
variables(:name => name, :directives => directives)
|
|
183
|
+
action action
|
|
184
|
+
end
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
def grep_for_version(stdout, package)
|
|
188
|
+
v = nil
|
|
189
|
+
|
|
190
|
+
stdout.split(/\n/).grep(/^#{package}\s/i).each do |m|
|
|
191
|
+
# XML_RPC 1.5.4 stable
|
|
192
|
+
# mongo 1.1.4/(1.1.4 stable) 1.1.4 MongoDB database driver
|
|
193
|
+
# Horde_Url -n/a-/(1.0.0beta1 beta) Horde Url class
|
|
194
|
+
# Horde_Url 1.0.0beta1 (beta) 1.0.0beta1 Horde Url class
|
|
195
|
+
v = m.split(/\s+/)[1].strip
|
|
196
|
+
if v.split(/\//)[0] =~ /.\./
|
|
197
|
+
# 1.1.4/(1.1.4 stable)
|
|
198
|
+
v = v.split(/\//)[0]
|
|
199
|
+
else
|
|
200
|
+
# -n/a-/(1.0.0beta1 beta)
|
|
201
|
+
v = v.split(/(.*)\/\((.*)/).last.split(/\s/)[0]
|
|
202
|
+
end
|
|
203
|
+
end
|
|
204
|
+
v
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
def pecl?
|
|
208
|
+
@pecl ||= begin
|
|
209
|
+
# search as a pear first since most 3rd party channels will report pears as pecls!
|
|
210
|
+
search_cmd = "pear -d preferred_state=#{can_haz(@new_resource, "preferred_state")} search#{expand_channel(can_haz(@new_resource, "channel"))} #{@new_resource.package_name}"
|
|
211
|
+
if shell_out(search_cmd).stdout =~ /\.?Matched packages/i
|
|
212
|
+
false
|
|
213
|
+
else
|
|
214
|
+
# fall back and search as a pecl
|
|
215
|
+
search_cmd = "pecl -d preferred_state=#{can_haz(@new_resource, "preferred_state")} search#{expand_channel(can_haz(@new_resource, "channel"))} #{@new_resource.package_name}"
|
|
216
|
+
if shell_out(search_cmd).stdout =~ /\.?Matched packages/i
|
|
217
|
+
true
|
|
218
|
+
else
|
|
219
|
+
false
|
|
220
|
+
end
|
|
221
|
+
end
|
|
222
|
+
end
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
# TODO remove when provider is moved into Chef core
|
|
226
|
+
# this allows PhpPear to work with Chef::Resource::Package
|
|
227
|
+
def can_haz(resource, attribute_name)
|
|
228
|
+
resource.respond_to?(attribute_name) ? resource.send(attribute_name) : nil
|
|
229
|
+
end
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Author:: Seth Chisamore <schisamo@opscode.com>
|
|
3
|
+
# Cookbook Name:: php
|
|
4
|
+
# Provider:: pear_channel
|
|
5
|
+
#
|
|
6
|
+
# Copyright:: 2011, Opscode, Inc <legal@opscode.com>
|
|
7
|
+
#
|
|
8
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
# you may not use this file except in compliance with the License.
|
|
10
|
+
# You may obtain a copy of the License at
|
|
11
|
+
#
|
|
12
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
#
|
|
14
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
# See the License for the specific language governing permissions and
|
|
18
|
+
# limitations under the License.
|
|
19
|
+
#
|
|
20
|
+
|
|
21
|
+
# http://pear.php.net/manual/en/guide.users.commandline.channels.php
|
|
22
|
+
|
|
23
|
+
require 'chef/mixin/shell_out'
|
|
24
|
+
require 'chef/mixin/language'
|
|
25
|
+
include Chef::Mixin::ShellOut
|
|
26
|
+
|
|
27
|
+
action :discover do
|
|
28
|
+
unless exists?
|
|
29
|
+
Chef::Log.info("Discovering pear channel #{@new_resource}")
|
|
30
|
+
execute "pear channel-discover #{@new_resource.channel_name}" do
|
|
31
|
+
action :run
|
|
32
|
+
end
|
|
33
|
+
new_resource.updated_by_last_action(true)
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
action :add do
|
|
38
|
+
unless exists?
|
|
39
|
+
Chef::Log.info("Adding pear channel #{@new_resource} from #{@new_resource.channel_xml}")
|
|
40
|
+
execute "pear channel-add #{@new_resource.channel_xml}" do
|
|
41
|
+
action :run
|
|
42
|
+
end
|
|
43
|
+
new_resource.updated_by_last_action(true)
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
action :update do
|
|
48
|
+
if exists?
|
|
49
|
+
update_needed = false
|
|
50
|
+
begin
|
|
51
|
+
updated_needed = true if shell_out("pear search -c #{@new_resource.channel_name}").stdout =~ /channel-update/
|
|
52
|
+
rescue Chef::Exceptions::CommandTimeout
|
|
53
|
+
# CentOS can hang on 'pear search' if a channel needs updating
|
|
54
|
+
Chef::Log.info("Timed out checking if channel-update needed...forcing update of pear channel #{@new_resource}")
|
|
55
|
+
update_needed = true
|
|
56
|
+
end
|
|
57
|
+
if update_needed
|
|
58
|
+
Chef::Log.info("Updating pear channel #{@new_resource}")
|
|
59
|
+
shell_out!("pear channel-update #{@new_resource.channel_name}")
|
|
60
|
+
new_resource.updated_by_last_action(true)
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
action :remove do
|
|
66
|
+
if exists?
|
|
67
|
+
Chef::Log.info("Deleting pear channel #{@new_resource}")
|
|
68
|
+
execute "pear channel-delete #{@new_resource.channel_name}" do
|
|
69
|
+
action :run
|
|
70
|
+
end
|
|
71
|
+
new_resource.updated_by_last_action(true)
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def load_current_resource
|
|
76
|
+
@current_resource = Chef::Resource::PhpPearChannel.new(@new_resource.name)
|
|
77
|
+
@current_resource.channel_name(@new_resource.channel_name)
|
|
78
|
+
@current_resource
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
private
|
|
82
|
+
def exists?
|
|
83
|
+
begin
|
|
84
|
+
shell_out!("pear channel-info #{@current_resource.channel_name}")
|
|
85
|
+
true
|
|
86
|
+
rescue Chef::Exceptions::ShellCommandFailed
|
|
87
|
+
false
|
|
88
|
+
rescue Mixlib::ShellOut::ShellCommandFailed
|
|
89
|
+
false
|
|
90
|
+
end
|
|
91
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Cookbook Name:: php
|
|
3
|
+
# Recipe:: default
|
|
4
|
+
#
|
|
5
|
+
#
|
|
6
|
+
|
|
7
|
+
package "php" do
|
|
8
|
+
action :install
|
|
9
|
+
options "--with-mysql --with-imap --with-apache --with-cgi"
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
bash "Fix the default PEAR permissions and config" do
|
|
13
|
+
code <<-EOS
|
|
14
|
+
chmod -R ug+w $(brew --prefix php)/lib/php
|
|
15
|
+
pear config-set php_ini $(brew --prefix php)/etc/php5/php.ini
|
|
16
|
+
pecl config-set php_suffix /$(brew --prefix php| awk -F'/' '{print $6}')/bin/php
|
|
17
|
+
EOS
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
FileUtils.mkdir_p(node[:php][:scan_dir]) unless File.exists?(node[:php][:scan_dir])
|
|
21
|
+
|
|
22
|
+
template "#{node['php']['conf_dir']}/php.ini" do
|
|
23
|
+
source "php.ini.erb"
|
|
24
|
+
mode "0644"
|
|
25
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Cookbook Name:: php
|
|
3
|
+
# Recipe:: default
|
|
4
|
+
#
|
|
5
|
+
#
|
|
6
|
+
|
|
7
|
+
package "php" do
|
|
8
|
+
action :install
|
|
9
|
+
options "--with-mysql --with-pgsql --with-mssql --with-imap --with-fpm --with-cgi"
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
bash "Fix the default PEAR permissions and config" do
|
|
13
|
+
code <<-EOS
|
|
14
|
+
chmod -R ug+w $(brew --prefix php)/lib/php
|
|
15
|
+
pear config-set php_ini $(brew --prefix)/etc/php5/php.ini
|
|
16
|
+
EOS
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
directory node['php']['scan_dir'] do
|
|
20
|
+
action :create
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
directory "#{node['php']['conf_dir']}/fpm" do
|
|
24
|
+
action :create
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
directory "/usr/local/var/php5/run" do
|
|
28
|
+
action :create
|
|
29
|
+
recursive true
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
template "#{node['php']['conf_dir']}/php.ini" do
|
|
33
|
+
source "php.ini.erb"
|
|
34
|
+
mode "0644"
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
template "#{node['php']['conf_dir']}/fpm/php-fpm.conf" do
|
|
38
|
+
source "php-fpm.conf.erb"
|
|
39
|
+
mode "0644"
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
template "#{ENV['HOME']}/Library/LaunchAgents/net.php.php-fpm.plist" do
|
|
43
|
+
source "net.php.php-fpm.plist.erb"
|
|
44
|
+
end
|
|
45
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Author:: Seth Chisamore <schisamo@opscode.com>
|
|
3
|
+
# Cookbook Name:: php
|
|
4
|
+
# Resource:: pear_package
|
|
5
|
+
#
|
|
6
|
+
# Copyright:: 2011, Opscode, Inc <legal@opscode.com>
|
|
7
|
+
#
|
|
8
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
# you may not use this file except in compliance with the License.
|
|
10
|
+
# You may obtain a copy of the License at
|
|
11
|
+
#
|
|
12
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
#
|
|
14
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
# See the License for the specific language governing permissions and
|
|
18
|
+
# limitations under the License.
|
|
19
|
+
#
|
|
20
|
+
|
|
21
|
+
actions :install, :upgrade, :remove, :purge
|
|
22
|
+
|
|
23
|
+
attribute :package_name, :kind_of => String, :name_attribute => true
|
|
24
|
+
attribute :version, :default => nil
|
|
25
|
+
attribute :channel, :kind_of => String
|
|
26
|
+
attribute :options, :kind_of => String
|
|
27
|
+
attribute :directives, :kind_of => Hash, :default => {}
|
|
28
|
+
attribute :preferred_state, :default => 'stable'
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Author:: Seth Chisamore <schisamo@opscode.com>
|
|
3
|
+
# Cookbook Name:: php
|
|
4
|
+
# Resource:: pear_channel
|
|
5
|
+
#
|
|
6
|
+
# Copyright:: 2011, Opscode, Inc <legal@opscode.com>
|
|
7
|
+
#
|
|
8
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
# you may not use this file except in compliance with the License.
|
|
10
|
+
# You may obtain a copy of the License at
|
|
11
|
+
#
|
|
12
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
#
|
|
14
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
# See the License for the specific language governing permissions and
|
|
18
|
+
# limitations under the License.
|
|
19
|
+
#
|
|
20
|
+
|
|
21
|
+
actions :discover, :add, :update, :remove
|
|
22
|
+
|
|
23
|
+
attribute :channel_name, :kind_of => String, :name_attribute => true
|
|
24
|
+
attribute :channel_xml, :kind_of => String
|
|
25
|
+
|
|
26
|
+
# TODO add authenticated channel support!
|
|
27
|
+
# attribute :username, :kind_of => String
|
|
28
|
+
# attribute :password, :kind_of => String
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
extension=memcached.so
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
extension=mongo.so
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so
|
|
2
|
+
|
|
3
|
+
; General config
|
|
4
|
+
;Dumps local variables on exception
|
|
5
|
+
xdebug.show_local_vars=On
|
|
6
|
+
;Dump server variables
|
|
7
|
+
;xdebug.dump.SERVER=*
|
|
8
|
+
;Dump global variables
|
|
9
|
+
;xdebug.dump_globals=On
|
|
10
|
+
;xdebug.collect_params=4;
|
|
11
|
+
|
|
12
|
+
; Tracing
|
|
13
|
+
;xdebug.auto_trace=On
|
|
14
|
+
;xdebug.trace_output_dir= /opt/local/php_traces/
|
|
15
|
+
xdebug.trace_output_dir=/tmp
|
|
16
|
+
xdebug.show_mem_delta=On
|
|
17
|
+
xdebug.collect_return=On
|
|
18
|
+
|
|
19
|
+
; Profiler
|
|
20
|
+
;xdebug.profiler_enable=1
|
|
21
|
+
xdebug.profiler_enable_trigger = on
|
|
22
|
+
;xdebug.profiler_output_dir=/opt/local/php_traces
|
|
23
|
+
xdebug.profiler_output_dir=/tmp
|
|
24
|
+
|
|
25
|
+
; Set the filenames generated by xdebug to use REQUEST_URI instead of the apache process number
|
|
26
|
+
; so all requests to the same page end up in the same file.
|
|
27
|
+
xdebug.profiler_output_name = cachegrind.out.%R
|
|
28
|
+
; Settle for this since Macport's php 5.2 version has a bug that prevents %R from working.
|
|
29
|
+
xdebug.profiler_output_name = cachegrind.out.%s_%t
|
|
30
|
+
|
|
31
|
+
; Set xdebug to append data to files instead of overwriting, this means you can view aggregate
|
|
32
|
+
; function calls over multiple requests.
|
|
33
|
+
xdebug.profiler_append = TRUE
|
|
34
|
+
|
|
35
|
+
; Debugging. You might need to specify your host with some additional options
|
|
36
|
+
xdebug.remote_enable=1
|
|
37
|
+
xdebug.remote_autostart = 1
|
|
38
|
+
xdebug.remote_host=127.0.0.1
|
|
39
|
+
xdebug.remote_port=9000
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>KeepAlive</key>
|
|
6
|
+
<true/>
|
|
7
|
+
<key>Label</key>
|
|
8
|
+
<string>net.php.php-fpm</string>
|
|
9
|
+
<key>LaunchOnlyOnce</key>
|
|
10
|
+
<true/>
|
|
11
|
+
<key>ProgramArguments</key>
|
|
12
|
+
<array>
|
|
13
|
+
<string>/usr/local/sbin/php-fpm</string>
|
|
14
|
+
<string>-y /usr/local/etc/php5/fpm/php-fpm.conf</string>
|
|
15
|
+
</array>
|
|
16
|
+
<key>RunAtLoad</key>
|
|
17
|
+
<true/>
|
|
18
|
+
<key>ServiceDescription</key>
|
|
19
|
+
<string>PHP FastCGI Process Manager</string>
|
|
20
|
+
<key>StandardErrorPath</key>
|
|
21
|
+
<string>/usr/local/var/log/php.log</string>
|
|
22
|
+
</dict>
|
|
23
|
+
</plist>
|