Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions manifests/5_4_18.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Installs php 5.4.18
#
# Usage:
#
# include php::5_4_18
class php::5_4_18 {
php::version { '5.4.18': }
}
8 changes: 8 additions & 0 deletions manifests/5_4_19.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Installs php 5.4.19
#
# Usage:
#
# include php::5_4_19
class php::5_4_19 {
php::version { '5.4.19': }
}
8 changes: 8 additions & 0 deletions manifests/5_4_20.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Installs php 5.4.20
#
# Usage:
#
# include php::5_4_20
class php::5_4_20 {
php::version { '5.4.20': }
}
4 changes: 3 additions & 1 deletion manifests/config.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Base configuration values for PHP
#
class php::config {
class php::config (
$webserver = 'nginx',
) {
require boxen::config

$root = "${boxen::config::home}/phpenv"
Expand Down
10 changes: 10 additions & 0 deletions manifests/fpm/5_4_18.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Launches a PHP FPM service running PHP 5.4.18
# Installs PHP 5.4.18 if it doesn't already exist
#
# Usage:
#
# include php::fpm::5_4_18
#
class php::fpm::5_4_18 {
php::fpm { '5.4.18': }
}
10 changes: 10 additions & 0 deletions manifests/fpm/5_4_19.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Launches a PHP FPM service running PHP 5.4.19
# Installs PHP 5.4.19 if it doesn't already exist
#
# Usage:
#
# include php::fpm::5_4_19
#
class php::fpm::5_4_19 {
php::fpm { '5.4.19': }
}
10 changes: 10 additions & 0 deletions manifests/fpm/5_4_20.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Launches a PHP FPM service running PHP 5.4.20
# Installs PHP 5.4.20 if it doesn't already exist
#
# Usage:
#
# include php::fpm::5_4_20
#
class php::fpm::5_4_20 {
php::fpm { '5.4.20': }
}
13 changes: 4 additions & 9 deletions manifests/fpm/fastcgi.pp
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
# Adds FastCGI configuration parameters to Nginx which is
# Adds FastCGI configuration parameters to $webserver which is
# required to use PHP-FPM
#
# Usage:
#
# include php::fpm::fastcgi
#
class php::fpm::fastcgi {
require nginx::config

file { "${nginx::config::configdir}/fastcgi_params":
source => 'puppet:///modules/php/nginx_fastcgi_params',
require => File[$nginx::config::configdir],
notify => Service['dev.nginx'],
}
}
$webserver_class = "php::fpm::webserver::${php::config::webserver}"
include $webserver_class
}
5 changes: 1 addition & 4 deletions manifests/fpm/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
$ensure = running,
) {
require php::config

# Set some nginx params to ensure that fastcgi actually works
include nginx::config
include php::fpm::fastcgi

# Config file locations
Expand Down Expand Up @@ -41,7 +38,7 @@
service { "dev.php-fpm.${version}":
ensure => running,
subscribe => File["/Library/LaunchDaemons/dev.php-fpm.${version}.plist"],
require => File["${nginx::config::configdir}/fastcgi_params"],
require => Class['php::fpm::fastcgi'],
}

} else {
Expand Down
10 changes: 10 additions & 0 deletions manifests/fpm/webserver/apache.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Adds FastCGI configuration parameters to Apache which is
# required to use PHP-FPM
#
# Usage:
#
# include php::fpm::webserver::apache
#
class php::fpm::webserver::apache {
# @todo configure apache
}
16 changes: 16 additions & 0 deletions manifests/fpm/webserver/nginx.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Adds FastCGI configuration parameters to Nginx which is
# required to use PHP-FPM
#
# Usage:
#
# include php::fpm::webserver::nginx
#
class php::fpm::webserver::nginx {
require nginx::config

file { "${nginx::config::configdir}/fastcgi_params":
source => 'puppet:///modules/php/nginx_fastcgi_params',
require => File[$nginx::config::configdir],
notify => Service['dev.nginx'],
}
}
18 changes: 13 additions & 5 deletions manifests/project.pp
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,19 @@
require => Repository[$repo_dir],
}

# Spin up a PHP-FPM pool for this project, listening on an Nginx socket
php::fpm::pool { "${name}-${php}":
version => $php,
socket_path => "${boxen::config::socketdir}/${name}",
require => File["${nginx::config::sitesdir}/${name}.conf"],
if $nginx {
# Spin up a PHP-FPM pool for this project, listening on an Nginx socket
php::fpm::pool { "${name}-${php}":
version => $php,
socket_path => "${boxen::config::socketdir}/${name}",
require => File["${nginx::config::sitesdir}/${name}.conf"],
}
}
else {
php::fpm::pool { "${name}-${php}":
version => $php,
socket_path => "${boxen::config::socketdir}/${name}",
}
}

if $fpm_pool {
Expand Down