Skip to content
This repository was archived by the owner on Dec 2, 2020. It is now read-only.

Commit cc5a2fe

Browse files
committed
Merge pull request #61 from boxen/v2
V2
2 parents 6639ee1 + f779b85 commit cc5a2fe

File tree

367 files changed

+632
-2973
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

367 files changed

+632
-2973
lines changed

CHANGELOG.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,70 @@
1+
## 2.0.0 ##
2+
3+
* Use Hiera for configs
4+
* Allow configure params on PHP builds
5+
* Add PThreads extension
6+
* Update cardboard to 2.1.0 and update tests
7+
* Add support for PHP 5.6+
8+
* Add insecure PHP version warnings
9+
* Make Composer version configurable
10+
* Remove version specific PHP classes allowing arbitrary PHP versions
11+
12+
## 1.2.6 ##
13+
14+
* Fix autoconf 2.13 sandboxing
15+
16+
## 1.2.5 ##
17+
18+
* Sandbox autoconf213 to fix some installation conflicts
19+
* Set the PECL provider to default on darwin for PHP extensions (this can be overridden)
20+
* Increase `pm.max_children` to 10 for PHP-FPM pools (@gblair)
21+
22+
## 1.2.4 ##
23+
24+
* Fixes compilation of PHP versions > 5.4.17 due to a break in Bison compatibility (@webflo!)
25+
26+
## 1.2.3 ##
27+
28+
* Add xhprof extension (@webflo)
29+
* Add latest versions of PHP 5.4 and 5.5 (@webflo)
30+
31+
## 1.2.2 ##
32+
33+
* Change default .ini settings to increase timeouts, memory limits etc.
34+
35+
## 1.2.1 ##
36+
37+
* Bump Composer to latest 1.0.0-alpha8 (@webbj74)
38+
39+
## 1.2.0 ##
40+
41+
* Adds PHP 5.5 support! This requires a later version of Bison to compile, which is installed as a sandboxed package.
42+
* Adds additional minor versions of PHP for 5.3 and 5.4
43+
* Use ensure_packages from the stdlib to improve module compatibility (thanks @jameydeorio)
44+
* Fixes specs, and added Github API token to travis so builds actually work again
45+
46+
## 1.1.5 ##
47+
48+
* Add OAuth extension (@dbtlr)
49+
* Fix HTTP extension bug including zookeeper (@dbtlr)
50+
* Add Mongo extension (@eebs)
51+
* Fix compilation bug caused by Freetype and GD incompatibilities (@eebs!)
52+
53+
## 1.1.4 ##
54+
55+
* Add memcache PHP extension (@poppen)
56+
* Add pdo_pgsql PHP extension (@poppen)
57+
58+
## 1.1.3 ##
59+
60+
* Added support for Composer see the readme for usage.
61+
* Module now has test specs (hooray!), please run script/cibuild before making a pull request.
62+
* Fixes to bugs the specs caught
63+
64+
## 1.1.2 ##
65+
66+
* Increase xdebug `max_nesting_level`
67+
168
## 1.1.1 ##
269

370
* Remove `libpng` package, add dependency on `libpng` module

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
source "https://rubygems.org"
22

3-
gem "cardboard", "~> 1.0"
3+
gem "cardboard", "~> 2.1"

Gemfile.lock

