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

Commit

Permalink
Merge pull request #61 from boxen/v2
Browse files Browse the repository at this point in the history
V2
  • Loading branch information
mattheath committed Apr 27, 2015
2 parents 6639ee1 + f779b85 commit cc5a2fe
Show file tree
Hide file tree
Showing 367 changed files with 632 additions and 2,973 deletions.
67 changes: 67 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,70 @@
## 2.0.0 ##

* Use Hiera for configs
* Allow configure params on PHP builds
* Add PThreads extension
* Update cardboard to 2.1.0 and update tests
* Add support for PHP 5.6+
* Add insecure PHP version warnings
* Make Composer version configurable
* Remove version specific PHP classes allowing arbitrary PHP versions

## 1.2.6 ##

* Fix autoconf 2.13 sandboxing

## 1.2.5 ##

* Sandbox autoconf213 to fix some installation conflicts
* Set the PECL provider to default on darwin for PHP extensions (this can be overridden)
* Increase `pm.max_children` to 10 for PHP-FPM pools (@gblair)

## 1.2.4 ##

* Fixes compilation of PHP versions > 5.4.17 due to a break in Bison compatibility (@webflo!)

## 1.2.3 ##

* Add xhprof extension (@webflo)
* Add latest versions of PHP 5.4 and 5.5 (@webflo)

## 1.2.2 ##

* Change default .ini settings to increase timeouts, memory limits etc.

## 1.2.1 ##

* Bump Composer to latest 1.0.0-alpha8 (@webbj74)

## 1.2.0 ##

* Adds PHP 5.5 support! This requires a later version of Bison to compile, which is installed as a sandboxed package.
* Adds additional minor versions of PHP for 5.3 and 5.4
* Use ensure_packages from the stdlib to improve module compatibility (thanks @jameydeorio)
* Fixes specs, and added Github API token to travis so builds actually work again

## 1.1.5 ##

* Add OAuth extension (@dbtlr)
* Fix HTTP extension bug including zookeeper (@dbtlr)
* Add Mongo extension (@eebs)
* Fix compilation bug caused by Freetype and GD incompatibilities (@eebs!)

## 1.1.4 ##

* Add memcache PHP extension (@poppen)
* Add pdo_pgsql PHP extension (@poppen)

## 1.1.3 ##

* Added support for Composer see the readme for usage.
* Module now has test specs (hooray!), please run script/cibuild before making a pull request.
* Fixes to bugs the specs caught

## 1.1.2 ##

* Increase xdebug `max_nesting_level`

## 1.1.1 ##

* Remove `libpng` package, add dependency on `libpng` module
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source "https://rubygems.org"

gem "cardboard", "~> 1.0"
gem "cardboard", "~> 2.1"
111 changes: 58 additions & 53 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,75 +1,80 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.3.5)
CFPropertyList (2.2.8)
addressable (2.3.6)
ansi (1.4.3)
boxen (1.5.2)
boxen (2.7.0)
ansi (~> 1.4)
hiera (~> 1.0)
highline (~> 1.6)
json_pure (>= 1.7.7, < 2.0)
librarian-puppet (~> 0.9.9)
octokit (~> 1.15)
puppet (~> 3.0)
cardboard (1.0.4)
boxen (~> 1.0)
librarian-puppet (~> 1.0.0)
octokit (~> 2.7, >= 2.7.1)
puppet (~> 3.7)
cardboard (2.1.0)
boxen (~> 2.1)
puppet-lint (~> 0.3)
puppetlabs_spec_helper (~> 0.4)
rspec-puppet (~> 0.1)
diff-lcs (1.2.4)
facter (1.7.2)
faraday (0.8.8)
multipart-post (~> 1.2.0)
faraday_middleware (0.9.0)
faraday (>= 0.7.4, < 0.9)
hashie (2.0.5)
hiera (1.2.1)
rspec-puppet (~> 1.0)
diff-lcs (1.2.5)
facter (2.3.0)
CFPropertyList (~> 2.2.6)
faraday (0.9.0)
multipart-post (>= 1.2, < 3)
hiera (1.3.4)
json_pure
highline (1.6.19)
json (1.8.0)
json_pure (1.8.0)
librarian-puppet (0.9.10)
json
highline (1.6.21)
json (1.8.1)
json_pure (1.8.1)
librarian (0.1.2)
highline
thor (~> 0.15)
metaclass (0.0.1)
mocha (0.14.0)
librarian-puppet (1.0.9)
json
librarian (>= 0.1.2)
metaclass (0.0.4)
mocha (1.1.0)
metaclass (~> 0.0.1)
multi_json (1.7.9)
multipart-post (1.2.0)
netrc (0.7.7)
octokit (1.25.0)
addressable (~> 2.2)
faraday (~> 0.8)
faraday_middleware (~> 0.9)
hashie (~> 2.0)
multi_json (~> 1.3)
netrc (~> 0.7.7)
puppet (3.2.4)
facter (~> 1.6)
multipart-post (2.0.0)
octokit (2.7.2)
sawyer (~> 0.5.2)
puppet (3.7.3)
facter (> 1.6, < 3)
hiera (~> 1.0)
rgen (~> 0.6.5)
json_pure
puppet-lint (0.3.2)
puppetlabs_spec_helper (0.4.1)
mocha (>= 0.10.5)
puppet-syntax (1.3.0)
rake
rspec (>= 2.9.0)
rspec-puppet (>= 0.1.1)
rake (10.1.0)
rgen (0.6.5)
rspec (2.14.1)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rspec-core (2.14.5)
rspec-expectations (2.14.2)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.3)
rspec-puppet (0.1.6)
puppetlabs_spec_helper (0.8.2)
mocha
puppet-lint
puppet-syntax
rake
rspec
rspec-puppet
rake (10.3.2)
rspec (3.1.0)
rspec-core (~> 3.1.0)
rspec-expectations (~> 3.1.0)
rspec-mocks (~> 3.1.0)
rspec-core (3.1.7)
rspec-support (~> 3.1.0)
rspec-expectations (3.1.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.1.0)
rspec-mocks (3.1.3)
rspec-support (~> 3.1.0)
rspec-puppet (1.0.1)
rspec
thor (0.18.1)
rspec-support (3.1.2)
sawyer (0.5.5)
addressable (~> 2.3.5)
faraday (~> 0.8, < 0.10)
thor (0.19.1)

