diff --git a/manifests/5_4_18.pp b/manifests/5_4_18.pp new file mode 100644 index 0000000..a73d35c --- /dev/null +++ b/manifests/5_4_18.pp @@ -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': } +} diff --git a/manifests/5_4_19.pp b/manifests/5_4_19.pp new file mode 100644 index 0000000..ccab6f8 --- /dev/null +++ b/manifests/5_4_19.pp @@ -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': } +} diff --git a/manifests/5_4_20.pp b/manifests/5_4_20.pp new file mode 100644 index 0000000..0c35640 --- /dev/null +++ b/manifests/5_4_20.pp @@ -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': } +} diff --git a/manifests/config.pp b/manifests/config.pp index f8342a3..0dd88c7 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -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" diff --git a/manifests/fpm/5_4_18.pp b/manifests/fpm/5_4_18.pp new file mode 100644 index 0000000..5e92adb --- /dev/null +++ b/manifests/fpm/5_4_18.pp @@ -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': } +} diff --git a/manifests/fpm/5_4_19.pp b/manifests/fpm/5_4_19.pp new file mode 100644 index 0000000..42c3e91 --- /dev/null +++ b/manifests/fpm/5_4_19.pp @@ -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': } +} diff --git a/manifests/fpm/5_4_20.pp b/manifests/fpm/5_4_20.pp new file mode 100644 index 0000000..0951919 --- /dev/null +++ b/manifests/fpm/5_4_20.pp @@ -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': } +} diff --git a/manifests/fpm/fastcgi.pp b/manifests/fpm/fastcgi.pp index fc8f651..dccd4cf 100644 --- a/manifests/fpm/fastcgi.pp +++ b/manifests/fpm/fastcgi.pp @@ -1,4 +1,4 @@ -# Adds FastCGI configuration parameters to Nginx which is +# Adds FastCGI configuration parameters to $webserver which is # required to use PHP-FPM # # Usage: @@ -6,11 +6,6 @@ # 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'], - } -} \ No newline at end of file + $webserver_class = "php::fpm::webserver::${php::config::webserver}" + include $webserver_class +} diff --git a/manifests/fpm/service.pp b/manifests/fpm/service.pp index 0d660a7..68bc539 100644 --- a/manifests/fpm/service.pp +++ b/manifests/fpm/service.pp @@ -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 @@ -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 { diff --git a/manifests/fpm/webserver/apache.pp b/manifests/fpm/webserver/apache.pp new file mode 100644 index 0000000..0c42e9f --- /dev/null +++ b/manifests/fpm/webserver/apache.pp @@ -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 +} diff --git a/manifests/fpm/webserver/nginx.pp b/manifests/fpm/webserver/nginx.pp new file mode 100644 index 0000000..588a511 --- /dev/null +++ b/manifests/fpm/webserver/nginx.pp @@ -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'], + } +} \ No newline at end of file diff --git a/manifests/project.pp b/manifests/project.pp index 1ebcd94..505b27b 100644 --- a/manifests/project.pp +++ b/manifests/project.pp @@ -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 {