Lines changed: 58 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,80 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
addressable (2.3.5)
4+
CFPropertyList (2.2.8)
5+
addressable (2.3.6)
56
ansi (1.4.3)
6-
boxen (1.5.2)
7+
boxen (2.7.0)
78
ansi (~> 1.4)
89
hiera (~> 1.0)
910
highline (~> 1.6)
1011
json_pure (>= 1.7.7, < 2.0)
11-
librarian-puppet (~> 0.9.9)
12-
octokit (~> 1.15)
13-
puppet (~> 3.0)
14-
cardboard (1.0.4)
15-
boxen (~> 1.0)
12+
librarian-puppet (~> 1.0.0)
13+
octokit (~> 2.7, >= 2.7.1)
14+
puppet (~> 3.7)
15+
cardboard (2.1.0)
16+
boxen (~> 2.1)
1617
puppet-lint (~> 0.3)
1718
puppetlabs_spec_helper (~> 0.4)
18-
rspec-puppet (~> 0.1)
19-
diff-lcs (1.2.4)
20-
facter (1.7.2)
21-
faraday (0.8.8)
22-
multipart-post (~> 1.2.0)
23-
faraday_middleware (0.9.0)
24-
faraday (>= 0.7.4, < 0.9)
25-
hashie (2.0.5)
26-
hiera (1.2.1)
19+
rspec-puppet (~> 1.0)
20+
diff-lcs (1.2.5)
21+
facter (2.3.0)
22+
CFPropertyList (~> 2.2.6)
23+
faraday (0.9.0)
24+
multipart-post (>= 1.2, < 3)
25+
hiera (1.3.4)
2726
json_pure
28-
highline (1.6.19)
29-
json (1.8.0)
30-
json_pure (1.8.0)
31-
librarian-puppet (0.9.10)
32-
json
27+
highline (1.6.21)
28+
json (1.8.1)
29+
json_pure (1.8.1)
30+
librarian (0.1.2)
31+
highline
3332
thor (~> 0.15)
34-
metaclass (0.0.1)
35-
mocha (0.14.0)
33+
librarian-puppet (1.0.9)
34+
json
35+
librarian (>= 0.1.2)
36+
metaclass (0.0.4)
37+
mocha (1.1.0)
3638
metaclass (~> 0.0.1)
37-
multi_json (1.7.9)
38-
multipart-post (1.2.0)
39-
netrc (0.7.7)
40-
octokit (1.25.0)
41-
addressable (~> 2.2)
42-
faraday (~> 0.8)
43-
faraday_middleware (~> 0.9)
44-
hashie (~> 2.0)
45-
multi_json (~> 1.3)
46-
netrc (~> 0.7.7)
47-
puppet (3.2.4)
48-
facter (~> 1.6)
39+
multipart-post (2.0.0)
40+
octokit (2.7.2)
41+
sawyer (~> 0.5.2)
42+
puppet (3.7.3)
43+
facter (> 1.6, < 3)
4944
hiera (~> 1.0)
50-
rgen (~> 0.6.5)
45+
json_pure
5146
puppet-lint (0.3.2)
52-
puppetlabs_spec_helper (0.4.1)
53-
mocha (>= 0.10.5)
47+
puppet-syntax (1.3.0)
5448
rake
55-
rspec (>= 2.9.0)
56-
rspec-puppet (>= 0.1.1)
57-
rake (10.1.0)
58-
rgen (0.6.5)
59-
rspec (2.14.1)
60-
rspec-core (~> 2.14.0)
61-
rspec-expectations (~> 2.14.0)
62-
rspec-mocks (~> 2.14.0)
63-
rspec-core (2.14.5)
64-
rspec-expectations (2.14.2)
65-
diff-lcs (>= 1.1.3, < 2.0)
66-
rspec-mocks (2.14.3)
67-
rspec-puppet (0.1.6)
49+
puppetlabs_spec_helper (0.8.2)
50+
mocha
51+
puppet-lint
52+
puppet-syntax
53+
rake
54+
rspec
55+
rspec-puppet
56+
rake (10.3.2)
57+
rspec (3.1.0)
58+
rspec-core (~> 3.1.0)
59+
rspec-expectations (~> 3.1.0)
60+
rspec-mocks (~> 3.1.0)
61+
rspec-core (3.1.7)
62+
rspec-support (~> 3.1.0)
63+
rspec-expectations (3.1.2)
64+
diff-lcs (>= 1.2.0, < 2.0)
65+
rspec-support (~> 3.1.0)
66+
rspec-mocks (3.1.3)
67+
rspec-support (~> 3.1.0)
68+
rspec-puppet (1.0.1)
6869
rspec
69-
thor (0.18.1)
70+
rspec-support (3.1.2)
71+
sawyer (0.5.5)
72+
addressable (~> 2.3.5)
73+
faraday (~> 0.8, < 0.10)
74+
thor (0.19.1)
7075

7176
PLATFORMS
7277
ruby
7378

7479
DEPENDENCIES
75-
cardboard (~> 1.0)
80+
cardboard (~> 2.1)

README.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ The following boxen modules are required if optional PHP extensions are used:
2525