PLATFORMS
ruby

DEPENDENCIES
cardboard (~> 1.0)
cardboard (~> 2.1)
26 changes: 18 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ The following boxen modules are required if optional PHP extensions are used:

```puppet
# Install php 5.4
include php::5_4
php::version { '5.4': }
# Install a couple of specific minor versions
include php::5_3_17
include php::5_4_11
php::version { '5.3.17': }
php::version { '5.4.11': }
# Install Composer globally on your PATH
include php::composer
Expand All @@ -52,11 +52,11 @@ php::extension::apc { "apc for ${version}":
}
# Set up PHP-FPM as a service running a specific version of PHP
include php::fpm::5_3_15
php::fpm { '5.3.15': }
# Run multiple PHP-FPM services
include php::fpm::5_4_11
include php::fpm::5_3_23
php::fpm { '5.4.11': }
php::fpm { '5.3.23': }
# Spin up a PHP-FPM pool for a project
# Ensures:
Expand All @@ -79,7 +79,7 @@ A sample PHP project manifest is provided in `manifests/project.pp` which will r

A simple project manifest example:

````puppet
```puppet
# your-boxen/modules/projects/manifests/trollin.pp
class projects::trollin {
Expand All @@ -93,10 +93,20 @@ class projects::trollin {
php => '5.3.23',
}
}
````
```

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.

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.

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.

## Upgrading to version 2.X.X from version 1.X.X

The old PHP version classes are removed completely in version 2.

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: }`

All other classes remain unchanged in syntax, and should "just work".

This module will now warn you if you are running an insecure version of PHP when you run Boxen.
19 changes: 19 additions & 0 deletions data/common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
php::config::root: "%{::boxen::config::home}/phpenv"
php::config::logdir: "%{::boxen::config::logdir}/php"
php::config::configdir: "%{::boxen::config::configdir}/php"
php::config::datadir: "%{::boxen::config::datadir}/php"
php::config::pluginsdir: "%{php::config::root}/plugins"
php::config::cachedir: "%{php::config::datadir}/cache"
php::config::extensioncachedir: "%{php::config::datadir}/cache/extensions"
php::config::configure_params: {}
php::config::composer:
version: '1.0.0-alpha9'
checksum: '05df355b5277c8c9012470e699fa5494'
php::config::phpenv:
revision: '6499bb6c7b645af3f4e67f7e17708d5ee208453f'
php::config::secure_versions:
'5.6': '5.6.8'
'5.5': '5.5.24'
'5.4': '5.4.40'
php::config::secure_warning: true
3 changes: 3 additions & 0 deletions data/hiera.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
:hierarchy:
- common
6 changes: 6 additions & 0 deletions lib/puppet/parser/functions/php_fpm_require.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module Puppet::Parser::Functions
newfunction(:php_fpm_require) do |args|
Puppet::Parser::Functions.function('ensure_resource')
function_ensure_resource( [ 'php::fpm', args[0] ] )
end
end
6 changes: 6 additions & 0 deletions lib/puppet/parser/functions/php_require.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module Puppet::Parser::Functions
newfunction(:php_require) do |args|
Puppet::Parser::Functions.function('ensure_resource')
function_ensure_resource( [ 'php::version', args[0] ] )
end
end
13 changes: 11 additions & 2 deletions lib/puppet/provider/php_version/php_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ def get_configure_args(version, install_path, config_path)
"--with-zlib=#{@resource[:homebrew_path]}/opt/zlibphp",
"--with-snmp=/usr",
"--with-libedit",
"--with-libevent-dir=#{@resource[:homebrew_path]}/opt/libevent",
"--with-mhash",
"--with-curl",
"--with-openssl=/usr",
Expand All @@ -267,7 +266,17 @@ def get_configure_args(version, install_path, config_path)
]

# PHP-FPM isn't available until 5.3.3
args << "--enable-fpm" unless @resource[:version].match(/\A5\.3\.[12]\z/)
if Gem::Version.new(@resource[:version]) > Gem::Version.new('5.3.2')
args << "--enable-fpm"
end

# libevent was removed in 5.3.8
if Gem::Version.new(@resource[:version]) < Gem::Version.new('5.3.8')
args << "--with-libevent-dir=#{@resource[:homebrew_path]}/opt/libevent"
end

# User specified configure params
args << @resource[:configure_params]

args
end
Expand Down
4 changes: 4 additions & 0 deletions lib/puppet/type/php_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,8 @@

newparam(:user_home) do
end

newparam(:configure_params) do
defaultto ''
end
end
16 changes: 0 additions & 16 deletions manifests/5_3.pp

This file was deleted.

9 changes: 0 additions & 9 deletions manifests/5_3_10.pp

This file was deleted.

9 changes: 0 additions & 9 deletions manifests/5_3_11.pp

This file was deleted.

9 changes: 0 additions & 9 deletions manifests/5_3_12.pp

This file was deleted.

Loading

0 comments on commit cc5a2fe

Please sign in to comment.