2626
```puppet
2727
# Install php 5.4
28-
include php::5_4
28+
php::version { '5.4': }
2929
3030
# Install a couple of specific minor versions
31-
include php::5_3_17
32-
include php::5_4_11
31+
php::version { '5.3.17': }
32+
php::version { '5.4.11': }
3333
3434
# Install Composer globally on your PATH
3535
include php::composer
@@ -52,11 +52,11 @@ php::extension::apc { "apc for ${version}":
5252
}
5353
5454
# Set up PHP-FPM as a service running a specific version of PHP
55-
include php::fpm::5_3_15
55+
php::fpm { '5.3.15': }
5656
5757
# Run multiple PHP-FPM services
58-
include php::fpm::5_4_11
59-
include php::fpm::5_3_23
58+
php::fpm { '5.4.11': }
59+
php::fpm { '5.3.23': }
6060
6161
# Spin up a PHP-FPM pool for a project
6262
# Ensures:
@@ -79,7 +79,7 @@ A sample PHP project manifest is provided in `manifests/project.pp` which will r
7979

8080
A simple project manifest example:
8181

82-
````puppet
82+
```puppet
8383
# your-boxen/modules/projects/manifests/trollin.pp
8484
8585
class projects::trollin {
@@ -93,10 +93,20 @@ class projects::trollin {
9393
php => '5.3.23',
9494
}
9595
}
96-
````
96+
```
9797

9898
With the above, as long as our app is configured to listen to requests at `www/index.php` we can visit [http://trollin.dev/](http://trollin.dev/) to access the app.
9999

100100
In the background this is installing PHP 5.3.23, creating a PHP-FPM service for 5.3.23, and a FPM pool for this project which runs within the FPM service. This then listens on an nginx socket at "#{ENV['BOXEN_SOCKET_DIR']}"/trollin.
101101

102102
The example nginx host template at `templates/nginx/nginx.conf.erb` is also a sample configuration which can be copied to your main boxen module and the nginx template path above altered to match this. This is set up with a basic PHP structure, and Fastcgi params to pass the expected variables from Nginx to PHP-FPM.
103+
104+
## Upgrading to version 2.X.X from version 1.X.X
105+
106+
The old PHP version classes are removed completely in version 2.
107+
108+
You will need to change any code in your manifests like `include PHP::5_X_X` to the version 2 equivalent `php::version { 5.X.X: }`
109+
110+
All other classes remain unchanged in syntax, and should "just work".
111+
112+
This module will now warn you if you are running an insecure version of PHP when you run Boxen.

data/common.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
php::config::root: "%{::boxen::config::home}/phpenv"
3+
php::config::logdir: "%{::boxen::config::logdir}/php"
4+
php::config::configdir: "%{::boxen::config::configdir}/php"
5+
php::config::datadir: "%{::boxen::config::datadir}/php"
6+
php::config::pluginsdir: "%{php::config::root}/plugins"
7+
php::config::cachedir: "%{php::config::datadir}/cache"
8+
php::config::extensioncachedir: "%{php::config::datadir}/cache/extensions"
9+
php::config::configure_params: {}
10+
php::config::composer:
11+
version: '1.0.0-alpha9'
12+
checksum: '05df355b5277c8c9012470e699fa5494'
13+
php::config::phpenv:
14+
revision: '6499bb6c7b645af3f4e67f7e17708d5ee208453f'
15+
php::config::secure_versions:
16+
'5.6': '5.6.8'
17+
'5.5': '5.5.24'
18+
'5.4': '5.4.40'
19+
php::config::secure_warning: true

data/hiera.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
:hierarchy:
3+
- common
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module Puppet::Parser::Functions
2+
newfunction(:php_fpm_require) do |args|
3+
Puppet::Parser::Functions.function('ensure_resource')
4+
function_ensure_resource( [ 'php::fpm', args[0] ] )
5+
end
6+
end
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module Puppet::Parser::Functions
2+
newfunction(:php_require) do |args|
3+
Puppet::Parser::Functions.function('ensure_resource')
4+
function_ensure_resource( [ 'php::version', args[0] ] )
5+
end
6+
end

lib/puppet/provider/php_version/php_source.rb

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,6 @@ def get_configure_args(version, install_path, config_path)
253253
"--with-zlib=#{@resource[:homebrew_path]}/opt/zlibphp",
254254
"--with-snmp=/usr",
255255
"--with-libedit",
256-
"--with-libevent-dir=#{@resource[:homebrew_path]}/opt/libevent",
257256
"--with-mhash",
258257
"--with-curl",
259258
"--with-openssl=/usr",
@@ -267,7 +266,17 @@ def get_configure_args(version, install_path, config_path)
267266
]
268267

269268
# PHP-FPM isn't available until 5.3.3
270-
args << "--enable-fpm" unless @resource[:version].match(/\A5\.3\.[12]\z/)
269+
if Gem::Version.new(@resource[:version]) > Gem::Version.new('5.3.2')
270+
args << "--enable-fpm"
271+
end
272+
273+
# libevent was removed in 5.3.8
274+
if Gem::Version.new(@resource[:version]) < Gem::Version.new('5.3.8')
275+
args << "--with-libevent-dir=#{@resource[:homebrew_path]}/opt/libevent"
276+
end
277+
278+
# User specified configure params
279+
args << @resource[:configure_params]
271280

272281
args
273282
end

lib/puppet/type/php_version.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,8 @@
3434

3535
newparam(:user_home) do
3636
end
37+
38+
newparam(:configure_params) do
39+
defaultto ''
40+
end
3741
end

0 commit comments

Comments
 (0)