diff --git a/README.rst b/README.rst index afde98e..538af95 100644 --- a/README.rst +++ b/README.rst @@ -515,11 +515,6 @@ Installs the php-tidy package. Installs the php-tcpdf package. -``php.ng.twig`` --------------- - -Installs the php-twig package. - ``php.ng.cache-lite`` -------------- @@ -529,9 +524,3 @@ Installs the php-cache-lite package. -------------- Installs the php-console-table package. - -``php.ng.ffmpeg`` --------------- - -Installs the php-ffmpeg package and ffmpeg. - diff --git a/VERSION b/VERSION index 81340c7..6e8bf73 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.4 +0.1.0 diff --git a/php/adodb.sls b/php/adodb.sls index 7732f54..96064e4 100644 --- a/php/adodb.sls +++ b/php/adodb.sls @@ -1,4 +1,7 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} + +include: + - php php-adodb: pkg.installed: diff --git a/php/apc.sls b/php/apc.sls index c707f57..113461b 100644 --- a/php/apc.sls +++ b/php/apc.sls @@ -1,4 +1,7 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} + +include: + - php php-apc: pkg.installed: diff --git a/php/apcu.sls b/php/apcu.sls index 324e53f..e0afc5a 100644 --- a/php/apcu.sls +++ b/php/apcu.sls @@ -1,4 +1,7 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} + +include: + - php php-apcu: pkg.installed: diff --git a/php/bcmath.sls b/php/bcmath.sls index a4d0896..0f69c7a 100644 --- a/php/bcmath.sls +++ b/php/bcmath.sls @@ -1,4 +1,7 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} + +include: + - php php-bcmath: pkg.installed: diff --git a/php/cgi.sls b/php/cgi.sls index 0fd2f38..c136c05 100644 --- a/php/cgi.sls +++ b/php/cgi.sls @@ -1,4 +1,7 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} + +include: + - php php-cgi: pkg.installed: diff --git a/php/cli.sls b/php/cli.sls index 2e739ca..858c7da 100644 --- a/php/cli.sls +++ b/php/cli.sls @@ -1,4 +1,7 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} + +include: + - php php-cli: pkg.installed: diff --git a/php/composer.sls b/php/composer.sls index 7aa9747..e1a0ec3 100644 --- a/php/composer.sls +++ b/php/composer.sls @@ -1,13 +1,14 @@ -{% from "php/map.jinja" import php with context %} -{% set install_file = php.local_bin + '/' + php.composer_bin %} +{%- from "php/map.jinja" import php with context %} -{% if not salt['config.get']('sudo_user') %} -{% set salt_user = salt['config.get']('user', 'root') %} -{% else %} -{% set salt_user = salt['config.get']('sudo_user', 'root') %} -{% endif %} +{%- set install_file = php.local_bin + '/' + php.composer_bin %} -{% set salt_user_home = salt['user.info'](salt_user).get('home', '/root') %} +{%- if not salt['config.get']('sudo_user') %} + {%- set salt_user = salt['config.get']('user', 'root') %} +{%- else %} + {%- set salt_user = salt['config.get']('sudo_user', 'root') %} +{%- endif %} + +{%- set salt_user_home = salt['user.info'](salt_user).get('home', '/root') %} include: - php diff --git a/php/curl.sls b/php/curl.sls index 3cf6c43..01d4b85 100644 --- a/php/curl.sls +++ b/php/curl.sls @@ -1,4 +1,7 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} + +include: + - php php-curl: pkg.installed: diff --git a/php/dev.sls b/php/dev.sls index 34729f3..0d2c3d5 100644 --- a/php/dev.sls +++ b/php/dev.sls @@ -1,4 +1,7 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} + +include: + - php php-dev: pkg.installed: diff --git a/php/fpm.sls b/php/fpm.sls index 4ff2b14..40f789f 100644 --- a/php/fpm.sls +++ b/php/fpm.sls @@ -1,4 +1,7 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} + +include: + - php php-fpm: pkg.installed: diff --git a/php/gd.sls b/php/gd.sls index 8ce4576..928b70c 100644 --- a/php/gd.sls +++ b/php/gd.sls @@ -1,4 +1,7 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} + +include: + - php php-gd: pkg.installed: diff --git a/php/imagick.sls b/php/imagick.sls index 8673ba8..e9a1f1a 100644 --- a/php/imagick.sls +++ b/php/imagick.sls @@ -1,4 +1,7 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} + +include: + - php php-imagick: pkg.installed: diff --git a/php/imap.sls b/php/imap.sls index e6708fe..8157e59 100644 --- a/php/imap.sls +++ b/php/imap.sls @@ -1,4 +1,7 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} + +include: + - php php-imap: pkg.installed: diff --git a/php/init.sls b/php/init.sls index 132c2b3..8f4f90c 100644 --- a/php/init.sls +++ b/php/init.sls @@ -1,26 +1,30 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} -{% if not 'ng' in salt['pillar.get']('php', {}) %} +{%- if not 'ng' in salt['pillar.get']('php', {}) %} -{% if grains['os_family']=="Debian" %} -{% set use_ppa = salt['pillar.get']('php:use_ppa', none) %} + {%- if grains['os'] == "Ubuntu" %} + {%- set use_external_repo = salt['pillar.get']('php:use_external_repo', False) %} -{% if use_ppa is not none %} + {%- if use_external_repo %} + {%- set external_repo_name = salt['pillar.get']('php:external_repo_name', 'ondrej/php') %} -{% set ppa_name = salt['pillar.get']('php:ppa_name', 'ondrej/php5') %} +php_from_ppa: + pkgrepo.managed: + - ppa: {{ external_repo_name }} + - env: + - LC_ALL: "C.UTF-8" + - require_in: + - pkg: php_from_ppa + pkg.latest: + - name: {{ php.php_pkg }} + - refresh: True -php54: - pkgrepo.managed: - - ppa: {{ ppa_name }} - pkg.latest: - - name: php5 - - refresh: True + {%- endif %} -{% endif %} -{% endif %} + {%- endif %} php: pkg.installed: - name: {{ php.php_pkg }} -{% endif %} +{%- endif %} \ No newline at end of file diff --git a/php/intl.sls b/php/intl.sls index 7439f23..261addc 100644 --- a/php/intl.sls +++ b/php/intl.sls @@ -1,4 +1,7 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} + +include: + - php php-intl: pkg.installed: diff --git a/php/json.sls b/php/json.sls index a3e99db..2ea5a6a 100644 --- a/php/json.sls +++ b/php/json.sls @@ -1,4 +1,7 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} + +include: + - php php-json: pkg.installed: diff --git a/php/ldap.sls b/php/ldap.sls index da7c88e..7714b87 100644 --- a/php/ldap.sls +++ b/php/ldap.sls @@ -1,4 +1,7 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} + +include: + - php php-ldap: pkg.installed: diff --git a/php/mail.sls b/php/mail.sls index 4de667e..4efd48f 100644 --- a/php/mail.sls +++ b/php/mail.sls @@ -1,4 +1,7 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} + +include: + - php php-mail: pkg.installed: diff --git a/php/map.jinja b/php/map.jinja index 031dba6..6d35bef 100644 --- a/php/map.jinja +++ b/php/map.jinja @@ -1,249 +1,363 @@ -{% if salt['pillar.get']('php:version')|string == '7.0' %} +# -*- coding: utf-8 -*- +# vim: ft=jinja -{% set php = salt['grains.filter_by']({ - 'Debian': { - 'php_pkg': 'php7.0', - 'apc_pkg': 'php7.0-apc', - 'apcu_pkg': 'php7.0-apcu', - 'cli_pkg': 'php7.0-cli', - 'curl_pkg': 'php7.0-curl', - 'fpm_pkg': 'php7.0-fpm', - 'fpm_service': 'php7.0-fpm', - 'gd_pkg': 'php7.0-gd', - 'intl_pkg': 'php7.0-intl', - 'json_pkg': 'php7.0-json', - 'mcrypt_pkg': 'php7.0-mcrypt', - 'memcache_pkg': 'php7.0-memcached', - 'memcached_pkg': 'php7.0-memcached', - 'mysql_pkg': 'php7.0-mysql', - 'mbstring_pkg': 'php7.0-mbstring', - 'readline_pkg': ' php7.0-readline', - 'redis_pkg': 'php7.0-redis', - 'xml_pkg': 'php7.0-xml', - 'imagick_pkg': 'php7.0-imagick', - 'suhosin_pkg': 'php7.0-suhosin', - 'pgsql_pkg': 'php7.0-pgsql', - 'dev_pkg': 'php7.0-dev', - 'zip_pkg': 'php7.0-zip', - 'php_ini': '/etc/php7.0/apache2/php.ini', - 'sqlite_pkg': 'php7.0-sqlite3', - 'local_bin': '/usr/local/bin', - 'temp_dir': '/tmp', - 'composer_bin': 'composer', - }, -}, merge=salt['pillar.get']('php:lookup')) %} - -{% else %} - - {% if salt['grains.get']('os') == 'Ubuntu' %} - {% if salt['grains.get']('osrelease')|string >= '16.04' %} - {% set php = salt['grains.filter_by']({ - 'Ubuntu': { - 'php_pkg': 'php', - 'apc_pkg': 'php', - 'apcu_pkg': 'php-apcu', - 'cgi_pkg': 'php-cgi', - 'cli_pkg': 'php-cli', - 'curl_pkg': 'php-curl', - 'fpm_pkg': 'php-fpm', - 'fpm_service': 'php7.0-fpm', - 'gd_pkg': 'php-gd', - 'oauth_pkg': 'php-oauth', - 'intl_pkg': 'php-intl', - 'json_pkg': 'php-json', - 'mail_pkg': 'php-mail', - 'mbstring_pkg': 'php-mbstring', - 'mcrypt_pkg': 'php-mcrypt', - 'memcache_pkg': 'php-memcache', - 'memcached_pkg': 'php-memcached', - 'mysql_pkg': 'php-mysql', - 'mysqlnd_pkg': 'php', - 'pear_pkg': 'php-pear', - 'readline_pkg': ' php-readline', - 'soap_pkg': 'php-soap', - 'sqlite_pkg': 'php-sqlite3', - 'redis_pkg': 'php-redis', - 'xml_pkg': 'php-xml', - 'imagick_pkg': 'php-imagick', - 'suhosin_pkg': 'php', - 'imap_pkg': 'php-imap', - 'adodb_pkg': 'libphp-adodb', - 'pgsql_pkg': 'php-pgsql', - 'ldap_pkg': 'php-ldap', - 'php_ini': '/etc/php/7.0/apache2/php.ini', - 'dev_pkg': 'php-dev', - 'mongo_pecl': 'php-mongodb', - 'mongo_ext': 'mongodb.so', - 'ext_conf_path': '/etc/php/7.0/mods-available', - 'local_bin': '/usr/local/bin', - 'temp_dir': '/tmp', - 'composer_bin': 'composer', +{%- if salt['grains.get']('os') == "Ubuntu" %} + {%- set use_external_repo = salt['pillar.get']('php:use_external_repo', False) %} + {%- if use_external_repo %} + {%- set php_version = salt['pillar.get']('php:version', '7.0')|string %} + {%- if salt['grains.get']('osrelease')|string >= '16.04' %} + {# Ubuntu 16.04+ specific PHP definitions #} + {%- set php = salt['grains.filter_by']({ + 'Ubuntu': { + 'adodb_pkg': 'libphp-adodb', + 'apc_pkg': 'php-apcu', + 'apcu_pkg': 'php-apcu-bc', + 'bcmath_pkg': 'php' + php_version + '-bcmath', + 'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev', 'pkg-config', 'libsslcommon2-dev', 'gcc', 'make', 'autoconf', 'libc-dev', 'pkg-config'], + 'cgi_pkg': 'php' + php_version + '-cgi', + 'cli_pkg': 'php' + php_version + '-cli', + 'composer_bin': 'composer', + 'curl_pkg': 'php' + php_version + '-curl', + 'dev_pkg': 'php' + php_version + '-dev', + 'ext_conf_path': '/etc/php/' + php_version + '/mods-available', + 'fpm_pkg': 'php' + php_version + '-fpm', + 'fpm_service': 'php' + php_version + '-fpm', + 'gd_pkg': 'php' + php_version + '-gd', + 'imagick_pkg': 'php-imagick', + 'imap_pkg': 'php' + php_version + '-imap', + 'intl_pkg': 'php' + php_version + '-intl', + 'json_pkg': 'php' + php_version + '-json', + 'ldap_pkg': 'php' + php_version + '-ldap', + 'local_bin': '/usr/local/bin', + 'mail_pkg': 'php-mail', + 'mbstring_pkg': 'php' + php_version + '-mbstring', + 'mcrypt_pkg': 'php' + php_version + '-mcrypt', + 'memcache_pkg': 'php-memcache', + 'memcached_pkg': 'php-memcached', + 'mongo_ext': 'mongodb.so', + 'mongo_pecl': 'mongodb', + 'mysql_pkg': 'php' + php_version + '-mysql', + 'mysqlnd_pkg': 'php' + php_version + '-mysql', + 'oauth_pkg': 'php-oauth', + 'pear_pkg': 'php-pear', + 'pgsql_pkg': 'php' + php_version + '-pgsql', + 'php_ini': '/etc/php/' + php_version + '/apache2/php.ini', + 'php_pkg': 'php' + php_version, + 'phpenmod_command': 'phpenmod -v' + php_version, + 'readline_pkg': 'php' + php_version + '-readline', + 'redis_pkg': 'php-redis', + 'soap_pkg': 'php' + php_version + '-soap', + 'sqlite_pkg': 'php' + php_version + '-sqlite3', + 'suhosin5_ext': 'suhosin.so', + 'suhosin5_repo': 'https://github.com/sektioneins/suhosin', + 'suhosin7_ext': 'suhosin7.so', + 'suhosin7_repo': 'https://github.com/sektioneins/suhosin7', + 'temp_dir': '/tmp', + 'xml_pkg': 'php' + php_version + '-xml', + 'zip_pkg': 'php' + php_version + '-zip', } - }, grain="os" - , merge=salt['pillar.get']('php:lookup')) %} - {% else %} - {% set php = salt['grains.filter_by']({ - 'Ubuntu': { - 'php_pkg': 'php5', - 'apc_pkg': 'php-apc', - 'apcu_pkg': 'php5-apcu', - 'cgi_pkg': 'php5-cgi', - 'cli_pkg': 'php5-cli', - 'curl_pkg': 'php5-curl', - 'fpm_pkg': 'php5-fpm', - 'fpm_service': 'php5-fpm', - 'gd_pkg': 'php5-gd', - 'oauth_pkg': 'php5-oauth', - 'intl_pkg': 'php5-intl', - 'json_pkg': 'php5-json', - 'mail_pkg': 'php-mail', - 'mbstring_pkg': 'php5', - 'mcrypt_pkg': 'php5-mcrypt', - 'memcache_pkg': 'php5-memcache', - 'memcached_pkg': 'php5-memcached', - 'mysql_pkg': 'php5-mysql', - 'mysqlnd_pkg': 'php5-mysqlnd', - 'pear_pkg': 'php-pear', - 'readline_pkg': ' php5-readline', - 'soap_pkg': 'php-soap', - 'sqlite_pkg': 'php5-sqlite', - 'redis_pkg': 'php5-redis', - 'xml_pkg': 'php5', - 'imagick_pkg': 'php5-imagick', - 'suhosin_pkg': 'php5-suhosin', - 'imap_pkg': 'php5-imap', - 'adodb_pkg': 'php5-adodb', - 'pgsql_pkg': 'php5-pgsql', - 'ldap_pkg': 'php5-ldap', - 'php_ini': '/etc/php5/apache2/php.ini', - 'dev_pkg': 'php5-dev', - 'mongo_pecl': 'mongo', - 'mongo_ext': 'mongo.so', - 'ext_conf_path': '/etc/php5/mods-available', - 'local_bin': '/usr/local/bin', - 'temp_dir': '/tmp', - 'composer_bin': 'composer', - }, - }, grain='os' - , merge=salt['pillar.get']('php:lookup')) %} - {% endif %} - {% else %} - {% set php = salt['grains.filter_by']({ + }, grain="os", merge=salt['pillar.get']('php:lookup')) %} + {%- else %} + {# All other Ubuntu PHP definitions #} + {%- set php = salt['grains.filter_by']({ + 'Ubuntu': { + 'adodb_pkg': 'libphp-adodb', + 'apc_pkg': 'php-apcu', + 'apcu_pkg': 'php-apcu', + 'bcmath_pkg': 'php' + php_version + '-bcmath', + 'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev', 'gcc', 'make', 'autoconf', 'libc-dev', 'pkg-config'], + 'cgi_pkg': 'php' + php_version + '-cgi', + 'cli_pkg': 'php' + php_version + '-cli', + 'composer_bin': 'composer', + 'curl_pkg': 'php' + php_version + '-curl', + 'dev_pkg': 'php' + php_version + '-dev', + 'ext_conf_path': '/etc/php/' + php_version + '/mods-available', + 'fpm_pkg': 'php' + php_version + '-fpm', + 'fpm_service': 'php' + php_version + '-fpm', + 'gd_pkg': 'php' + php_version + '-gd', + 'imagick_pkg': 'php-imagick', + 'imap_pkg': 'php' + php_version + '-imap', + 'intl_pkg': 'php' + php_version + '-intl', + 'json_pkg': 'php' + php_version + '-json', + 'ldap_pkg': 'php' + php_version + '-ldap', + 'local_bin': '/usr/local/bin', + 'mail_pkg': 'php-mail', + 'mbstring_pkg': 'php' + php_version + '-mbstring', + 'mcrypt_pkg': 'php' + php_version + '-mcrypt', + 'memcache_pkg': 'php-memcache', + 'memcached_pkg': 'php-memcached', + 'mongo_ext': 'mongodb.so', + 'mongo_pecl': 'mongodb', + 'mysql_pkg': 'php' + php_version + '-mysql', + 'mysqlnd_pkg': 'php' + php_version + '-mysql', + 'oauth_pkg': 'php-oauth', + 'pear_pkg': 'php-pear', + 'pgsql_pkg': 'php' + php_version + '-pgsql', + 'php_ini': '/etc/php/' + php_version + '/apache2/php.ini', + 'php_pkg': 'php' + php_version, + 'phpenmod_command': 'phpenmod -v' + php_version, + 'readline_pkg': 'php' + php_version + '-readline', + 'redis_pkg': 'php-redis', + 'soap_pkg': 'php' + php_version + '-soap', + 'sqlite_pkg': 'php' + php_version + '-sqlite3', + 'suhosin5_ext': 'suhosin.so', + 'suhosin5_repo': 'https://github.com/sektioneins/suhosin', + 'suhosin7_ext': 'suhosin7.so', + 'suhosin7_repo': 'https://github.com/sektioneins/suhosin7', + 'temp_dir': '/tmp', + 'xml_pkg': 'php' + php_version + '-xml', + 'zip_pkg': 'php' + php_version + '-zip', + } + }, grain="os", merge=salt['pillar.get']('php:lookup')) %} + {%- endif %} + {%- else %} + {%- if salt['grains.get']('osrelease')|string >= '16.04' %} + {# Ubuntu 16.04+ specific PHP definitions #} + {%- set php = salt['grains.filter_by']({ + 'Ubuntu': { + 'adodb_pkg': 'libphp-adodb', + 'apc_pkg': 'php', + 'apcu_pkg': 'php-apcu', + 'bcmath_pkg': 'php-bcmath', + 'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev', 'pkg-config', 'libsslcommon2-dev'], + 'cgi_pkg': 'php-cgi', + 'cli_pkg': 'php-cli', + 'composer_bin': 'composer', + 'curl_pkg': 'php-curl', + 'dev_pkg': 'php-dev', + 'ext_conf_path': '/etc/php/7.0/mods-available', + 'fpm_pkg': 'php-fpm', + 'fpm_service': 'php7.0-fpm', + 'gd_pkg': 'php-gd', + 'imagick_pkg': 'php-imagick', + 'imap_pkg': 'php-imap', + 'intl_pkg': 'php-intl', + 'json_pkg': 'php-json', + 'ldap_pkg': 'php-ldap', + 'local_bin': '/usr/local/bin', + 'mail_pkg': 'php-mail', + 'mbstring_pkg': 'php-mbstring', + 'mcrypt_pkg': 'php-mcrypt', + 'memcache_pkg': 'php-memcache', + 'memcached_pkg': 'php-memcached', + 'mongo_ext': 'mongodb.so', + 'mongo_pecl': 'php-mongodb', + 'mysql_pkg': 'php-mysql', + 'mysqlnd_pkg': 'php', + 'oauth_pkg': 'php-oauth', + 'pear_pkg': 'php-pear', + 'pgsql_pkg': 'php-pgsql', + 'php_ini': '/etc/php/7.0/apache2/php.ini', + 'php_pkg': 'php', + 'phpenmod_command': 'phpenmod', + 'readline_pkg': ' php-readline', + 'redis_pkg': 'php-redis', + 'soap_pkg': 'php-soap', + 'sqlite_pkg': 'php-sqlite3', + 'suhosin5_ext': 'suhosin.so', + 'suhosin5_repo': 'https://github.com/sektioneins/suhosin', + 'suhosin7_ext': 'suhosin7.so', + 'suhosin7_repo': 'https://github.com/sektioneins/suhosin7', + 'temp_dir': '/tmp', + 'xml_pkg': 'php-xml', + 'zip_pkg': 'php-zip', + } + }, grain="os", merge=salt['pillar.get']('php:lookup')) %} + {%- else %} + {# All other Ubuntu PHP definitions #} + {%- set php = salt['grains.filter_by']({ + 'Ubuntu': { + 'adodb_pkg': 'php5-adodb', + 'apc_pkg': 'php-apc', + 'apcu_pkg': 'php5-apcu', + 'bcmath_pkg': 'php5', + 'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev'], + 'cgi_pkg': 'php5-cgi', + 'cli_pkg': 'php5-cli', + 'composer_bin': 'composer', + 'curl_pkg': 'php5-curl', + 'dev_pkg': 'php5-dev', + 'ext_conf_path': salt['grains.filter_by']({ + 'precise': '/etc/php5/conf.d', + 'default': '/etc/php5/mods-available', + }, grain='oscodename'), + 'fpm_pkg': 'php5-fpm', + 'fpm_service': 'php5-fpm', + 'gd_pkg': 'php5-gd', + 'imagick_pkg': 'php5-imagick', + 'imap_pkg': 'php5-imap', + 'intl_pkg': 'php5-intl', + 'json_pkg': 'php5-json', + 'ldap_pkg': 'php5-ldap', + 'local_bin': '/usr/local/bin', + 'mail_pkg': 'php-mail', + 'mbstring_pkg': 'php5', + 'mcrypt_pkg': 'php5-mcrypt', + 'memcache_pkg': 'php5-memcache', + 'memcached_pkg': 'php5-memcached', + 'mongo_ext': 'mongo.so', + 'mongo_pecl': 'mongo', + 'mysql_pkg': 'php5-mysql', + 'mysqlnd_pkg': 'php5-mysqlnd', + 'oauth_pkg': 'php5-oauth', + 'pear_pkg': 'php-pear', + 'pgsql_pkg': 'php5-pgsql', + 'php_ini': '/etc/php5/apache2/php.ini', + 'php_pkg': 'php5', + 'phpenmod_command': salt['grains.filter_by']({ + 'precise': 'true', + 'default': 'php5enmod', + }, grain='oscodename'), + 'phpenmod_command': 'php5enmod', + 'readline_pkg': ' php5-readline', + 'redis_pkg': 'php5-redis', + 'soap_pkg': 'php-soap', + 'sqlite_pkg': 'php5-sqlite', + 'suhosin5_ext': 'suhosin.so', + 'suhosin5_repo': 'https://github.com/sektioneins/suhosin', + 'suhosin7_ext': 'suhosin7.so', + 'suhosin7_repo': 'https://github.com/sektioneins/suhosin7', + 'temp_dir': '/tmp', + 'xml_pkg': 'php5', + 'zip_pkg': 'php5', + }, + }, grain='os', merge=salt['pillar.get']('php:lookup')) %} + {%- endif %} + {%- endif %} +{%- else %} + {%- set php = salt['grains.filter_by']({ 'Debian': { - 'php_pkg': 'php5', + 'adodb_pkg': 'php5-adodb', 'apc_pkg': 'php-apc', - 'apcu_pkg': 'php5-apcu', + 'apcu_pkg': salt['grains.filter_by']({ + 'wheezy': 'php-apc', + 'jessie': 'php5-apcu', + }, grain='oscodename'), + 'bcmath_pkg': 'php5-fpm', + 'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev', 'build-essential'], 'cgi_pkg': 'php5-cgi', 'cli_pkg': 'php5-cli', + 'composer_bin': 'composer', 'curl_pkg': 'php5-curl', + 'dev_pkg': 'php5-dev', + 'ext_conf_path': '/etc/php5/mods-available', 'fpm_pkg': 'php5-fpm', 'fpm_service': 'php5-fpm', 'gd_pkg': 'php5-gd', - 'oauth_pkg': 'php5-oauth', + 'imagick_pkg': 'php5-imagick', + 'imap_pkg': 'php5-imap', 'intl_pkg': 'php5-intl', 'json_pkg': 'php5-json', + 'ldap_pkg': 'php5-ldap', + 'local_bin': '/usr/local/bin', 'mail_pkg': 'php-mail', 'mbstring_pkg': 'php5', 'mcrypt_pkg': 'php5-mcrypt', 'memcache_pkg': 'php5-memcache', 'memcached_pkg': 'php5-memcached', + 'mongo_ext': 'mongo.so', + 'mongo_pecl': 'mongo', 'mysql_pkg': 'php5-mysql', 'mysqlnd_pkg': 'php5-mysqlnd', + 'oauth_pkg': 'php5-oauth', 'pear_pkg': 'php-pear', + 'pgsql_pkg': 'php5-pgsql', + 'php_ini': '/etc/php5/apache2/php.ini', + 'php_pkg': 'php5', + 'phpenmod_command': 'php5enmod', 'readline_pkg': ' php5-readline', + 'redis_pkg': 'php5-redis', 'soap_pkg': 'php-soap', 'sqlite_pkg': 'php5-sqlite', - 'redis_pkg': 'php5-redis', - 'xml_pkg': 'php5', - 'imagick_pkg': 'php5-imagick', - 'suhosin_pkg': 'php5-suhosin', - 'imap_pkg': 'php5-imap', - 'adodb_pkg': 'php5-adodb', - 'pgsql_pkg': 'php5-pgsql', - 'ldap_pkg': 'php5-ldap', - 'php_ini': '/etc/php5/apache2/php.ini', - 'dev_pkg': 'php5-dev', - 'mongo_pecl': 'mongo', - 'mongo_ext': 'mongo.so', - 'ext_conf_path': '/etc/php5/mods-available', - 'local_bin': '/usr/local/bin', + 'suhosin5_ext': 'suhosin.so', + 'suhosin5_repo': 'https://github.com/sektioneins/suhosin', + 'suhosin7_ext': 'suhosin7.so', + 'suhosin7_repo': 'https://github.com/sektioneins/suhosin7', 'temp_dir': '/tmp', - 'composer_bin': 'composer', + 'xml_pkg': 'php5', + 'zip_pkg': 'php5', }, 'RedHat': { - 'php_pkg': 'php', - 'apc_pkg': 'php-pecl-apc', + 'adodb_pkg': 'php-adodb', + 'apc_pkg': 'php-pecl-apcu', 'apcu_pkg': 'php-pecl-apcu', + 'bcmath_pkg': 'php-bcmath', + 'build_pkgs': ['openssl-devel', 'gcc'], 'cgi_pkg': 'php-cgi', 'cli_pkg': 'php-cli', + 'composer_bin': 'composer', 'curl_pkg': 'curl', + 'dev_pkg': 'php-devel', + 'ext_conf_path': '/etc/php.d', 'fpm_pkg': 'php-fpm', + 'fpm_service': 'php-fpm', 'gd_pkg': 'php-gd', - 'oauth_pkg': 'php-oauth', + 'imagick_pkg': 'php-pecl-imagick', + 'imap_pkg': 'php-imap', 'intl_pkg': 'php-intl', 'json_pkg': 'php-common', + 'ldap_pkg': 'php-ldap', + 'local_bin': '/usr/local/bin', + 'mail_pkg': 'php-pear-Mail', 'mbstring_pkg': 'php-mbstring', 'mcrypt_pkg': 'php-mcrypt', 'memcache_pkg': 'php-pecl-memcache', 'memcached_pkg': 'php-pecl-memcached', + 'mongo_ext': 'mongo.so', + 'mongo_pecl': 'mongo', 'mysql_pkg': 'php-mysql', 'mysqlnd_pkg': 'php-mysqlnd', + 'oauth_pkg': 'php-pecl-oauth', 'pear_pkg': 'php-pear', - 'readline_pkg': ' php-readline', - 'soap_pkg': 'php-soap', - 'sqlite_pkg': 'php5-sqlite', - 'redis_pkg': 'php-redis', - 'fpm_service': 'php-fpm', - 'xml_pkg': 'php-xml', - 'imagick_pkg': 'php-pecl-imagick', - 'suhosin_pkg': 'php-suhosin', - 'imap_pkg': 'php-imap', - 'adodb_pkg': 'php-adodb', 'pgsql_pkg': 'php-pgsql', - 'ldap_pkg': 'php-ldap', 'php_ini': '/etc/php.ini', - 'dev_pkg': 'php-dev', - 'zip_pkg': 'php', - 'mongo_pecl': 'mongo', - 'mongo_ext': 'mongo.so', - 'ext_conf_path': '/etc/php5/conf.d', - 'local_bin': '/usr/local/bin', + 'php_pkg': 'php', + 'readline_pkg': 'php-cli', + 'redis_pkg': 'php-pecl-redis', + 'soap_pkg': 'php-soap', + 'sqlite_pkg': 'php-pdo', + 'suhosin5_ext': 'suhosin.so', + 'suhosin5_repo': 'https://github.com/sektioneins/suhosin', + 'suhosin7_ext': 'suhosin7.so', + 'suhosin7_repo': 'https://github.com/sektioneins/suhosin7', 'temp_dir': '/tmp', - 'composer_bin': 'composer', + 'xml_pkg': 'php-xml', + 'zip_pkg': 'php', }, 'Suse': { - 'php_pkg': 'php5', + 'adodb_pkg': 'php5-dba', 'cli_pkg': 'php5-cli', + 'composer_bin': 'composer', 'curl_pkg': 'php5-curl', + 'dev_pkg': 'php5-devel', + 'ext_conf_path': '/etc/php5/conf.d', 'fpm_pkg': 'php5-fpm', + 'fpm_service': 'php5-fpm', 'gd_pkg': 'php5-gd', + 'imap_pkg': 'php5-imap', 'intl_pkg': 'php5-intl', 'json_pkg': 'php5-json', + 'ldap_pkg': 'php5-ldap', + 'local_bin': '/usr/local/bin', 'mbstring_pkg': 'php5-mbstring', 'mcrypt_pkg': 'php5-mcrypt', + 'mongo_ext': 'mongo.so', + 'mongo_pecl': 'mongo', 'mysql_pkg': 'php5-mysql', 'pear_pkg': 'php5-pear', + 'pgsql_pkg': 'php5-pgsql', + 'php_ini': '/etc/php5/apache2/php.ini', + 'php_pkg': 'php5', 'readline_pkg': ' php5-readline', 'soap_pkg': 'php5-soap', 'sqlite_pkg': 'php5-sqlite', - 'fpm_service': 'php5-fpm', - 'xml_pkg': ['php5-xmlreader','php5-xmlwriter','php5-xmlrpc'], - 'suhosin_pkg': 'php5-suhosin', - 'imap_pkg': 'php5-imap', - 'adodb_pkg': 'php5-dba', - 'pgsql_pkg': 'php5-pgsql', - 'ldap_pkg': 'php5-ldap', - 'php_ini': '/etc/php5/apache2/php.ini', - 'dev_pkg': 'php5-devel', - 'zip_pkg': 'php5-zip', - 'mongo_pecl': 'mongo', - 'mongo_ext': 'mongo.so', - 'ext_conf_path': '/etc/php5/conf.d', - 'local_bin': '/usr/local/bin', + 'suhosin5_ext': 'suhosin.so', + 'suhosin5_repo': 'https://github.com/sektioneins/suhosin', + 'suhosin7_ext': 'suhosin7.so', + 'suhosin7_repo': 'https://github.com/sektioneins/suhosin7', 'temp_dir': '/tmp', - 'composer_bin': 'composer', + 'xml_pkg': ['php5-xmlreader','php5-xmlwriter','php5-xmlrpc'], + 'zip_pkg': 'php5-zip', }, - }, merge=salt['pillar.get']('php:lookup')) %} - {% endif %} -{% endif %} +{%- endif %} diff --git a/php/mbstring.sls b/php/mbstring.sls index 1a401e8..cde4a27 100644 --- a/php/mbstring.sls +++ b/php/mbstring.sls @@ -1,4 +1,7 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} + +include: + - php php-mbstring: pkg.installed: diff --git a/php/mcrypt.sls b/php/mcrypt.sls index 3b16f34..d20ea23 100644 --- a/php/mcrypt.sls +++ b/php/mcrypt.sls @@ -1,4 +1,7 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} + +include: + - php php-mcrypt: pkg.installed: diff --git a/php/memcache.sls b/php/memcache.sls index af8d776..c259f97 100644 --- a/php/memcache.sls +++ b/php/memcache.sls @@ -1,4 +1,7 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} + +include: + - php php-memcache: pkg.installed: diff --git a/php/memcached.sls b/php/memcached.sls index ca040fb..ed9c4f6 100644 --- a/php/memcached.sls +++ b/php/memcached.sls @@ -1,4 +1,7 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} + +include: + - php php-memcached: pkg.installed: diff --git a/php/mongo.sls b/php/mongo.sls index 5cabc06..0616773 100644 --- a/php/mongo.sls +++ b/php/mongo.sls @@ -1,21 +1,27 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} -{% set version = salt['pillar.get']('php:mongo_version', none) %} +{%- set version = salt['pillar.get']('php:mongo_version', none) %} include: - php + - php.xml - php.dev - php.pear php-mongo: pecl.installed: - name: {{ php.mongo_pecl }} + - defaults: True +{%- if version is not none %} + - version: {{ version }} +{%- endif %} - require: - pkg: {{ php.pear_pkg }} - - defaults: True -{% if version is not none %} - - version: {{ version }} -{% endif %} + - pkg: build_pkgs + +build_pkgs: + pkg.installed: + - pkgs: {{ php.build_pkgs }} php-mongo-conf: file.managed: @@ -25,8 +31,12 @@ php-mongo-conf: - require: - pkg: {{ php.php_pkg }} +{%- if salt['grains.get']('os_family') == "Debian" %} + php-mongo-enable: cmd.run: - - name: php5enmod mongo + - name: {{ php.phpenmod_command }} mongo - require: - file: php-mongo-conf + +{%- endif %} diff --git a/php/mysql.sls b/php/mysql.sls index 170347d..eaec44f 100644 --- a/php/mysql.sls +++ b/php/mysql.sls @@ -1,4 +1,7 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} + +include: + - php php-mysql: pkg.installed: diff --git a/php/mysqlnd.sls b/php/mysqlnd.sls index 354d55c..40642ef 100644 --- a/php/mysqlnd.sls +++ b/php/mysqlnd.sls @@ -1,4 +1,7 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} + +include: + - php php-mysqlnd: pkg.installed: diff --git a/php/ng/apache2/ini.sls b/php/ng/apache2/ini.sls index 72f02b7..00c5e22 100644 --- a/php/ng/apache2/ini.sls +++ b/php/ng/apache2/ini.sls @@ -1,5 +1,5 @@ # Manages the libapache2-mod-php5 main ini file -{% from 'php/ng/map.jinja' import php with context %} +{% from "php/ng/map.jinja" import php with context %} {% from "php/ng/ini.jinja" import php_ini %} {% set settings = php.ini.defaults %} diff --git a/php/ng/apache2/init.sls b/php/ng/apache2/init.sls index c0492bd..424da3d 100644 --- a/php/ng/apache2/init.sls +++ b/php/ng/apache2/init.sls @@ -1,5 +1,5 @@ # Installs libapache2-mod-php5 package and manages the associated php.ini on os Debian -{% if grains['os_family']=="Debian" %} +{% if grains['os_family'] == "Debian" %} include: - php.ng.apache2.install diff --git a/php/ng/cli/ini.sls b/php/ng/cli/ini.sls index 1a167fd..77f6713 100644 --- a/php/ng/cli/ini.sls +++ b/php/ng/cli/ini.sls @@ -1,5 +1,5 @@ # Manages the php cli main ini file -{% from 'php/ng/map.jinja' import php with context %} +{% from "php/ng/map.jinja" import php with context %} {% from "php/ng/ini.jinja" import php_ini %} {% set settings = php.ini.defaults %} diff --git a/php/ng/composer.sls b/php/ng/composer.sls index 64bca87..6952b1d 100644 --- a/php/ng/composer.sls +++ b/php/ng/composer.sls @@ -1,2 +1,49 @@ -{% set state = 'composer' %} -{% include "php/ng/installed.jinja" %} +{% from "php/ng/map.jinja" import php with context %} + +{% set install_file = php.lookup.pkgs.local_bin + '/' + php.lookup.pkgs.composer_bin %} + +{% if not salt['config.get']('sudo_user') %} + {% set salt_user = salt['config.get']('user', 'root') %} +{% else %} + {% set salt_user = salt['config.get']('sudo_user', 'root') %} +{% endif %} + +{% set salt_user_home = salt['user.info'](salt_user).get('home', '/root') %} + +include: + - php.ng + +get-composer: + file.managed: + - name: {{ php.lookup.pkgs.temp_dir }}/installer + - mode: 0755 + - unless: test -f {{ install_file }} + - source: https://getcomposer.org/installer + - source_hash: https://composer.github.io/installer.sig + - require: + - pkg: php + +install-composer: + cmd.run: + - name: php {{ php.lookup.pkgs.temp_dir }}/installer --filename={{ php.lookup.pkgs.composer_bin }} --install-dir={{ php.lookup.pkgs.local_bin }} + - unless: test -f {{ install_file }} + - env: + - HOME: {{ salt_user_home }} + - require: + - file: get-composer + +# Get COMPOSER_DEV_WARNING_TIME from the installed composer, and if that time has passed +# then it's time to run `composer selfupdate` +# +# It would be nice if composer had a command line switch to get this, but it doesn't, +# and so we just grep for it. +# +update-composer: + cmd.run: + - name: "{{ install_file }} selfupdate" + - unless: test $(grep --text COMPOSER_DEV_WARNING_TIME {{ install_file }} | egrep '^\s*define' | sed -e 's,[^[:digit:]],,g') \> $(php -r 'echo time();') + - cwd: {{ php.lookup.pkgs.local_bin }} + - env: + - HOME: {{ salt_user_home }} + - require: + - cmd: install-composer diff --git a/php/ng/ffmpeg.sls b/php/ng/ffmpeg.sls deleted file mode 100644 index 9a1010f..0000000 --- a/php/ng/ffmpeg.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'ffmpeg' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/ini.jinja b/php/ng/ini.jinja index eb95003..b9ab9f8 100644 --- a/php/ng/ini.jinja +++ b/php/ng/ini.jinja @@ -1,4 +1,6 @@ -# php.ini management macro. +# -*- coding: utf-8 -*- +# vim: ft=jinja +{# php.ini management macro. #} {% from "php/ng/macro.jinja" import sls_block, serialize %} {% macro php_ini(filename, opts={}, settings={}) %} diff --git a/php/ng/installed.jinja b/php/ng/installed.jinja index ef56fca..853e6b6 100644 --- a/php/ng/installed.jinja +++ b/php/ng/installed.jinja @@ -1,9 +1,12 @@ -# Template for installing packages. +# -*- coding: utf-8 -*- +# vim: ft=jinja +{# Template for installing packages #} {% from "php/ng/map.jinja" import php with context %} {% from "php/ng/macro.jinja" import sls_block %} {% set pkginfo = php.lookup.pkgs.get(state) %} +{% set phpng_version = salt['pillar.get']('php:ng:version', '7.0')|string %} {% set pkgs = [] %} {% set specials = [] %} @@ -20,33 +23,41 @@ {% do pkgs.append(pkginfo) %} {% endif %} -{% if grains['os_family']=="Debian" and (state == 'cli' or state == 'fpm' or state == 'php') %} -{% set use_ppa = salt['pillar.get']('php:use_ppa', False) %} -{% if use_ppa %} +{% if grains['os_family'] == "Debian" and (state == 'cli' or state == 'fpm' or state == 'php') %} + {% set use_external_repo = salt['pillar.get']('php:use_external_repo', False) %} -{% set ppa_name = salt['pillar.get']('php:ppa_name', 'ondrej/php5') %} - -php_ppa_env_{{ state }}: - cmd.run: - - name: apt-add-repository -y ppa:{{ ppa_name }} - - env: - - LC_ALL: C.UTF-8 - - unless: test -f /etc/apt/sources.list.d/{{ ppa_name|replace('/', '-', 1) }}-trusty.list + {% if use_external_repo %} + {% set external_repo_name = salt['pillar.get']('php:external_repo_name', 'ondrej/php') %} + {% set current_php = salt['alternatives.show_current']('php') %} php_ppa_{{ state }}: - pkgrepo.managed: - - ppa: {{ ppa_name }} - - require: - - cmd: php_ppa_env_{{ state }} - - require_in: - - pkg: php_install_{{ state }} - pkg.latest: - - name: {{ state }} - - pkgs: {{ pkgs|json() }} - - refresh: True - - onchanges: - - pkgrepo: php_ppa_{{ state }} -{% endif %} + pkgrepo.managed: + - ppa: {{ external_repo_name }} + - env: + - LC_ALL: C.UTF-8 + - onlyif: + - test ! -e /etc/apt/sources.list.d/ondrej-ubuntu-php-{{ grains['oscodename'] }}.list {# Trusty and Xenial use different naming schemas #} + - test ! -e /etc/apt/sources.list.d/ondrej-php-{{ grains['oscodename'] }}.list {# Trusty and Xenial use different naming schemas #} + - require_in: + - pkg: php_install_{{ state }} + pkg.latest: + - name: {{ state }} + - pkgs: {{ pkgs|json() }} + - refresh: True + - onchanges: + - pkgrepo: php_ppa_{{ state }} + +php_{{ phpng_version }}_link: + alternatives.set: + - name: php + - path: /usr/bin/php{{ phpng_version }} + - require_in: + - pkg: php_install_{{ state }} + - onlyif: + - which php + - test {{ current_php }} != $(which php{{ phpng_version }}) + + {% endif %} {% endif %} php_install_{{ state }}: diff --git a/php/ng/macro.jinja b/php/ng/macro.jinja index b13fbf4..5790820 100644 --- a/php/ng/macro.jinja +++ b/php/ng/macro.jinja @@ -1,11 +1,13 @@ -# Returns a generic block of values suitable for inclusion in most states. +# -*- coding: utf-8 -*- +# vim: ft=jinja +{# Returns a generic block of values suitable for inclusion in most states #} {% macro sls_block(dict, ind=4) %} {% for key, value in dict.items() %} {{ '-'|indent(ind, True) }} {{ key }}: {{ value|json() }} {% endfor %} {% endmacro %} -# Serializes dicts into sequenced data +{# Serializes dicts into sequenced data #} {%- macro serialize(data) -%} {%- if data is mapping -%} {%- set ret = [] -%} diff --git a/php/ng/map.jinja b/php/ng/map.jinja index 09392dd..d1e4dd4 100644 --- a/php/ng/map.jinja +++ b/php/ng/map.jinja @@ -1,712 +1,1473 @@ -{% if salt['pillar.get']('php:ng:version')|string == '7.0' %} - {% set php = salt['pillar.get']('php:ng', { - 'lookup': salt['grains.filter_by']({ - 'Debian': { - 'pkgs': { - 'apcu': 'php-apcu', - 'bcmath': 'php7.0-bcmath', - 'php': 'php7.0', - 'cgi': 'php7.0-cgi', - 'cli': 'php7.0-cli', - 'apache2': 'libapache2-mod-php7.0', - 'curl': 'php7.0-curl', - 'fpm': 'php7.0-fpm', - 'hhvm': 'hhvm', - 'gd': 'php7.0-gd', - 'gmp': 'php7.0-gmp', - 'intl': 'php7.0-intl', - 'mbstring': 'php7.0-mbstring', - 'mcrypt': 'php7.0-mcrypt', - 'mongodb': 'php7.0-mongodb', - 'mysql': 'php7.0-mysql', - 'pspell': 'php7.0-pspell', - 'redis': 'php7.0-redis', - 'snmp': 'php7.0-snmp', - 'soap': 'php7.0-soap', - 'sqlite': 'php7.0-sqlite3', - 'xdebug': 'php7.0-xdebug', - 'xsl': 'php7.0-xsl', - 'xml': 'php7.0-xml', - 'zip': 'php7.0-zip', - 'imap': 'php7.0-imap', - 'pgsql': 'php7.0-pgsql', - 'ldap': 'php7.0-ldap', - 'json': 'php7.0-json', - 'pear': 'php-pear', - 'net4': 'php-net-ipv4', - 'net6': 'php-net-ipv6' - }, - 'fpm': { - 'conf': '/etc/php/7.0/fpm/php-fpm.conf', - 'ini': '/etc/php/7.0/fpm/php.ini', - 'pools': '/etc/php/7.0/fpm/pool.d', - 'service': 'php7.0-fpm', - 'defaults': odict([ - ('global', odict([ - ('pid', '/var/run/php7.0-fpm.pid'), - ('error_log', '/var/log/php7.0-fpm.log'), - ])), - ('include', '/etc/php/7.0/fpm/pool.d/*.conf'), - ]), - }, - 'hhvm': { - 'conf': '/etc/hhvm/server.ini', - 'ini': '/etc/hhvm/php.ini', - 'service': 'hhvm', - 'defaults': {}, - 'server': odict([ - ('pid', '/var/run/hhvm/pid'), - ('hhvm.server.port', '9000'), - ('hhvm.server.type', 'fastcgi'), - ('hhvm.server.default_document', 'index.php'), - ('hhvm.log.use_log_file', 'true'), - ('hhvm.log.file', '/var/log/hhvm/error.log'), - ('hhvm.repo.central.path', '/var/run/hhvm/hhvm.hhbc'), - ]), - 'php': odict([ - ('session.save_handler', 'files'), - ('session.save_path', '/var/lib/hhvm/sessions'), - ('session.gc_maxlifetime', '1440'), - ('hhvm.log.level', 'Warning'), - ('hhvm.log.always_log_unhandled_exceptions', 'true'), - ('hhvm.log.runtime_error_reporting_level', '8191'), - ('hhvm.mysql.typed_results', 'false'), - ]), - }, - 'cli': { - 'ini': '/etc/php/7.0/cli/php.ini', - }, - 'apache2': { - 'ini': '/etc/php/7.0/apache2/php.ini', - }, - }, - }), - 'fpm': { - 'service': { - 'enabled': True, - 'opts': {}, - }, - 'config': { - 'ini': { - 'opts': {}, - 'settings': {}, - }, - 'conf': { - 'opts': {}, - 'settings': {}, - }, - }, - 'pools': {}, - }, - 'hhvm': { - 'service': { - 'enabled': True, - 'opts': {}, - }, - 'config': { - 'server': { - 'opts': {}, - 'settings': {}, - }, - 'php': { - 'opts': {}, - 'settings': {}, - }, - }, - }, - 'cli': { - 'ini': { - 'opts': {}, - 'settings': {}, - } - }, - 'apache2': { - 'ini': { - 'opts': {}, - 'settings': {}, - } - }, - 'ini': { - 'defaults': { - 'PHP': { - 'engine': 'On', - 'short_open_tag': 'Off', - 'asp_tags': 'Off', - 'precision': 14, - 'output_buffering': 4096, - 'zlib.output_compression': 'Off', - 'implicit_flush': 'Off', - 'serialize_precision': 17, - 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled', - 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror', - 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'], - 'zend.enable_gc': 'On', - 'expose_php': 'On', - 'max_execution_time': 30, - 'max_input_time': 60, - 'max_input_nesting_level': 64, - 'max_input_vars': 1000, - 'memory_limit': '128M', - 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'], - 'display_errors': 'Off', - 'display_startup_errors': 'Off', - 'log_errors': 'On', - 'log_errors_max_len': 1024, - 'ignore_repeated_errors': 'Off', - 'ignore_repeated_source': 'Off', - 'report_memleaks': 'On', - 'track_errors': 'Off', - 'html_errors': 'On', - 'variables_order': 'GPCS', - 'request_order': 'GP', - 'register_argc_argv': 'Off', - 'auto_globals_jit': 'On', - 'post_max_size': '8M', - 'default_mimetype': '"text/html"', - 'enable_dl': 'Off', - 'file_uploads': 'On', - 'upload_max_filesize': '2M', - 'max_file_uploads': 20, - 'allow_url_fopen': 'On', - 'allow_url_include': 'Off', - 'default_socket_timeout': 60 - }, - 'CLI Server': { - 'cli_server.color': 'On' - }, - 'Date': { - 'date.timezone': 'America/New_York' - }, - 'Pdo_mysql': { - 'pdo_mysql.cache_size': 2000 - }, - 'mail function': { - 'SMTP': 'localhost', - 'mail.add_x_header': 'On' - }, - 'SQL': { - 'sql.safe_mode': 'Off' - }, - 'ODBC': { - 'odbc.allow_persistent': 'On', - 'odbc.check_persistent': 'On', - 'odbc.max_persistent': '-1', - 'odbc.max_links': '-1', - 'odbc.defaultlrl': 4096, - 'odbc.defaultbinmode': 1 - }, - 'Interbase': { - 'ibase.allow_persistent': 1, - 'ibase.max_persistent': -1, - 'ibase.max_links': -1, - 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"', - 'ibase.dateformat': '"%Y-%m-%d"', - 'ibase.timeformat': '"%H:%M:%S"' - }, - 'MySQL': { - 'mysql.allow_local_infile': 'On', - 'mysql.allow_persistent': 'On', - 'mysql.cache_size': '2000', - 'mysql.max_persistent': -1, - 'mysql.max_links': -1, - 'mysql.connect_timeout': 60, - 'mysql.trace_mode': 'Off' - }, - 'MySQLi': { - 'mysqli.max_persistent': -1, - 'mysqli.allow_persistent': 'On', - 'mysqli.max_links': -1, - 'mysqli.cache_size': 2000, - 'mysqli.default_port': 3306, - 'mysqli.reconnect': 'Off' - }, - 'mysqlnd': { - 'mysqlnd.collect_statistics': 'On', - 'mysqlnd.collect_memory_statistics': 'Off' - }, - 'PostgreSQL': { - 'pgsql.allow_persistent': 'On', - 'pgsql.auto_reset_persistent': 'Off', - 'pgsql.max_persistent': -1, - 'pgsql.max_links': -1, - 'pgsql.ignore_notice': 0, - 'pgsql.log_notice': 0 - }, - 'Sybase-CT': { - 'sybct.allow_persistent': 'On', - 'sybct.max_persistent': -1, - 'sybct.max_links': -1, - 'sybct.min_server_severity': 10, - 'sybct.min_client_severity': 10 - }, - 'bcmath': { - 'bcmath.scale': 0 - }, - 'Session': { - 'session.save_handler': 'files', - 'session.use_strict_mode': 0, - 'session.use_cookies': 1, - 'session.use_only_cookies': 1, - 'session.name': 'PHPSESSID', - 'session.auto_start': 0, - 'session.cookie_lifetime': 0, - 'session.cookie_path': '/', - 'session.serialize_handler': 'php', - 'session.gc_probability': 0, - 'session.gc_divisor': 1000, - 'session.gc_maxlifetime': 1440, - 'session.bug_compat_42': 'Off', - 'session.bug_compat_warn': 'Off', - 'session.cache_limiter': 'nocache', - 'session.cache_expire': '180', - 'session.use_trans_sid': 0, - 'session.hash_function': 0, - 'session.hash_bits_per_character': 5, - 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"' - }, - 'MSSQL': { - 'mssql.allow_persistent': 'On', - 'mssql.max_persistent': -1, - 'mssql.max_links': -1, - 'mssql.min_error_severity': 10, - 'mssql.min_message_severity': 10, - 'mssql.compatibility_mode': 'Off', - 'mssql.secure_connection': 'Off' - }, - 'Tidy': { - 'tidy.clean_output': 'Off' - }, - 'soap': { - 'soap.wsdl_cache_enabled': 1, - 'soap.wsdl_cache_dir': '"/tmp"', - 'soap.wsdl_cache_ttl': 86400, - 'soap.wsdl_cache_limit': 5 - }, - 'ldap': { - 'ldap.max_links': -1 - }, - }, - }, - }, merge=True) %} +# -*- coding: utf-8 -*- +# vim: ft=jinja -{% else %} - - {% if salt['grains.get']('os') == 'Ubuntu' %} - {% if salt['grains.get']('osrelease')|string >= '16.04' %} - {% set php = salt['pillar.get']('php:ng', { - 'lookup': salt['grains.filter_by']({ - 'Ubuntu': { - 'pkgs': { - 'php': 'php', - 'bcmath': 'php7.0-bcmath', - 'apc': 'php', - 'apcu': 'php-apcu', - 'cgi': 'php-cgi', - 'cli': 'php-cli', - 'oauth': 'php-oauth', - 'apache2': 'libapache2-mod-php', - 'curl': 'php-curl', - 'fpm': 'php-fpm', - 'hhvm': 'hhvm', - 'gd': 'php-gd', - 'gmp': 'php-gmp', - 'geoip': 'php-geoip', - 'intl': 'php-intl', - 'mbstring': 'php-mbstring', - 'mcrypt': 'php-mcrypt', - 'memcache': 'php-memcache', - 'memcached': 'php-memcached', - 'mysql': 'php-mysql', - 'mysqlnd': 'php', - 'pear': 'php-pear', - 'pspell': 'php-pspell', - 'snmp': 'php-snmp', - 'soap': 'php-soap', - 'sqlite': 'php-sqlite3', - 'xcache': 'php', - 'xdebug': 'php-xdebug', - 'xsl': 'php7.0-xsl', - 'xml': 'php-xml', - 'zip': 'php-zip', - 'redis': 'php-redis', - 'imagick': 'php-imagick', - 'suhosin': 'php', - 'imap': 'php-imap', - 'adodb': 'php-adodb', - 'pgsql': 'php-pgsql', - 'ldap': 'php-ldap', - 'json': 'php-json', - 'net4': 'php-net-ipv4', - 'net6': 'php-net-ipv6' - }, +{%- if salt['grains.get']('os') == "Ubuntu" %} + {%- set use_external_repo = salt['pillar.get']('php:use_external_repo', False) %} + {%- if use_external_repo %} + {%- set phpng_version = salt['pillar.get']('php:ng:version', '7.0')|string %} + {%- if salt['grains.get']('osrelease')|string >= '16.04' %} + {%- set php = salt['pillar.get']('php:ng', { + 'lookup': salt['grains.filter_by']({ + 'Debian': { + 'pkgs': { + 'adodb': 'libphp-adodb', + 'apache2': 'libapache2-mod-php' + phpng_version, + 'apc': 'php-apcu', + 'apcu': 'php-apcu-bc', + 'bcmath': 'php' + phpng_version + '-bcmath', + 'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev', 'pkg-config', 'libsslcommon2-dev', 'gcc', 'make', 'autoconf', 'libc-dev', 'pkg-config'], + 'cache-lite': 'php-cache-lite', + 'cgi': 'php' + phpng_version + '-cgi', + 'cli': 'php' + phpng_version + '-cli', + 'composer_bin': 'composer', + 'console-table': 'php-console-table', + 'curl': 'php' + phpng_version + '-curl', + 'dev': 'php' + phpng_version + '-dev', + 'ext_conf_path': '/etc/php/' + phpng_version + '/mods-available', + 'fpm': 'php' + phpng_version + '-fpm', + 'gd': 'php' + phpng_version + '-gd', + 'gearman': 'php-gearman', + 'geoip': 'php-geoip', + 'geshi': 'php-geshi', + 'gettext': 'php' + phpng_version, + 'gmp': 'php' + phpng_version + '-gmp', + 'hhvm': 'hhvm', + 'imagick': 'php-imagick', + 'imap': 'php' + phpng_version + '-imap', + 'intl': 'php' + phpng_version + '-intl', + 'json': 'php' + phpng_version + '-json', + 'ldap': 'php' + phpng_version + '-ldap', + 'local_bin': '/usr/local/bin', + 'mbstring': 'php' + phpng_version + '-mbstring', + 'mcrypt': 'php' + phpng_version + '-mcrypt', + 'memcache': 'php-memcache', + 'memcached': 'php-memcached', + 'mongo': 'php-mongo', + 'mongodb': 'php-mongodb', + 'mysql': 'php' + phpng_version + '-mysql', + 'mysqlnd': 'php' + phpng_version + '-mysql', + 'net4': 'php-net-ipv4', + 'net6': 'php-net-ipv6', + 'oauth': 'php-oauth', + 'opcache': 'php' + phpng_version + '-opcache', + 'pear': 'php-pear', + 'pgsql': 'php' + phpng_version + '-pgsql', + 'php': 'php' + phpng_version, + 'phpenmod_command': 'phpenmod -v' + phpng_version, + 'pspell': 'php' + phpng_version + '-pspell', + 'redis': 'php' + phpng_version + '-redis', + 'seclib': ['php-phpseclib', 'php-seclib'], + 'snmp': 'php' + phpng_version + '-snmp', + 'soap': 'php' + phpng_version + '-soap', + 'ssh2': 'php-ssh2', + 'sqlite': 'php' + phpng_version + '-sqlite3', + 'suhosin5_ext': 'suhosin.so', + 'suhosin5_repo': 'https://github.com/sektioneins/suhosin', + 'suhosin7_ext': 'suhosin7.so', + 'suhosin7_repo': 'https://github.com/sektioneins/suhosin7', + 'tcpdf': 'php-tcpdf', + 'temp_dir': '/tmp', + 'tidy': 'php' + phpng_version + '-tidy', + 'xdebug': 'php' + phpng_version + '-xdebug', + 'xml': 'php' + phpng_version + '-xml', + 'xsl': 'php' + phpng_version + '-xsl', + 'zip': 'php' + phpng_version + '-zip', + }, + 'fpm': { + 'conf': '/etc/php/' + phpng_version + '/fpm/php-fpm.conf', + 'ini': '/etc/php/' + phpng_version + '/fpm/php.ini', + 'pools': '/etc/php/' + phpng_version + '/fpm/pool.d', + 'service': 'php' + phpng_version + '-fpm', + 'defaults': odict([ + ('global', odict([ + ('pid', '/var/run/php' + phpng_version + '-fpm.pid'), + ('error_log', '/var/log/php' + phpng_version + '-fpm.log'), + ])), + ('include', '/etc/php/' + phpng_version + '/fpm/pool.d/*.conf'), + ]), + }, + 'hhvm': { + 'conf': '/etc/hhvm/server.ini', + 'ini': '/etc/hhvm/php.ini', + 'service': 'hhvm', + 'defaults': {}, + 'server': odict([ + ('pid', '/var/run/hhvm/pid'), + ('hhvm.server.port', '9000'), + ('hhvm.server.type', 'fastcgi'), + ('hhvm.server.default_document', 'index.php'), + ('hhvm.log.use_log_file', 'true'), + ('hhvm.log.file', '/var/log/hhvm/error.log'), + ('hhvm.repo.central.path', '/var/run/hhvm/hhvm.hhbc'), + ]), + 'php': odict([ + ('session.save_handler', 'files'), + ('session.save_path', '/var/lib/hhvm/sessions'), + ('session.gc_maxlifetime', '1440'), + ('hhvm.log.level', 'Warning'), + ('hhvm.log.always_log_unhandled_exceptions', 'true'), + ('hhvm.log.runtime_error_reporting_level', '8191'), + ('hhvm.mysql.typed_results', 'false'), + ]), + }, + 'cli': { + 'ini': '/etc/php/' + phpng_version + '/cli/php.ini', + }, + 'apache2': { + 'ini': '/etc/php/' + phpng_version + '/apache2/php.ini', + }, + }, + }), 'fpm': { - 'conf': '/etc/php/7.0/fpm/php-fpm.conf', - 'ini': '/etc/php/7.0/fpm/php.ini', - 'pools': '/etc/php/7.0/fpm/pool.d', - 'service': 'php7.0-fpm', - 'defaults': odict([ - ('global', odict([ - ('pid', '/var/run/php7.0-fpm.pid'), - ('error_log', '/var/log/php7.0-fpm.log'), - ])), - ('include', '/etc/php/7.0/fpm/pool.d/*.conf'), - ]), + 'service': { + 'enabled': True, + 'opts': {}, + }, + 'config': { + 'ini': { + 'opts': {}, + 'settings': {}, + }, + 'conf': { + 'opts': {}, + 'settings': {}, + }, + }, + 'pools': {}, }, 'hhvm': { - 'conf': '/etc/hhvm/server.ini', - 'ini': '/etc/hhvm/php.ini', - 'service': 'hhvm', - 'defaults': {}, - 'server': odict([ - ('pid', '/var/run/hhvm/pid'), - ('hhvm.server.port', '9000'), - ('hhvm.server.type', 'fastcgi'), - ('hhvm.server.default_document', 'index.php'), - ('hhvm.log.use_log_file', 'true'), - ('hhvm.log.file', '/var/log/hhvm/error.log'), - ('hhvm.repo.central.path', '/var/run/hhvm/hhvm.hhbc'), - ]), - 'php': odict([ - ('session.save_handler', 'files'), - ('session.save_path', '/var/lib/hhvm/sessions'), - ('session.gc_maxlifetime', '1440'), - ('hhvm.log.level', 'Warning'), - ('hhvm.log.always_log_unhandled_exceptions', 'true'), - ('hhvm.log.runtime_error_reporting_level', '8191'), - ('hhvm.mysql.typed_results', 'false'), - ]), + 'service': { + 'enabled': True, + 'opts': {}, + }, + 'config': { + 'server': { + 'opts': {}, + 'settings': {}, + }, + 'php': { + 'opts': {}, + 'settings': {}, + }, + }, }, 'cli': { - 'ini': '/etc/php/7.0/cli/php.ini', + 'ini': { + 'opts': {}, + 'settings': {}, + } }, 'apache2': { - 'ini': '/etc/php/7.0/apache2/php.ini', + 'ini': { + 'opts': {}, + 'settings': {}, + } + }, + 'ini': { + 'defaults': { + 'PHP': { + 'allow_url_fopen': 'On', + 'allow_url_include': 'Off', + 'asp_tags': 'Off', + 'auto_globals_jit': 'On', + 'default_mimetype': '"text/html"', + 'default_socket_timeout': 60, + 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled', + 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror', + 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'], + 'display_errors': 'Off', + 'display_startup_errors': 'Off', + 'enable_dl': 'Off', + 'engine': 'On', + 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'], + 'expose_php': 'On', + 'file_uploads': 'On', + 'html_errors': 'On', + 'ignore_repeated_errors': 'Off', + 'ignore_repeated_source': 'Off', + 'implicit_flush': 'Off', + 'log_errors': 'On', + 'log_errors_max_len': 1024, + 'max_execution_time': 30, + 'max_file_uploads': 20, + 'max_input_nesting_level': 64, + 'max_input_time': 60, + 'max_input_vars': 1000, + 'memory_limit': '128M', + 'output_buffering': 4096, + 'post_max_size': '8M', + 'precision': 14, + 'register_argc_argv': 'Off', + 'report_memleaks': 'On', + 'request_order': 'GP', + 'serialize_precision': 17, + 'short_open_tag': 'Off', + 'track_errors': 'Off', + 'upload_max_filesize': '2M', + 'variables_order': 'GPCS', + 'zend.enable_gc': 'On', + 'zlib.output_compression': 'Off', + }, + 'CLI Server': { + 'cli_server.color': 'On' + }, + 'Date': { + 'date.timezone': 'America/New_York' + }, + 'Pdo_mysql': { + 'pdo_mysql.cache_size': 2000 + }, + 'mail function': { + 'SMTP': 'localhost', + 'mail.add_x_header': 'On' + }, + 'SQL': { + 'sql.safe_mode': 'Off' + }, + 'ODBC': { + 'odbc.allow_persistent': 'On', + 'odbc.check_persistent': 'On', + 'odbc.max_persistent': '-1', + 'odbc.max_links': '-1', + 'odbc.defaultlrl': 4096, + 'odbc.defaultbinmode': 1 + }, + 'Interbase': { + 'ibase.allow_persistent': 1, + 'ibase.max_persistent': -1, + 'ibase.max_links': -1, + 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"', + 'ibase.dateformat': '"%Y-%m-%d"', + 'ibase.timeformat': '"%H:%M:%S"' + }, + 'MySQL': { + 'mysql.allow_local_infile': 'On', + 'mysql.allow_persistent': 'On', + 'mysql.cache_size': '2000', + 'mysql.max_persistent': -1, + 'mysql.max_links': -1, + 'mysql.connect_timeout': 60, + 'mysql.trace_mode': 'Off' + }, + 'MySQLi': { + 'mysqli.max_persistent': -1, + 'mysqli.allow_persistent': 'On', + 'mysqli.max_links': -1, + 'mysqli.cache_size': 2000, + 'mysqli.default_port': 3306, + 'mysqli.reconnect': 'Off' + }, + 'mysqlnd': { + 'mysqlnd.collect_statistics': 'On', + 'mysqlnd.collect_memory_statistics': 'Off' + }, + 'PostgreSQL': { + 'pgsql.allow_persistent': 'On', + 'pgsql.auto_reset_persistent': 'Off', + 'pgsql.max_persistent': -1, + 'pgsql.max_links': -1, + 'pgsql.ignore_notice': 0, + 'pgsql.log_notice': 0 + }, + 'Sybase-CT': { + 'sybct.allow_persistent': 'On', + 'sybct.max_persistent': -1, + 'sybct.max_links': -1, + 'sybct.min_server_severity': 10, + 'sybct.min_client_severity': 10 + }, + 'bcmath': { + 'bcmath.scale': 0 + }, + 'Session': { + 'session.save_handler': 'files', + 'session.use_strict_mode': 0, + 'session.use_cookies': 1, + 'session.use_only_cookies': 1, + 'session.name': 'PHPSESSID', + 'session.auto_start': 0, + 'session.cookie_lifetime': 0, + 'session.cookie_path': '/', + 'session.serialize_handler': 'php', + 'session.gc_probability': 0, + 'session.gc_divisor': 1000, + 'session.gc_maxlifetime': 1440, + 'session.bug_compat_42': 'Off', + 'session.bug_compat_warn': 'Off', + 'session.cache_limiter': 'nocache', + 'session.cache_expire': '180', + 'session.use_trans_sid': 0, + 'session.hash_function': 0, + 'session.hash_bits_per_character': 5, + 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"' + }, + 'MSSQL': { + 'mssql.allow_persistent': 'On', + 'mssql.max_persistent': -1, + 'mssql.max_links': -1, + 'mssql.min_error_severity': 10, + 'mssql.min_message_severity': 10, + 'mssql.compatibility_mode': 'Off', + 'mssql.secure_connection': 'Off' + }, + 'Tidy': { + 'tidy.clean_output': 'Off' + }, + 'soap': { + 'soap.wsdl_cache_enabled': 1, + 'soap.wsdl_cache_dir': '"/tmp"', + 'soap.wsdl_cache_ttl': 86400, + 'soap.wsdl_cache_limit': 5 + }, + 'ldap': { + 'ldap.max_links': -1 + }, + }, + }, + }, merge=True) %} + {%- else %} + {%- set php = salt['pillar.get']('php:ng', { + 'lookup': salt['grains.filter_by']({ + 'Debian': { + 'pkgs': { + 'adodb': 'libphp-adodb', + 'apache2': 'libapache2-mod-php' + phpng_version, + 'apc': 'php-apcu', + 'apcu': 'php-apcu-bc', + 'bcmath': 'php' + phpng_version + '-bcmath', + 'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev', 'gcc', 'make', 'autoconf', 'libc-dev', 'pkg-config'], + 'cache-lite': 'php-cache-lite', + 'cgi': 'php' + phpng_version + '-cgi', + 'cli': 'php' + phpng_version + '-cli', + 'composer_bin': 'composer', + 'console-table': 'php-console-table', + 'curl': 'php' + phpng_version + '-curl', + 'dev': 'php' + phpng_version + '-dev', + 'ext_conf_path': '/etc/php/' + phpng_version + '/mods-available', + 'fpm': 'php' + phpng_version + '-fpm', + 'gd': 'php' + phpng_version + '-gd', + 'gearman': 'php-gearman', + 'geoip': 'php-geoip', + 'geshi': 'php-geshi', + 'gettext': 'php' + phpng_version, + 'gmp': 'php' + phpng_version + '-gmp', + 'hhvm': 'hhvm', + 'imagick': 'php-imagick', + 'imap': 'php' + phpng_version + '-imap', + 'intl': 'php' + phpng_version + '-intl', + 'json': 'php' + phpng_version + '-json', + 'ldap': 'php' + phpng_version + '-ldap', + 'local_bin': '/usr/local/bin', + 'mbstring': 'php' + phpng_version + '-mbstring', + 'mcrypt': 'php' + phpng_version + '-mcrypt', + 'memcache': 'php-memcache', + 'memcached': 'php-memcached', + 'mongo': 'php-mongo', + 'mongodb': 'php-mongodb', + 'mysql': 'php' + phpng_version + '-mysql', + 'mysqlnd': 'php' + phpng_version + '-mysql', + 'net4': 'php-net-ipv4', + 'net6': 'php-net-ipv6', + 'oauth': 'php-oauth', + 'opcache': 'php' + phpng_version + '-opcache', + 'pear': 'php-pear', + 'pgsql': 'php' + phpng_version + '-pgsql', + 'php': 'php' + phpng_version, + 'phpenmod_command': 'phpenmod -v' + phpng_version, + 'pspell': 'php' + phpng_version + '-pspell', + 'redis': 'php' + phpng_version + '-redis', + 'seclib': 'php-seclib', + 'snmp': 'php' + phpng_version + '-snmp', + 'soap': 'php' + phpng_version + '-soap', + 'ssh2': 'php-ssh2', + 'sqlite': 'php' + phpng_version + '-sqlite3', + 'suhosin5_ext': 'suhosin.so', + 'suhosin5_repo': 'https://github.com/sektioneins/suhosin', + 'suhosin7_ext': 'suhosin7.so', + 'suhosin7_repo': 'https://github.com/sektioneins/suhosin7', + 'tcpdf': 'php-tcpdf', + 'temp_dir': '/tmp', + 'tidy': 'php' + phpng_version + '-tidy', + 'xdebug': 'php' + phpng_version + '-xdebug', + 'xml': 'php' + phpng_version + '-xml', + 'xsl': 'php' + phpng_version + '-xsl', + 'zip': 'php' + phpng_version + '-zip', + }, + 'fpm': { + 'conf': '/etc/php/' + phpng_version + '/fpm/php-fpm.conf', + 'ini': '/etc/php/' + phpng_version + '/fpm/php.ini', + 'pools': '/etc/php/' + phpng_version + '/fpm/pool.d', + 'service': 'php' + phpng_version + '-fpm', + 'defaults': odict([ + ('global', odict([ + ('pid', '/var/run/php' + phpng_version + '-fpm.pid'), + ('error_log', '/var/log/php' + phpng_version + '-fpm.log'), + ])), + ('include', '/etc/php/' + phpng_version + '/fpm/pool.d/*.conf'), + ]), + }, + 'hhvm': { + 'conf': '/etc/hhvm/server.ini', + 'ini': '/etc/hhvm/php.ini', + 'service': 'hhvm', + 'defaults': {}, + 'server': odict([ + ('pid', '/var/run/hhvm/pid'), + ('hhvm.server.port', '9000'), + ('hhvm.server.type', 'fastcgi'), + ('hhvm.server.default_document', 'index.php'), + ('hhvm.log.use_log_file', 'true'), + ('hhvm.log.file', '/var/log/hhvm/error.log'), + ('hhvm.repo.central.path', '/var/run/hhvm/hhvm.hhbc'), + ]), + 'php': odict([ + ('session.save_handler', 'files'), + ('session.save_path', '/var/lib/hhvm/sessions'), + ('session.gc_maxlifetime', '1440'), + ('hhvm.log.level', 'Warning'), + ('hhvm.log.always_log_unhandled_exceptions', 'true'), + ('hhvm.log.runtime_error_reporting_level', '8191'), + ('hhvm.mysql.typed_results', 'false'), + ]), + }, + 'cli': { + 'ini': '/etc/php/' + phpng_version + '/cli/php.ini', + }, + 'apache2': { + 'ini': '/etc/php/' + phpng_version + '/apache2/php.ini', + }, + }, + }), + 'fpm': { + 'service': { + 'enabled': True, + 'opts': {}, + }, + 'config': { + 'ini': { + 'opts': {}, + 'settings': {}, + }, + 'conf': { + 'opts': {}, + 'settings': {}, + }, + }, + 'pools': {}, + }, + 'hhvm': { + 'service': { + 'enabled': True, + 'opts': {}, + }, + 'config': { + 'server': { + 'opts': {}, + 'settings': {}, + }, + 'php': { + 'opts': {}, + 'settings': {}, + }, + }, + }, + 'cli': { + 'ini': { + 'opts': {}, + 'settings': {}, + } + }, + 'apache2': { + 'ini': { + 'opts': {}, + 'settings': {}, + } + }, + 'ini': { + 'defaults': { + 'PHP': { + 'allow_url_fopen': 'On', + 'allow_url_include': 'Off', + 'asp_tags': 'Off', + 'auto_globals_jit': 'On', + 'default_mimetype': '"text/html"', + 'default_socket_timeout': 60, + 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled', + 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror', + 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'], + 'display_errors': 'Off', + 'display_startup_errors': 'Off', + 'enable_dl': 'Off', + 'engine': 'On', + 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'], + 'expose_php': 'On', + 'file_uploads': 'On', + 'html_errors': 'On', + 'ignore_repeated_errors': 'Off', + 'ignore_repeated_source': 'Off', + 'implicit_flush': 'Off', + 'log_errors': 'On', + 'log_errors_max_len': 1024, + 'max_execution_time': 30, + 'max_file_uploads': 20, + 'max_input_nesting_level': 64, + 'max_input_time': 60, + 'max_input_vars': 1000, + 'memory_limit': '128M', + 'output_buffering': 4096, + 'post_max_size': '8M', + 'precision': 14, + 'register_argc_argv': 'Off', + 'report_memleaks': 'On', + 'request_order': 'GP', + 'serialize_precision': 17, + 'short_open_tag': 'Off', + 'track_errors': 'Off', + 'upload_max_filesize': '2M', + 'variables_order': 'GPCS', + 'zend.enable_gc': 'On', + 'zlib.output_compression': 'Off', + }, + 'CLI Server': { + 'cli_server.color': 'On' + }, + 'Date': { + 'date.timezone': 'America/New_York' + }, + 'Pdo_mysql': { + 'pdo_mysql.cache_size': 2000 + }, + 'mail function': { + 'SMTP': 'localhost', + 'mail.add_x_header': 'On' + }, + 'SQL': { + 'sql.safe_mode': 'Off' + }, + 'ODBC': { + 'odbc.allow_persistent': 'On', + 'odbc.check_persistent': 'On', + 'odbc.max_persistent': '-1', + 'odbc.max_links': '-1', + 'odbc.defaultlrl': 4096, + 'odbc.defaultbinmode': 1 + }, + 'Interbase': { + 'ibase.allow_persistent': 1, + 'ibase.max_persistent': -1, + 'ibase.max_links': -1, + 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"', + 'ibase.dateformat': '"%Y-%m-%d"', + 'ibase.timeformat': '"%H:%M:%S"' + }, + 'MySQL': { + 'mysql.allow_local_infile': 'On', + 'mysql.allow_persistent': 'On', + 'mysql.cache_size': '2000', + 'mysql.max_persistent': -1, + 'mysql.max_links': -1, + 'mysql.connect_timeout': 60, + 'mysql.trace_mode': 'Off' + }, + 'MySQLi': { + 'mysqli.max_persistent': -1, + 'mysqli.allow_persistent': 'On', + 'mysqli.max_links': -1, + 'mysqli.cache_size': 2000, + 'mysqli.default_port': 3306, + 'mysqli.reconnect': 'Off' + }, + 'mysqlnd': { + 'mysqlnd.collect_statistics': 'On', + 'mysqlnd.collect_memory_statistics': 'Off' + }, + 'PostgreSQL': { + 'pgsql.allow_persistent': 'On', + 'pgsql.auto_reset_persistent': 'Off', + 'pgsql.max_persistent': -1, + 'pgsql.max_links': -1, + 'pgsql.ignore_notice': 0, + 'pgsql.log_notice': 0 + }, + 'Sybase-CT': { + 'sybct.allow_persistent': 'On', + 'sybct.max_persistent': -1, + 'sybct.max_links': -1, + 'sybct.min_server_severity': 10, + 'sybct.min_client_severity': 10 + }, + 'bcmath': { + 'bcmath.scale': 0 + }, + 'Session': { + 'session.save_handler': 'files', + 'session.use_strict_mode': 0, + 'session.use_cookies': 1, + 'session.use_only_cookies': 1, + 'session.name': 'PHPSESSID', + 'session.auto_start': 0, + 'session.cookie_lifetime': 0, + 'session.cookie_path': '/', + 'session.serialize_handler': 'php', + 'session.gc_probability': 0, + 'session.gc_divisor': 1000, + 'session.gc_maxlifetime': 1440, + 'session.bug_compat_42': 'Off', + 'session.bug_compat_warn': 'Off', + 'session.cache_limiter': 'nocache', + 'session.cache_expire': '180', + 'session.use_trans_sid': 0, + 'session.hash_function': 0, + 'session.hash_bits_per_character': 5, + 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"' + }, + 'MSSQL': { + 'mssql.allow_persistent': 'On', + 'mssql.max_persistent': -1, + 'mssql.max_links': -1, + 'mssql.min_error_severity': 10, + 'mssql.min_message_severity': 10, + 'mssql.compatibility_mode': 'Off', + 'mssql.secure_connection': 'Off' + }, + 'Tidy': { + 'tidy.clean_output': 'Off' + }, + 'soap': { + 'soap.wsdl_cache_enabled': 1, + 'soap.wsdl_cache_dir': '"/tmp"', + 'soap.wsdl_cache_ttl': 86400, + 'soap.wsdl_cache_limit': 5 + }, + 'ldap': { + 'ldap.max_links': -1 + }, + }, + }, + }, merge=True) %} + {%- endif %} + {%- else %} + {%- if salt['grains.get']('osrelease')|string >= '16.04' %} + {%- set php = salt['pillar.get']('php:ng', { + 'lookup': salt['grains.filter_by']({ + 'Ubuntu': { + 'pkgs': { + 'adodb': 'libphp-adodb', + 'apache2': 'libapache2-mod-php', + 'apc': 'php', + 'apcu': 'php-apcu', + 'bcmath': 'php7.0-bcmath', + 'cache-lite': 'php-cache-lite', + 'cgi': 'php-cgi', + 'cli': 'php-cli', + 'console-table': 'php-console-table', + 'curl': 'php-curl', + 'dev': 'php7.0-dev', + 'fpm': 'php-fpm', + 'gd': 'php-gd', + 'geoip': 'php-geoip', + 'geshi': 'php-geshi', + 'gmp': 'php-gmp', + 'hhvm': 'hhvm', + 'imagick': 'php-imagick', + 'imap': 'php-imap', + 'intl': 'php-intl', + 'json': 'php-json', + 'ldap': 'php-ldap', + 'mbstring': 'php-mbstring', + 'mcrypt': 'php-mcrypt', + 'memcache': 'php-memcache', + 'memcached': 'php-memcached', + 'mongodb': 'php-mongodb', + 'mysql': 'php-mysql', + 'mysqlnd': 'php', + 'net4': 'php-net-ipv4', + 'net6': 'php-net-ipv6', + 'oauth': 'php-oauth', + 'opcache': 'php7.0-opcache', + 'pear': 'php-pear', + 'pgsql': 'php-pgsql', + 'php': 'php', + 'phpenmod_command': 'phpenmod', + 'pspell': 'php-pspell', + 'redis': 'php-redis', + 'seclib': ['php-phpseclib', 'php-seclib'], + 'snmp': 'php-snmp', + 'soap': 'php-soap', + 'sqlite': 'php-sqlite3', + 'ssh2': 'php-ssh2', + 'suhosin': 'php', + 'tcpdf': 'php-tcpdf', + 'tidy': 'php7.0-tidy', + 'xcache': 'php', + 'xdebug': 'php-xdebug', + 'xml': 'php-xml', + 'xsl': 'php7.0-xsl', + 'zip': 'php-zip', + }, + 'fpm': { + 'conf': '/etc/php/7.0/fpm/php-fpm.conf', + 'ini': '/etc/php/7.0/fpm/php.ini', + 'pools': '/etc/php/7.0/fpm/pool.d', + 'service': 'php7.0-fpm', + 'defaults': odict([ + ('global', odict([ + ('pid', '/var/run/php7.0-fpm.pid'), + ('error_log', '/var/log/php7.0-fpm.log'), + ])), + ('include', '/etc/php/7.0/fpm/pool.d/*.conf'), + ]), + }, + 'hhvm': { + 'conf': '/etc/hhvm/server.ini', + 'ini': '/etc/hhvm/php.ini', + 'service': 'hhvm', + 'defaults': {}, + 'server': odict([ + ('pid', '/var/run/hhvm/pid'), + ('hhvm.server.port', '9000'), + ('hhvm.server.type', 'fastcgi'), + ('hhvm.server.default_document', 'index.php'), + ('hhvm.log.use_log_file', 'true'), + ('hhvm.log.file', '/var/log/hhvm/error.log'), + ('hhvm.repo.central.path', '/var/run/hhvm/hhvm.hhbc'), + ]), + 'php': odict([ + ('session.save_handler', 'files'), + ('session.save_path', '/var/lib/hhvm/sessions'), + ('session.gc_maxlifetime', '1440'), + ('hhvm.log.level', 'Warning'), + ('hhvm.log.always_log_unhandled_exceptions', 'true'), + ('hhvm.log.runtime_error_reporting_level', '8191'), + ('hhvm.mysql.typed_results', 'false'), + ]), + }, + 'cli': { + 'ini': '/etc/php/7.0/cli/php.ini', + }, + 'apache2': { + 'ini': '/etc/php/7.0/apache2/php.ini', + }, + 'xcache': { + 'ini': '/etc/php/7.0/mods-available/xcache.ini', + 'defaults': {}, + }, + }, + }, grain="os"), + 'fpm': { + 'service': { + 'enabled': True, + 'opts': {}, + }, + 'config': { + 'ini': { + 'opts': {}, + 'settings': {}, + }, + 'conf': { + 'opts': {}, + 'settings': {}, + }, + }, + 'pools': { + 'default.conf': { + 'enabled': False, + 'opts': {}, + }, + }, + }, + 'hhvm': { + 'service': { + 'enabled': True, + 'opts': {}, + }, + 'config': { + 'server': { + 'opts': {}, + 'settings': {}, + }, + 'php': { + 'opts': {}, + 'settings': {}, + }, + }, + }, + 'cli': { + 'ini': { + 'opts': {}, + 'settings': {}, + } + }, + 'apache2': { + 'ini': { + 'opts': {}, + 'settings': {}, + } }, 'xcache': { - 'ini': '/etc/php/7.0/mods-available/xcache.ini', - 'defaults': {}, + 'ini': { + 'defaults': { + 'xcache-common': { + 'extension': 'xcache.so', + }, + 'xcache.admin': { + 'xcache.admin.enable_auth': 'On', + }, + 'xcache': { + 'xcache.shm_scheme': '"mmap"', + 'xcache.size': '60M', + 'xcache.count': '1', + 'xcache.slots': '8K', + 'xcache.ttl': '0', + 'xcache.gc_interval': '0', + 'xcache.var_size': '4M', + 'xcache.var_count': '1', + 'xcache.var_slots': '8K', + 'xcache.var_ttl': '0', + 'xcache.var_maxttl': '0', + 'xcache.var_gc_interval': '300', + 'xcache.var_namespace_mode': '0', + 'xcache.var_namespace': '""', + 'xcache.readonly_protection': 'Off', + 'xcache.mmap_path': '"/dev/zero"', + 'xcache.coredump_directory': '""', + 'xcache.coredump_type': '0', + 'xcache.disable_on_crash': 'Off', + 'xcache.experimental': 'Off', + 'xcache.cacher': 'On', + 'xcache.stat': 'On', + 'xcache.optimizer': 'Off', + }, + 'xcache.coverager': { + 'xcache.coverager': 'Off', + 'xcache.coverager_autostart': 'On', + 'xcache.coveragedump_directory': '""', + }, + }, + 'opts': {}, + 'settings': {}, + } }, - }, - }, grain="os"), - 'fpm': { - 'service': { - 'enabled': True, - 'opts': {}, - }, - 'config': { 'ini': { - 'opts': {}, - 'settings': {}, - }, - 'conf': { - 'opts': {}, - 'settings': {}, - }, - }, - 'pools': { - 'default.conf': { - 'enabled': False, - 'opts': {}, - }, - }, - }, - 'hhvm': { - 'service': { - 'enabled': True, - 'opts': {}, - }, - 'config': { - 'server': { - 'opts': {}, - 'settings': {}, - }, - 'php': { - 'opts': {}, - 'settings': {}, - }, - }, - }, - 'cli': { - 'ini': { - 'opts': {}, - 'settings': {}, - } - }, - 'apache2': { - 'ini': { - 'opts': {}, - 'settings': {}, - } - }, - 'xcache': { - 'ini': { - 'defaults': { - 'xcache-common': { - 'extension': 'xcache.so', - }, - 'xcache.admin': { - 'xcache.admin.enable_auth': 'On', - }, - 'xcache': { - 'xcache.shm_scheme': '"mmap"', - 'xcache.size': '60M', - 'xcache.count': '1', - 'xcache.slots': '8K', - 'xcache.ttl': '0', - 'xcache.gc_interval': '0', - 'xcache.var_size': '4M', - 'xcache.var_count': '1', - 'xcache.var_slots': '8K', - 'xcache.var_ttl': '0', - 'xcache.var_maxttl': '0', - 'xcache.var_gc_interval': '300', - 'xcache.var_namespace_mode': '0', - 'xcache.var_namespace': '""', - 'xcache.readonly_protection': 'Off', - 'xcache.mmap_path': '"/dev/zero"', - 'xcache.coredump_directory': '""', - 'xcache.coredump_type': '0', - 'xcache.disable_on_crash': 'Off', - 'xcache.experimental': 'Off', - 'xcache.cacher': 'On', - 'xcache.stat': 'On', - 'xcache.optimizer': 'Off', - }, - 'xcache.coverager': { - 'xcache.coverager': 'Off', - 'xcache.coverager_autostart': 'On', - 'xcache.coveragedump_directory': '""', + 'defaults': { + 'PHP': { + 'allow_url_fopen': 'On', + 'allow_url_include': 'Off', + 'asp_tags': 'Off', + 'auto_globals_jit': 'On', + 'default_mimetype': '"text/html"', + 'default_socket_timeout': 60, + 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled', + 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror', + 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'], + 'display_errors': 'Off', + 'display_startup_errors': 'Off', + 'enable_dl': 'Off', + 'engine': 'On', + 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'], + 'expose_php': 'On', + 'file_uploads': 'On', + 'html_errors': 'On', + 'ignore_repeated_errors': 'Off', + 'ignore_repeated_source': 'Off', + 'implicit_flush': 'Off', + 'log_errors': 'On', + 'log_errors_max_len': 1024, + 'max_execution_time': 30, + 'max_file_uploads': 20, + 'max_input_nesting_level': 64, + 'max_input_time': 60, + 'max_input_vars': 1000, + 'memory_limit': '128M', + 'output_buffering': 4096, + 'post_max_size': '8M', + 'precision': 14, + 'register_argc_argv': 'Off', + 'report_memleaks': 'On', + 'request_order': 'GP', + 'serialize_precision': 17, + 'short_open_tag': 'Off', + 'track_errors': 'Off', + 'upload_max_filesize': '2M', + 'variables_order': 'GPCS', + 'zend.enable_gc': 'On', + 'zlib.output_compression': 'Off', + }, + 'CLI Server': { + 'cli_server.color': 'On' + }, + 'Date': { + 'date.timezone': 'America/New_York' + }, + 'Pdo_mysql': { + 'pdo_mysql.cache_size': 2000 + }, + 'mail function': { + 'SMTP': 'localhost', + 'mail.add_x_header': 'On' + }, + 'SQL': { + 'sql.safe_mode': 'Off' + }, + 'ODBC': { + 'odbc.allow_persistent': 'On', + 'odbc.check_persistent': 'On', + 'odbc.max_persistent': '-1', + 'odbc.max_links': '-1', + 'odbc.defaultlrl': 4096, + 'odbc.defaultbinmode': 1 + }, + 'Interbase': { + 'ibase.allow_persistent': 1, + 'ibase.max_persistent': -1, + 'ibase.max_links': -1, + 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"', + 'ibase.dateformat': '"%Y-%m-%d"', + 'ibase.timeformat': '"%H:%M:%S"' + }, + 'MySQL': { + 'mysql.allow_local_infile': 'On', + 'mysql.allow_persistent': 'On', + 'mysql.cache_size': '2000', + 'mysql.max_persistent': -1, + 'mysql.max_links': -1, + 'mysql.connect_timeout': 60, + 'mysql.trace_mode': 'Off' + }, + 'MySQLi': { + 'mysqli.max_persistent': -1, + 'mysqli.allow_persistent': 'On', + 'mysqli.max_links': -1, + 'mysqli.cache_size': 2000, + 'mysqli.default_port': 3306, + 'mysqli.reconnect': 'Off' + }, + 'mysqlnd': { + 'mysqlnd.collect_statistics': 'On', + 'mysqlnd.collect_memory_statistics': 'Off' + }, + 'PostgreSQL': { + 'pgsql.allow_persistent': 'On', + 'pgsql.auto_reset_persistent': 'Off', + 'pgsql.max_persistent': -1, + 'pgsql.max_links': -1, + 'pgsql.ignore_notice': 0, + 'pgsql.log_notice': 0 + }, + 'Sybase-CT': { + 'sybct.allow_persistent': 'On', + 'sybct.max_persistent': -1, + 'sybct.max_links': -1, + 'sybct.min_server_severity': 10, + 'sybct.min_client_severity': 10 + }, + 'bcmath': { + 'bcmath.scale': 0 + }, + 'Session': { + 'session.save_handler': 'files', + 'session.use_strict_mode': 0, + 'session.use_cookies': 1, + 'session.use_only_cookies': 1, + 'session.name': 'PHPSESSID', + 'session.auto_start': 0, + 'session.cookie_lifetime': 0, + 'session.cookie_path': '/', + 'session.serialize_handler': 'php', + 'session.gc_probability': 0, + 'session.gc_divisor': 1000, + 'session.gc_maxlifetime': 1440, + 'session.bug_compat_42': 'Off', + 'session.bug_compat_warn': 'Off', + 'session.cache_limiter': 'nocache', + 'session.cache_expire': '180', + 'session.use_trans_sid': 0, + 'session.hash_function': 0, + 'session.hash_bits_per_character': 5, + 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"' + }, + 'MSSQL': { + 'mssql.allow_persistent': 'On', + 'mssql.max_persistent': -1, + 'mssql.max_links': -1, + 'mssql.min_error_severity': 10, + 'mssql.min_message_severity': 10, + 'mssql.compatibility_mode': 'Off', + 'mssql.secure_connection': 'Off' + }, + 'Tidy': { + 'tidy.clean_output': 'Off' + }, + 'soap': { + 'soap.wsdl_cache_enabled': 1, + 'soap.wsdl_cache_dir': '"/tmp"', + 'soap.wsdl_cache_ttl': 86400, + 'soap.wsdl_cache_limit': 5 + }, + 'ldap': { + 'ldap.max_links': -1 + }, }, }, - 'opts': {}, - 'settings': {}, - } - }, - 'ini': { - 'defaults': { - 'PHP': { - 'engine': 'On', - 'short_open_tag': 'Off', - 'asp_tags': 'Off', - 'precision': 14, - 'output_buffering': 4096, - 'zlib.output_compression': 'Off', - 'implicit_flush': 'Off', - 'serialize_precision': 17, - 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled', - 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror', - 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'], - 'zend.enable_gc': 'On', - 'expose_php': 'On', - 'max_execution_time': 30, - 'max_input_time': 60, - 'max_input_nesting_level': 64, - 'max_input_vars': 1000, - 'memory_limit': '128M', - 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'], - 'display_errors': 'Off', - 'display_startup_errors': 'Off', - 'log_errors': 'On', - 'log_errors_max_len': 1024, - 'ignore_repeated_errors': 'Off', - 'ignore_repeated_source': 'Off', - 'report_memleaks': 'On', - 'track_errors': 'Off', - 'html_errors': 'On', - 'variables_order': 'GPCS', - 'request_order': 'GP', - 'register_argc_argv': 'Off', - 'auto_globals_jit': 'On', - 'post_max_size': '8M', - 'default_mimetype': '"text/html"', - 'enable_dl': 'Off', - 'file_uploads': 'On', - 'upload_max_filesize': '2M', - 'max_file_uploads': 20, - 'allow_url_fopen': 'On', - 'allow_url_include': 'Off', - 'default_socket_timeout': 60 + }, merge=True) %} + {%- else %} + {%- set php = salt['pillar.get']('php:ng', { + 'lookup': salt['grains.filter_by']({ + 'Ubuntu': { + 'pkgs': { + 'adodb': 'php5-adodb', + 'apache2': 'libapache2-mod-php5', + 'apc': 'php-apc', + 'apcu': 'php5-apcu', + 'bcmath': 'php5', + 'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev'], + 'cache-lite': 'php-cache-lite', + 'cgi': 'php5-cgi', + 'cli': 'php5-cli', + 'composer_bin': 'composer', + 'console-table': 'php-console-table', + 'curl': 'php5-curl', + 'dev': ['php5-dev','build-essential'], + 'ext_conf_path': salt['grains.filter_by']({ + 'precise': '/etc/php5/conf.d', + 'default': '/etc/php5/mods-available', + }, grain='oscodename'), + 'fpm': 'php5-fpm', + 'gd': 'php5-gd', + 'gearman': 'php5-gearman', + 'geoip': 'php5-geoip', + 'geshi': 'php-geshi', + 'gettext': 'php-gettext', + 'gmp': 'php5-gmp', + 'hhvm': 'hhvm', + 'imagick': 'php5-imagick', + 'imap': 'php5-imap', + 'intl': 'php5-intl', + 'json': 'php5-json', + 'ldap': 'php5-ldap', + 'local_bin': '/usr/local/bin', + 'mbstring': 'php5', + 'mcrypt': 'php5-mcrypt', + 'mdb2': 'php-mdb2', + 'mdb2-driver-mysql': 'php-mdb2-driver-mysql', + 'mdb2-driver-pgsql': 'php-mdb2-driver-pgsql', + 'memcache': 'php5-memcache', + 'memcached': 'php5-memcached', + 'mongodb': salt['grains.filter_by']({ + 'trusty': 'php5-mongo', + 'default': '', + }, grain='oscodename'), + 'mysql': 'php5-mysql', + 'mysqlnd': 'php5-mysqlnd', + 'net4': 'php-net-ipv4', + 'net6': 'php-net-ipv6', + 'oauth': 'php5-oauth', + 'opcache': 'php5', + 'pear': 'php-pear', + 'pgsql': 'php5-pgsql', + 'php': 'php5', + 'phpenmod_command': salt['grains.filter_by']({ + 'precise': 'true', + 'default': 'php5enmod', + }, grain='oscodename'), + 'pspell': 'php5-pspell', + 'redis': 'php5-redis', + 'seclib': 'php-seclib', + 'snmp': 'php5-snmp', + 'soap': 'php-soap', + 'sqlite': 'php5-sqlite', + 'ssh2': 'libssh2-php', + 'suhosin5_ext': 'suhosin.so', + 'suhosin5_repo': 'https://github.com/sektioneins/suhosin', + 'suhosin7_ext': 'suhosin7.so', + 'suhosin7_repo': 'https://github.com/sektioneins/suhosin7', + 'svn': 'php5-svn', + 'tcpdf': 'php-tcpdf', + 'tidy': 'php5-tidy', + 'temp_dir': '/tmp', + 'xcache': 'php5-xcache', + 'xdebug': 'php5-xdebug', + 'xml': 'php5', + 'xsl': 'php5-xsl', + 'zip': 'php5', + }, + 'fpm': { + 'conf': '/etc/php5/fpm/php-fpm.conf', + 'ini': '/etc/php5/fpm/php.ini', + 'pools': '/etc/php5/fpm/pool.d', + 'service': 'php5-fpm', + 'defaults': odict([ + ('global', odict([ + ('pid', '/var/run/php5-fpm.pid'), + ('error_log', '/var/log/php5-fpm.log'), + ])), + ('include', '/etc/php5/fpm/pool.d/*.conf'), + ]), + }, + 'hhvm': { + 'conf': '/etc/hhvm/server.ini', + 'ini': '/etc/hhvm/php.ini', + 'service': 'hhvm', + 'defaults': {}, + 'server': odict([ + ('pid', '/var/run/hhvm/pid'), + ('hhvm.server.port', '9000'), + ('hhvm.server.type', 'fastcgi'), + ('hhvm.server.default_document', 'index.php'), + ('hhvm.log.use_log_file', 'true'), + ('hhvm.log.file', '/var/log/hhvm/error.log'), + ('hhvm.repo.central.path', '/var/run/hhvm/hhvm.hhbc'), + ]), + 'php': odict([ + ('session.save_handler', 'files'), + ('session.save_path', '/var/lib/hhvm/sessions'), + ('session.gc_maxlifetime', '1440'), + ('hhvm.log.level', 'Warning'), + ('hhvm.log.always_log_unhandled_exceptions', 'true'), + ('hhvm.log.runtime_error_reporting_level', '8191'), + ('hhvm.mysql.typed_results', 'false'), + ]), + }, + 'cli': { + 'ini': '/etc/php5/cli/php.ini', + }, + 'apache2': { + 'ini': '/etc/php5/apache2/php.ini', + }, + 'xcache': { + 'ini': '/etc/php5/mods-available/xcache.ini', + 'defaults': {}, + }, + }, + }, grain="os"), + 'fpm': { + 'service': { + 'enabled': True, + 'opts': {}, + }, + 'config': { + 'ini': { + 'opts': {}, + 'settings': {}, + }, + 'conf': { + 'opts': {}, + 'settings': {}, + }, + }, + 'pools': { + 'default.conf': { + 'enabled': False, + 'opts': {}, + }, + }, }, - 'CLI Server': { - 'cli_server.color': 'On' + 'hhvm': { + 'service': { + 'enabled': True, + 'opts': {}, + }, + 'config': { + 'server': { + 'opts': {}, + 'settings': {}, + }, + 'php': { + 'opts': {}, + 'settings': {}, + }, + }, }, - 'Date': { - 'date.timezone': 'America/New_York' + 'cli': { + 'ini': { + 'opts': {}, + 'settings': {}, + } }, - 'Pdo_mysql': { - 'pdo_mysql.cache_size': 2000 + 'apache2': { + 'ini': { + 'opts': {}, + 'settings': {}, + } }, - 'mail function': { - 'SMTP': 'localhost', - 'mail.add_x_header': 'On' + 'xcache': { + 'ini': { + 'defaults': { + 'xcache-common': { + 'extension': 'xcache.so', + }, + 'xcache.admin': { + 'xcache.admin.enable_auth': 'On', + }, + 'xcache': { + 'xcache.shm_scheme': '"mmap"', + 'xcache.size': '60M', + 'xcache.count': '1', + 'xcache.slots': '8K', + 'xcache.ttl': '0', + 'xcache.gc_interval': '0', + 'xcache.var_size': '4M', + 'xcache.var_count': '1', + 'xcache.var_slots': '8K', + 'xcache.var_ttl': '0', + 'xcache.var_maxttl': '0', + 'xcache.var_gc_interval': '300', + 'xcache.var_namespace_mode': '0', + 'xcache.var_namespace': '""', + 'xcache.readonly_protection': 'Off', + 'xcache.mmap_path': '"/dev/zero"', + 'xcache.coredump_directory': '""', + 'xcache.coredump_type': '0', + 'xcache.disable_on_crash': 'Off', + 'xcache.experimental': 'Off', + 'xcache.cacher': 'On', + 'xcache.stat': 'On', + 'xcache.optimizer': 'Off', + }, + 'xcache.coverager': { + 'xcache.coverager': 'Off', + 'xcache.coverager_autostart': 'On', + 'xcache.coveragedump_directory': '""', + }, + }, + 'opts': {}, + 'settings': {}, + } }, - 'SQL': { - 'sql.safe_mode': 'Off' + 'ini': { + 'defaults': { + 'PHP': { + 'allow_url_fopen': 'On', + 'allow_url_include': 'Off', + 'asp_tags': 'Off', + 'auto_globals_jit': 'On', + 'default_mimetype': '"text/html"', + 'default_socket_timeout': 60, + 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled', + 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror', + 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'], + 'display_errors': 'Off', + 'display_startup_errors': 'Off', + 'enable_dl': 'Off', + 'engine': 'On', + 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'], + 'expose_php': 'On', + 'file_uploads': 'On', + 'html_errors': 'On', + 'ignore_repeated_errors': 'Off', + 'ignore_repeated_source': 'Off', + 'implicit_flush': 'Off', + 'log_errors': 'On', + 'log_errors_max_len': 1024, + 'max_execution_time': 30, + 'max_file_uploads': 20, + 'max_input_nesting_level': 64, + 'max_input_time': 60, + 'max_input_vars': 1000, + 'memory_limit': '128M', + 'output_buffering': 4096, + 'post_max_size': '8M', + 'precision': 14, + 'register_argc_argv': 'Off', + 'report_memleaks': 'On', + 'request_order': 'GP', + 'serialize_precision': 17, + 'short_open_tag': 'Off', + 'track_errors': 'Off', + 'upload_max_filesize': '2M', + 'variables_order': 'GPCS', + 'zend.enable_gc': 'On', + 'zlib.output_compression': 'Off', + }, + 'CLI Server': { + 'cli_server.color': 'On' + }, + 'Date': { + 'date.timezone': 'America/New_York' + }, + 'Pdo_mysql': { + 'pdo_mysql.cache_size': 2000 + }, + 'mail function': { + 'SMTP': 'localhost', + 'mail.add_x_header': 'On' + }, + 'SQL': { + 'sql.safe_mode': 'Off' + }, + 'ODBC': { + 'odbc.allow_persistent': 'On', + 'odbc.check_persistent': 'On', + 'odbc.max_persistent': '-1', + 'odbc.max_links': '-1', + 'odbc.defaultlrl': 4096, + 'odbc.defaultbinmode': 1 + }, + 'Interbase': { + 'ibase.allow_persistent': 1, + 'ibase.max_persistent': -1, + 'ibase.max_links': -1, + 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"', + 'ibase.dateformat': '"%Y-%m-%d"', + 'ibase.timeformat': '"%H:%M:%S"' + }, + 'MySQL': { + 'mysql.allow_local_infile': 'On', + 'mysql.allow_persistent': 'On', + 'mysql.cache_size': '2000', + 'mysql.max_persistent': -1, + 'mysql.max_links': -1, + 'mysql.connect_timeout': 60, + 'mysql.trace_mode': 'Off' + }, + 'MySQLi': { + 'mysqli.max_persistent': -1, + 'mysqli.allow_persistent': 'On', + 'mysqli.max_links': -1, + 'mysqli.cache_size': 2000, + 'mysqli.default_port': 3306, + 'mysqli.reconnect': 'Off' + }, + 'mysqlnd': { + 'mysqlnd.collect_statistics': 'On', + 'mysqlnd.collect_memory_statistics': 'Off' + }, + 'PostgreSQL': { + 'pgsql.allow_persistent': 'On', + 'pgsql.auto_reset_persistent': 'Off', + 'pgsql.max_persistent': -1, + 'pgsql.max_links': -1, + 'pgsql.ignore_notice': 0, + 'pgsql.log_notice': 0 + }, + 'Sybase-CT': { + 'sybct.allow_persistent': 'On', + 'sybct.max_persistent': -1, + 'sybct.max_links': -1, + 'sybct.min_server_severity': 10, + 'sybct.min_client_severity': 10 + }, + 'bcmath': { + 'bcmath.scale': 0 + }, + 'Session': { + 'session.save_handler': 'files', + 'session.use_strict_mode': 0, + 'session.use_cookies': 1, + 'session.use_only_cookies': 1, + 'session.name': 'PHPSESSID', + 'session.auto_start': 0, + 'session.cookie_lifetime': 0, + 'session.cookie_path': '/', + 'session.serialize_handler': 'php', + 'session.gc_probability': 0, + 'session.gc_divisor': 1000, + 'session.gc_maxlifetime': 1440, + 'session.bug_compat_42': 'Off', + 'session.bug_compat_warn': 'Off', + 'session.cache_limiter': 'nocache', + 'session.cache_expire': '180', + 'session.use_trans_sid': 0, + 'session.hash_function': 0, + 'session.hash_bits_per_character': 5, + 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"' + }, + 'MSSQL': { + 'mssql.allow_persistent': 'On', + 'mssql.max_persistent': -1, + 'mssql.max_links': -1, + 'mssql.min_error_severity': 10, + 'mssql.min_message_severity': 10, + 'mssql.compatibility_mode': 'Off', + 'mssql.secure_connection': 'Off' + }, + 'Tidy': { + 'tidy.clean_output': 'Off' + }, + 'soap': { + 'soap.wsdl_cache_enabled': 1, + 'soap.wsdl_cache_dir': '"/tmp"', + 'soap.wsdl_cache_ttl': 86400, + 'soap.wsdl_cache_limit': 5 + }, + 'ldap': { + 'ldap.max_links': -1 + }, + }, }, - 'ODBC': { - 'odbc.allow_persistent': 'On', - 'odbc.check_persistent': 'On', - 'odbc.max_persistent': '-1', - 'odbc.max_links': '-1', - 'odbc.defaultlrl': 4096, - 'odbc.defaultbinmode': 1 - }, - 'Interbase': { - 'ibase.allow_persistent': 1, - 'ibase.max_persistent': -1, - 'ibase.max_links': -1, - 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"', - 'ibase.dateformat': '"%Y-%m-%d"', - 'ibase.timeformat': '"%H:%M:%S"' - }, - 'MySQL': { - 'mysql.allow_local_infile': 'On', - 'mysql.allow_persistent': 'On', - 'mysql.cache_size': '2000', - 'mysql.max_persistent': -1, - 'mysql.max_links': -1, - 'mysql.connect_timeout': 60, - 'mysql.trace_mode': 'Off' - }, - 'MySQLi': { - 'mysqli.max_persistent': -1, - 'mysqli.allow_persistent': 'On', - 'mysqli.max_links': -1, - 'mysqli.cache_size': 2000, - 'mysqli.default_port': 3306, - 'mysqli.reconnect': 'Off' - }, - 'mysqlnd': { - 'mysqlnd.collect_statistics': 'On', - 'mysqlnd.collect_memory_statistics': 'Off' - }, - 'PostgreSQL': { - 'pgsql.allow_persistent': 'On', - 'pgsql.auto_reset_persistent': 'Off', - 'pgsql.max_persistent': -1, - 'pgsql.max_links': -1, - 'pgsql.ignore_notice': 0, - 'pgsql.log_notice': 0 - }, - 'Sybase-CT': { - 'sybct.allow_persistent': 'On', - 'sybct.max_persistent': -1, - 'sybct.max_links': -1, - 'sybct.min_server_severity': 10, - 'sybct.min_client_severity': 10 - }, - 'bcmath': { - 'bcmath.scale': 0 - }, - 'Session': { - 'session.save_handler': 'files', - 'session.use_strict_mode': 0, - 'session.use_cookies': 1, - 'session.use_only_cookies': 1, - 'session.name': 'PHPSESSID', - 'session.auto_start': 0, - 'session.cookie_lifetime': 0, - 'session.cookie_path': '/', - 'session.serialize_handler': 'php', - 'session.gc_probability': 0, - 'session.gc_divisor': 1000, - 'session.gc_maxlifetime': 1440, - 'session.bug_compat_42': 'Off', - 'session.bug_compat_warn': 'Off', - 'session.cache_limiter': 'nocache', - 'session.cache_expire': '180', - 'session.use_trans_sid': 0, - 'session.hash_function': 0, - 'session.hash_bits_per_character': 5, - 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"' - }, - 'MSSQL': { - 'mssql.allow_persistent': 'On', - 'mssql.max_persistent': -1, - 'mssql.max_links': -1, - 'mssql.min_error_severity': 10, - 'mssql.min_message_severity': 10, - 'mssql.compatibility_mode': 'Off', - 'mssql.secure_connection': 'Off' - }, - 'Tidy': { - 'tidy.clean_output': 'Off' - }, - 'soap': { - 'soap.wsdl_cache_enabled': 1, - 'soap.wsdl_cache_dir': '"/tmp"', - 'soap.wsdl_cache_ttl': 86400, - 'soap.wsdl_cache_limit': 5 - }, - 'ldap': { - 'ldap.max_links': -1 - }, - }, - }, - }, merge=True) %} - - {% else %} - - {% set php = salt['pillar.get']('php:ng', { + }, merge=True) %} + {%- endif %} + {%- endif %} +{%- else %} + {%- set php = salt['pillar.get']('php:ng', { 'lookup': salt['grains.filter_by']({ - 'Ubuntu': { + 'Debian': { 'pkgs': { - 'php': 'php5', + 'adodb': 'php5-adodb', + 'apache2': 'libapache2-mod-php5', 'apc': 'php-apc', 'apcu': 'php5-apcu', + 'bcmath': 'php5', + 'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev'], 'cache-lite': 'php-cache-lite', - 'console-table': 'php-console-table', 'cgi': 'php5-cgi', 'cli': 'php5-cli', - 'dev': ['php5-dev','build-essential'], - 'oauth': 'php5-oauth', - 'apache2': 'libapache2-mod-php5', + 'console-table': 'php-console-table', + 'composer_bin': 'composer', 'curl': 'php5-curl', - 'gearman': 'php5-gearman', - 'gettext': 'php-gettext', - 'geshi': 'php-geshi', - 'ffmpeg': ['php5-ffmpeg', 'ffmpeg'], + 'dev': ['php5-dev','build-essential'], + 'ext_conf_path': '/etc/php5/mods-available', 'fpm': 'php5-fpm', - 'hhvm': 'hhvm', 'gd': 'php5-gd', - 'gmp': 'php5-gmp', + 'gearman': 'php5-gearman', 'geoip': 'php5-geoip', + 'geshi': 'php-geshi', + 'gettext': 'php-gettext', + 'gmp': 'php5-gmp', + 'hhvm': 'hhvm', + 'imagick': 'php5-imagick', + 'imap': 'php5-imap', 'intl': 'php5-intl', + 'json': 'php5-json', + 'ldap': 'php5-ldap', + 'local_bin': '/usr/local/bin', 'mbstring': 'php5', 'mcrypt': 'php5-mcrypt', + 'mdb2': 'php-mdb2', + 'mdb2-driver-mysql': 'php-mdb2-driver-mysql', + 'mdb2-driver-pgsql': 'php-mdb2-driver-pgsql', 'memcache': 'php5-memcache', 'memcached': 'php5-memcached', 'mysql': 'php5-mysql', 'mysqlnd': 'php5-mysqlnd', - 'mdb2': 'php-mdb2', - 'mdb2-driver-mysql': 'php-mdb2-driver-mysql', - 'mdb2-driver-pgsql': 'php-mdb2-driver-pgsql', + 'net4': 'php-net-ipv4', + 'net6': 'php-net-ipv6', + 'oauth': 'php5-oauth', + 'opcache': 'php5', 'pear': 'php-pear', + 'pgsql': 'php5-pgsql', + 'php': 'php5', + 'phpenmod_command': 'php5enmod', 'pspell': 'php5-pspell', + 'redis': 'php5-redis', + 'seclib': 'php-seclib', 'snmp': 'php5-snmp', 'soap': 'php-soap', - 'seclib': 'php-seclib', - 'ssh2': 'php5-ssh2', 'sqlite': 'php5-sqlite', + 'ssh2': 'php5-ssh2', + 'suhosin5_ext': 'suhosin.so', + 'suhosin5_repo': 'https://github.com/sektioneins/suhosin', + 'suhosin7_ext': 'suhosin7.so', + 'suhosin7_repo': 'https://github.com/sektioneins/suhosin7', 'svn': 'php5-svn', - 'tidy': 'php5-tidy', 'tcpdf': 'php-tcpdf', - 'twig': 'php5-twig', + 'temp_dir': '/tmp', + 'tidy': 'php5-tidy', 'xcache': 'php5-xcache', 'xdebug': 'php5-xdebug', - 'xsl': 'php5-xsl', 'xml': 'php5', + 'xsl': 'php5-xsl', 'zip': 'php5', - 'redis': 'php5-redis', - 'imagick': 'php5-imagick', - 'suhosin': 'php5-suhosin', - 'imap': 'php5-imap', - 'adodb': 'php5-adodb', - 'pgsql': 'php5-pgsql', - 'ldap': 'php5-ldap', - 'json': 'php5-json', - 'net4': 'php-net-ipv4', - 'net6': 'php-net-ipv6' }, 'fpm': { 'conf': '/etc/php5/fpm/php-fpm.conf', @@ -734,16 +1495,16 @@ ('hhvm.log.use_log_file', 'true'), ('hhvm.log.file', '/var/log/hhvm/error.log'), ('hhvm.repo.central.path', '/var/run/hhvm/hhvm.hhbc'), - ]), + ]), 'php': odict([ - ('session.save_handler', 'files'), - ('session.save_path', '/var/lib/hhvm/sessions'), - ('session.gc_maxlifetime', '1440'), - ('hhvm.log.level', 'Warning'), - ('hhvm.log.always_log_unhandled_exceptions', 'true'), - ('hhvm.log.runtime_error_reporting_level', '8191'), - ('hhvm.mysql.typed_results', 'false'), - ]), + ('session.save_handler', 'files'), + ('session.save_path', '/var/lib/hhvm/sessions'), + ('session.gc_maxlifetime', '1440'), + ('hhvm.log.level', 'Warning'), + ('hhvm.log.always_log_unhandled_exceptions', 'true'), + ('hhvm.log.runtime_error_reporting_level', '8191'), + ('hhvm.mysql.typed_results', 'false'), + ]), }, 'cli': { 'ini': '/etc/php5/cli/php.ini', @@ -756,7 +1517,177 @@ 'defaults': {}, }, }, - }, grain="os"), + 'RedHat': { + 'pkgs': { + 'adodb': 'php-adodb', + 'apc': 'php-pecl-apc', + 'apcu': 'php-pecl-apcu', + 'bcmath': 'php-bcmath', + 'build_pkgs': ['openssl-devel', 'gcc'], + 'cache-lite': 'php-pear-Cache-Lite', + 'cgi': 'php-cgi', + 'cli': 'php-cli', + 'composer': 'composer', + 'composer_bin': 'composer', + 'console-table': 'php-pear-Console-Table', + 'curl': ['php-common', 'curl'], + 'dev': 'php-devel', + 'ext_conf_path': '/etc/php.d', + 'fpm': 'php-fpm', + 'gd': 'php-gd', + 'geoip': 'php-pecl-geoip', + 'geshi': 'php-geshi', + 'gettext': 'php-php-gettext', + 'imagick': 'php-pecl-imagick', + 'imap': 'php-imap', + 'intl': 'php-intl', + 'json': 'php-common', + 'ldap': 'php-ldap', + 'local_bin': '/usr/local/bin', + 'mbstring': 'php-mbstring', + 'mcrypt': 'php-mcrypt', + 'memcache': 'php-pecl-memcache', + 'memcached': 'php-pecl-memcached', + 'mysql': 'php-mysql', + 'mysqlnd': 'php-mysqlnd', + 'net4': 'php-pear-Net-IPv4', + 'oauth': 'php-pecl-oauth', + 'opcache': 'php-pecl-zendopcache', + 'pear': 'php-pear', + 'pgsql': 'php-pgsql', + 'php': 'php', + 'pspell': 'php-pspell', + 'redis': 'php-pecl-redis', + 'seclib': 'php-phpseclib', + 'snmp': 'php-snmp', + 'soap': 'php-soap', + 'sqlite': 'php-pdo', + 'ssh2': 'php-pecl-ssh2', + 'suhosin5_ext': 'suhosin.so', + 'suhosin5_repo': 'https://github.com/sektioneins/suhosin', + 'suhosin7_ext': 'suhosin7.so', + 'suhosin7_repo': 'https://github.com/sektioneins/suhosin7', + 'tcpdf': 'php-tcpdf', + 'temp_dir': '/tmp', + 'tidy': 'php-tidy', + 'xcache': 'php-xcache', + 'xdebug': 'php-pecl-xdebug', + 'xml': 'php-xml', + 'xsl': 'php-xml', + 'zip': 'php', + }, + 'fpm': { + 'conf': '/etc/php-fpm.conf', + 'ini': '/etc/php.ini', + 'pools': '/etc/php-fpm.d', + 'service': 'php-fpm', + 'defaults': { + 'global': { + 'pid': '/var/run/php-fpm/php-fpm.pid', + 'error_log': '/var/log/php-fpm/error.log', + }, + 'include': '/etc/php-fpm.d/*.conf', + }, + }, + 'cli': { + 'ini': '/etc/php.ini', + }, + 'xcache': { + 'ini': '/etc/php.d/xcache.ini', + }, + }, + 'Suse': { + 'pkgs': { + 'adodb': 'php5-dba', + 'apache2': 'apache2-mod_php5', + 'cli': 'php5', + 'curl': 'php5-curl', + 'fpm': 'php5-fpm', + 'gd': 'php5-gd', + 'imap': 'php5-imap', + 'intl': 'php5-intl', + 'json': 'php5-json', + 'ldap': 'php5-ldap', + 'mbstring': 'php5-mbstring', + 'mcrypt': 'php5-mcrypt', + 'mysql': 'php5-mysql', + 'oauth': 'php5-oauth', + 'pear': 'php5-pear', + 'pgsql': 'php5-pgsql', + 'php': 'php5', + 'snmp': 'php5-snmp', + 'soap': 'php5-soap', + 'sqlite': 'php5-sqlite', + 'suhosin': 'php5-suhosin', + 'xml': ['php5-xmlreader','php5-xmlwriter','php5-xmlrpc'], + 'zip': 'php5-zip', + }, + 'fpm': { + 'conf': '/etc/php-fpm.conf', + 'ini': '/etc/php.ini', + 'pools': '/etc/php-fpm.d', + 'service': 'php-fpm', + 'defaults': { + 'global': { + 'pid': '/var/run/php-fpm/php-fpm.pid', + 'error_log': '/var/log/php-fpm/error.log', + }, + 'include': '/etc/php-fpm.d/*.conf', + }, + }, + 'cli': { + 'ini': '/etc/php.ini', + }, + }, + 'Arch': { + 'pkgs': { + 'apc': 'php-apcu', + 'apcu': 'php-apcu-bc', + 'cgi': 'php-cgi', + 'cli': 'php', + 'composer_bin': 'composer', + 'curl': 'curl', + 'fpm': 'php-fpm', + 'gd': 'php-gd', + 'geoip': 'php-geoip', + 'imap': 'php-imap', + 'intl': 'php-intl', + 'local_bin': '/usr/local/bin', + 'mcrypt': 'php-mcrypt', + 'memcache': 'php-memcache', + 'memcached': 'php-memcached', + 'pgsql': 'php-pgsql', + 'php': 'php', + 'pspell': 'php-pspell', + 'snmp': 'php-snmp', + 'sqlite': 'php-sqlite', + 'temp_dir': '/tmp', + 'tidy': 'php-tidy', + 'xcache': 'php-xcache', + 'xdebug': 'xdebug', + 'xsl': 'php-xsl', + }, + 'fpm': { + 'conf': '/etc/php/php-fpm.conf', + 'ini': '/etc/php/php.ini', + 'pools': '/etc/php/fpm.d', + 'service': 'php-fpm', + 'defaults': { + 'global': { + 'pid': '/run/php-fpm/php-fpm.pid', + 'error_log': 'log/php-fpm.log', + }, + 'include': '/etc/php/fpm.d/*.conf', + }, + }, + 'cli': { + 'ini': '/etc/php/php-cli.ini', + }, + 'xcache': { + 'ini': '/etc/php/conf.d/xcache.ini', + }, + }, + }), 'fpm': { 'service': { 'enabled': True, @@ -764,27 +1695,27 @@ }, 'config': { 'ini': { - 'opts': {}, - 'settings': {}, + 'opts': {}, + 'settings': {}, }, 'conf': { - 'opts': {}, - 'settings': {}, + 'opts': {}, + 'settings': {}, }, }, 'pools': { - 'default.conf': { - 'enabled': False, - 'opts': {}, - }, + 'default.conf': { + 'enabled': False, + 'opts': {}, + }, }, }, 'hhvm': { 'service': { 'enabled': True, 'opts': {}, - }, - 'config': { + }, + 'config': { 'server': { 'opts': {}, 'settings': {}, @@ -811,40 +1742,40 @@ 'ini': { 'defaults': { 'xcache-common': { - 'extension': 'xcache.so', + 'extension': 'xcache.so', }, 'xcache.admin': { - 'xcache.admin.enable_auth': 'On', + 'xcache.admin.enable_auth': 'On', }, 'xcache': { - 'xcache.shm_scheme': '"mmap"', - 'xcache.size': '60M', - 'xcache.count': '1', - 'xcache.slots': '8K', - 'xcache.ttl': '0', - 'xcache.gc_interval': '0', - 'xcache.var_size': '4M', - 'xcache.var_count': '1', - 'xcache.var_slots': '8K', - 'xcache.var_ttl': '0', - 'xcache.var_maxttl': '0', - 'xcache.var_gc_interval': '300', - 'xcache.var_namespace_mode': '0', - 'xcache.var_namespace': '""', - 'xcache.readonly_protection': 'Off', - 'xcache.mmap_path': '"/dev/zero"', - 'xcache.coredump_directory': '""', - 'xcache.coredump_type': '0', - 'xcache.disable_on_crash': 'Off', - 'xcache.experimental': 'Off', - 'xcache.cacher': 'On', - 'xcache.stat': 'On', - 'xcache.optimizer': 'Off', + 'xcache.shm_scheme': '"mmap"', + 'xcache.size': '60M', + 'xcache.count': '1', + 'xcache.slots': '8K', + 'xcache.ttl': '0', + 'xcache.gc_interval': '0', + 'xcache.var_size': '4M', + 'xcache.var_count': '1', + 'xcache.var_slots': '8K', + 'xcache.var_ttl': '0', + 'xcache.var_maxttl': '0', + 'xcache.var_gc_interval': '300', + 'xcache.var_namespace_mode': '0', + 'xcache.var_namespace': '""', + 'xcache.readonly_protection': 'Off', + 'xcache.mmap_path': '"/dev/zero"', + 'xcache.coredump_directory': '""', + 'xcache.coredump_type': '0', + 'xcache.disable_on_crash': 'Off', + 'xcache.experimental': 'Off', + 'xcache.cacher': 'On', + 'xcache.stat': 'On', + 'xcache.optimizer': 'Off', }, 'xcache.coverager': { - 'xcache.coverager': 'Off', - 'xcache.coverager_autostart': 'On', - 'xcache.coveragedump_directory': '""', + 'xcache.coverager': 'Off', + 'xcache.coverager_autostart': 'On', + 'xcache.coveragedump_directory': '""', }, }, 'opts': {}, @@ -854,47 +1785,47 @@ 'ini': { 'defaults': { 'PHP': { - 'engine': 'On', - 'short_open_tag': 'Off', + 'engine': 'On', + 'allow_url_fopen': 'On', + 'allow_url_include': 'Off', 'asp_tags': 'Off', - 'precision': 14, - 'output_buffering': 4096, - 'zlib.output_compression': 'Off', - 'implicit_flush': 'Off', - 'serialize_precision': 17, + 'auto_globals_jit': 'On', + 'default_mimetype': '"text/html"', + 'default_socket_timeout': 60, 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled', 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror', 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'], - 'zend.enable_gc': 'On', - 'expose_php': 'On', - 'max_execution_time': 30, - 'max_input_time': 60, - 'max_input_nesting_level': 64, - 'max_input_vars': 1000, - 'memory_limit': '128M', - 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'], 'display_errors': 'Off', 'display_startup_errors': 'Off', - 'log_errors': 'On', - 'log_errors_max_len': 1024, + 'enable_dl': 'Off', + 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'], + 'expose_php': 'On', + 'file_uploads': 'On', + 'html_errors': 'On', 'ignore_repeated_errors': 'Off', 'ignore_repeated_source': 'Off', - 'report_memleaks': 'On', - 'track_errors': 'Off', - 'html_errors': 'On', - 'variables_order': 'GPCS', - 'request_order': 'GP', - 'register_argc_argv': 'Off', - 'auto_globals_jit': 'On', - 'post_max_size': '8M', - 'default_mimetype': '"text/html"', - 'enable_dl': 'Off', - 'file_uploads': 'On', - 'upload_max_filesize': '2M', + 'implicit_flush': 'Off', + 'log_errors': 'On', + 'log_errors_max_len': 1024, + 'max_execution_time': 30, 'max_file_uploads': 20, - 'allow_url_fopen': 'On', - 'allow_url_include': 'Off', - 'default_socket_timeout': 60 + 'max_input_nesting_level': 64, + 'max_input_time': 60, + 'max_input_vars': 1000, + 'memory_limit': '128M', + 'output_buffering': 4096, + 'post_max_size': '8M', + 'precision': 14, + 'register_argc_argv': 'Off', + 'report_memleaks': 'On', + 'request_order': 'GP', + 'serialize_precision': 17, + 'short_open_tag': 'Off', + 'track_errors': 'Off', + 'upload_max_filesize': '2M', + 'variables_order': 'GPCS', + 'zend.enable_gc': 'On', + 'zlib.output_compression': 'Off', }, 'CLI Server': { 'cli_server.color': 'On' @@ -1012,519 +1943,5 @@ }, }, }, - }, merge=True) %} - - {% endif %} - {% else %} - - {% set php = salt['pillar.get']('php:ng', { - 'lookup': salt['grains.filter_by']({ - 'Debian': { - 'pkgs': { - 'php': 'php5', - 'apc': 'php-apc', - 'apcu': 'php5-apcu', - 'cgi': 'php5-cgi', - 'cli': 'php5-cli', - 'cache-lite': 'php-cache-lite', - 'console-table': 'php-console-table', - 'dev': ['php5-dev','build-essential'], - 'oauth': 'php5-oauth', - 'apache2': 'libapache2-mod-php5', - 'curl': 'php5-curl', - 'gearman': 'php5-gearman', - 'fpm': 'php5-fpm', - 'ffmpeg': ['php5-ffmpeg', 'ffmpeg'], - 'hhvm': 'hhvm', - 'gd': 'php5-gd', - 'gmp': 'php5-gmp', - 'geoip': 'php5-geoip', - 'gettext': 'php-gettext', - 'geshi': 'php-geshi', - 'intl': 'php5-intl', - 'mbstring': 'php5', - 'mcrypt': 'php5-mcrypt', - 'memcache': 'php5-memcache', - 'memcached': 'php5-memcached', - 'mongo': 'php5-mongo', - 'mysql': 'php5-mysql', - 'mysqlnd': 'php5-mysqlnd', - 'mdb2': 'php-mdb2', - 'mdb2-driver-mysql': 'php-mdb2-driver-mysql', - 'mdb2-driver-pgsql': 'php-mdb2-driver-pgsql', - 'pear': 'php-pear', - 'pspell': 'php5-pspell', - 'snmp': 'php5-snmp', - 'seclib': 'php-seclib', - 'soap': 'php-soap', - 'ssh2': 'php5-ssh2', - 'sqlite': 'php5-sqlite', - 'svn': 'php5-svn', - 'tidy': 'php5-tidy', - 'tcpdf': 'php5-tcpdf', - 'twig': 'php5-twig', - 'xcache': 'php5-xcache', - 'xdebug': 'php5-xdebug', - 'xsl': 'php5-xsl', - 'xml': 'php5', - 'zip': 'php5', - 'redis': 'php5-redis', - 'imagick': 'php5-imagick', - 'suhosin': 'php5-suhosin', - 'imap': 'php5-imap', - 'adodb': 'php5-adodb', - 'pgsql': 'php5-pgsql', - 'ldap': 'php5-ldap', - 'json': 'php5-json', - 'net4': 'php-net-ipv4', - 'net6': 'php-net-ipv6' - }, - 'fpm': { - 'conf': '/etc/php5/fpm/php-fpm.conf', - 'ini': '/etc/php5/fpm/php.ini', - 'pools': '/etc/php5/fpm/pool.d', - 'service': 'php5-fpm', - 'defaults': odict([ - ('global', odict([ - ('pid', '/var/run/php5-fpm.pid'), - ('error_log', '/var/log/php5-fpm.log'), - ])), - ('include', '/etc/php5/fpm/pool.d/*.conf'), - ]), - }, - 'hhvm': { - 'conf': '/etc/hhvm/server.ini', - 'ini': '/etc/hhvm/php.ini', - 'service': 'hhvm', - 'defaults': {}, - 'server': odict([ - ('pid', '/var/run/hhvm/pid'), - ('hhvm.server.port', '9000'), - ('hhvm.server.type', 'fastcgi'), - ('hhvm.server.default_document', 'index.php'), - ('hhvm.log.use_log_file', 'true'), - ('hhvm.log.file', '/var/log/hhvm/error.log'), - ('hhvm.repo.central.path', '/var/run/hhvm/hhvm.hhbc'), - ]), - 'php': odict([ - ('session.save_handler', 'files'), - ('session.save_path', '/var/lib/hhvm/sessions'), - ('session.gc_maxlifetime', '1440'), - ('hhvm.log.level', 'Warning'), - ('hhvm.log.always_log_unhandled_exceptions', 'true'), - ('hhvm.log.runtime_error_reporting_level', '8191'), - ('hhvm.mysql.typed_results', 'false'), - ]), - }, - 'cli': { - 'ini': '/etc/php5/cli/php.ini', - }, - 'apache2': { - 'ini': '/etc/php5/apache2/php.ini', - }, - 'xcache': { - 'ini': '/etc/php5/mods-available/xcache.ini', - 'defaults': {}, - }, - }, - 'RedHat': { - 'pkgs': { - 'php': 'php', - 'apc': 'php-pecl-apc', - 'apcu': 'php-pecl-apcu', - 'cgi': 'php-cgi', - 'cli': 'php-cli', - 'composer': 'composer', - 'oauth': 'php-oauth', - 'curl': ['php-common', 'curl'], - 'fpm': 'php-fpm', - 'gd': 'php-gd', - 'intl': 'php-intl', - 'mbstring': 'php-mbstring', - 'mcrypt': 'php-mcrypt', - 'memcache': 'php-pecl-memcache', - 'memcached': 'php-pecl-memcached', - 'opcache': 'php-pecl-zendopcache', - 'mysql': 'php-mysql', - 'mysqlnd': 'php-mysqlnd', - 'pear': 'php-pear', - 'snmp': 'php-snmp', - 'soap': 'php-soap', - 'sqlite': 'php5-sqlite', - 'xcache': 'php-xcache', - 'xdebug': 'php-pecl-xdebug', - 'xml': 'php-xml', - 'zip': 'php', - 'redis': 'php-redis', - 'imagick': 'php-imagick', - 'suhosin': 'php-suhosin', - 'imap': 'php-imap', - 'adodb': 'php-adodb', - 'pgsql': 'php-pgsql', - 'ldap': 'php-ldap', - 'json': 'php-common', - }, - 'fpm': { - 'conf': '/etc/php-fpm.conf', - 'ini': '/etc/php.ini', - 'pools': '/etc/php-fpm.d', - 'service': 'php-fpm', - 'defaults': { - 'global': { - 'pid': '/var/run/php-fpm/php-fpm.pid', - 'error_log': '/var/log/php-fpm/error.log', - }, - 'include': '/etc/php-fpm.d/*.conf', - }, - }, - 'cli': { - 'ini': '/etc/php.ini', - }, - 'xcache': { - 'ini': '/etc/php.d/xcache.ini', - }, - }, - 'Suse': { - 'pkgs': { - 'php': 'php5', - 'apache2': 'apache2-mod_php5', - 'cli': 'php5', - 'oauth': 'php5-oauth', - 'curl': 'php5-curl', - 'fpm': 'php5-fpm', - 'gd': 'php5-gd', - 'intl': 'php5-intl', - 'mbstring': 'php5-mbstring', - 'mcrypt': 'php5-mcrypt', - 'mysql': 'php5-mysql', - 'pear': 'php5-pear', - 'snmp': 'php5-snmp', - 'soap': 'php5-soap', - 'sqlite': 'php5-sqlite', - 'xml': ['php5-xmlreader','php5-xmlwriter','php5-xmlrpc'], - 'zip': 'php5-zip', - 'suhosin': 'php5-suhosin', - 'imap': 'php5-imap', - 'adodb': 'php5-dba', - 'pgsql': 'php5-pgsql', - 'ldap': 'php5-ldap', - 'json': 'php5-json', - }, - 'fpm': { - 'conf': '/etc/php-fpm.conf', - 'ini': '/etc/php.ini', - 'pools': '/etc/php-fpm.d', - 'service': 'php-fpm', - 'defaults': { - 'global': { - 'pid': '/var/run/php-fpm/php-fpm.pid', - 'error_log': '/var/log/php-fpm/error.log', - }, - 'include': '/etc/php-fpm.d/*.conf', - }, - }, - 'cli': { - 'ini': '/etc/php.ini', - }, - }, - 'Arch': { - 'pkgs': { - 'php': 'php', - 'cli': 'php', - 'apcu': 'php-apcu', - 'cgi': 'php-cgi', - 'curl': 'curl', - 'fpm': 'php-fpm', - 'gd': 'php-gd', - 'geoip': 'php-geoip', - 'intl': 'php-intl', - 'mcrypt': 'php-mcrypt', - 'memcache': 'php-memcache', - 'memcached': 'php-memcached', - 'pear': 'php-pear', - 'snmp': 'php-snmp', - 'sqlite': 'php-sqlite', - 'xcache': 'php-xcache', - 'pgsql': 'php-pgsql', - 'ldap': 'php-ldap', - 'tidy': 'php-tidy', - }, - 'fpm': { - 'conf': '/etc/php/php-fpm.conf', - 'ini': '/etc/php/php.ini', - 'pools': '/etc/php/fpm.d', - 'service': 'php-fpm', - 'defaults': { - 'global': { - 'pid': '/run/php-fpm/php-fpm.pid', - 'error_log': 'log/php-fpm.log', - }, - 'include': '/etc/php/fpm.d/*.conf', - }, - }, - 'cli': { - 'ini': '/etc/php/php-cli.ini', - }, - 'xcache': { - 'ini': '/etc/php/conf.d/xcache.ini', - }, - }, - }), - 'fpm': { - 'service': { - 'enabled': True, - 'opts': {}, - }, - 'config': { - 'ini': { - 'opts': {}, - 'settings': {}, - }, - 'conf': { - 'opts': {}, - 'settings': {}, - }, - }, - 'pools': { - 'default.conf': { - 'enabled': False, - 'opts': {}, - }, - }, - }, - 'hhvm': { - 'service': { - 'enabled': True, - 'opts': {}, - }, - 'config': { - 'server': { - 'opts': {}, - 'settings': {}, - }, - 'php': { - 'opts': {}, - 'settings': {}, - }, - }, - }, - 'cli': { - 'ini': { - 'opts': {}, - 'settings': {}, - } - }, - 'apache2': { - 'ini': { - 'opts': {}, - 'settings': {}, - } - }, - 'xcache': { - 'ini': { - 'defaults': { - 'xcache-common': { - 'extension': 'xcache.so', - }, - 'xcache.admin': { - 'xcache.admin.enable_auth': 'On', - }, - 'xcache': { - 'xcache.shm_scheme': '"mmap"', - 'xcache.size': '60M', - 'xcache.count': '1', - 'xcache.slots': '8K', - 'xcache.ttl': '0', - 'xcache.gc_interval': '0', - 'xcache.var_size': '4M', - 'xcache.var_count': '1', - 'xcache.var_slots': '8K', - 'xcache.var_ttl': '0', - 'xcache.var_maxttl': '0', - 'xcache.var_gc_interval': '300', - 'xcache.var_namespace_mode': '0', - 'xcache.var_namespace': '""', - 'xcache.readonly_protection': 'Off', - 'xcache.mmap_path': '"/dev/zero"', - 'xcache.coredump_directory': '""', - 'xcache.coredump_type': '0', - 'xcache.disable_on_crash': 'Off', - 'xcache.experimental': 'Off', - 'xcache.cacher': 'On', - 'xcache.stat': 'On', - 'xcache.optimizer': 'Off', - }, - 'xcache.coverager': { - 'xcache.coverager': 'Off', - 'xcache.coverager_autostart': 'On', - 'xcache.coveragedump_directory': '""', - }, - }, - 'opts': {}, - 'settings': {}, - } - }, - 'ini': { - 'defaults': { - 'PHP': { - 'engine': 'On', - 'short_open_tag': 'Off', - 'asp_tags': 'Off', - 'precision': 14, - 'output_buffering': 4096, - 'zlib.output_compression': 'Off', - 'implicit_flush': 'Off', - 'serialize_precision': 17, - 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled', - 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror', - 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'], - 'zend.enable_gc': 'On', - 'expose_php': 'On', - 'max_execution_time': 30, - 'max_input_time': 60, - 'max_input_nesting_level': 64, - 'max_input_vars': 1000, - 'memory_limit': '128M', - 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'], - 'display_errors': 'Off', - 'display_startup_errors': 'Off', - 'log_errors': 'On', - 'log_errors_max_len': 1024, - 'ignore_repeated_errors': 'Off', - 'ignore_repeated_source': 'Off', - 'report_memleaks': 'On', - 'track_errors': 'Off', - 'html_errors': 'On', - 'variables_order': 'GPCS', - 'request_order': 'GP', - 'register_argc_argv': 'Off', - 'auto_globals_jit': 'On', - 'post_max_size': '8M', - 'default_mimetype': '"text/html"', - 'enable_dl': 'Off', - 'file_uploads': 'On', - 'upload_max_filesize': '2M', - 'max_file_uploads': 20, - 'allow_url_fopen': 'On', - 'allow_url_include': 'Off', - 'default_socket_timeout': 60 - }, - 'CLI Server': { - 'cli_server.color': 'On' - }, - 'Date': { - 'date.timezone': 'America/New_York' - }, - 'Pdo_mysql': { - 'pdo_mysql.cache_size': 2000 - }, - 'mail function': { - 'SMTP': 'localhost', - 'mail.add_x_header': 'On' - }, - 'SQL': { - 'sql.safe_mode': 'Off' - }, - 'ODBC': { - 'odbc.allow_persistent': 'On', - 'odbc.check_persistent': 'On', - 'odbc.max_persistent': '-1', - 'odbc.max_links': '-1', - 'odbc.defaultlrl': 4096, - 'odbc.defaultbinmode': 1 - }, - 'Interbase': { - 'ibase.allow_persistent': 1, - 'ibase.max_persistent': -1, - 'ibase.max_links': -1, - 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"', - 'ibase.dateformat': '"%Y-%m-%d"', - 'ibase.timeformat': '"%H:%M:%S"' - }, - 'MySQL': { - 'mysql.allow_local_infile': 'On', - 'mysql.allow_persistent': 'On', - 'mysql.cache_size': '2000', - 'mysql.max_persistent': -1, - 'mysql.max_links': -1, - 'mysql.connect_timeout': 60, - 'mysql.trace_mode': 'Off' - }, - 'MySQLi': { - 'mysqli.max_persistent': -1, - 'mysqli.allow_persistent': 'On', - 'mysqli.max_links': -1, - 'mysqli.cache_size': 2000, - 'mysqli.default_port': 3306, - 'mysqli.reconnect': 'Off' - }, - 'mysqlnd': { - 'mysqlnd.collect_statistics': 'On', - 'mysqlnd.collect_memory_statistics': 'Off' - }, - 'PostgreSQL': { - 'pgsql.allow_persistent': 'On', - 'pgsql.auto_reset_persistent': 'Off', - 'pgsql.max_persistent': -1, - 'pgsql.max_links': -1, - 'pgsql.ignore_notice': 0, - 'pgsql.log_notice': 0 - }, - 'Sybase-CT': { - 'sybct.allow_persistent': 'On', - 'sybct.max_persistent': -1, - 'sybct.max_links': -1, - 'sybct.min_server_severity': 10, - 'sybct.min_client_severity': 10 - }, - 'bcmath': { - 'bcmath.scale': 0 - }, - 'Session': { - 'session.save_handler': 'files', - 'session.use_strict_mode': 0, - 'session.use_cookies': 1, - 'session.use_only_cookies': 1, - 'session.name': 'PHPSESSID', - 'session.auto_start': 0, - 'session.cookie_lifetime': 0, - 'session.cookie_path': '/', - 'session.serialize_handler': 'php', - 'session.gc_probability': 0, - 'session.gc_divisor': 1000, - 'session.gc_maxlifetime': 1440, - 'session.bug_compat_42': 'Off', - 'session.bug_compat_warn': 'Off', - 'session.cache_limiter': 'nocache', - 'session.cache_expire': '180', - 'session.use_trans_sid': 0, - 'session.hash_function': 0, - 'session.hash_bits_per_character': 5, - 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"' - }, - 'MSSQL': { - 'mssql.allow_persistent': 'On', - 'mssql.max_persistent': -1, - 'mssql.max_links': -1, - 'mssql.min_error_severity': 10, - 'mssql.min_message_severity': 10, - 'mssql.compatibility_mode': 'Off', - 'mssql.secure_connection': 'Off' - }, - 'Tidy': { - 'tidy.clean_output': 'Off' - }, - 'soap': { - 'soap.wsdl_cache_enabled': 1, - 'soap.wsdl_cache_dir': '"/tmp"', - 'soap.wsdl_cache_ttl': 86400, - 'soap.wsdl_cache_limit': 5 - }, - 'ldap': { - 'ldap.max_links': -1 - }, - }, - }, }, merge=True) %} - {% endif %} -{% endif %} +{%- endif %} \ No newline at end of file diff --git a/php/ng/net6.sls b/php/ng/net6.sls index 0227250..78332f3 100644 --- a/php/ng/net6.sls +++ b/php/ng/net6.sls @@ -1,2 +1,9 @@ -{% set state = 'net6' %} -{% include "php/ng/installed.jinja" %} +{% if salt['grains.get']('os_family') == "RedHat" %} +{# + Installation of this PEAR module can be done by running + `pear install Net_IPv6` on RedHat based distros +#} +{% else %} + {% set state = 'net6' %} + {% include "php/ng/installed.jinja" %} +{% endif %} \ No newline at end of file diff --git a/php/ng/suhosin.sls b/php/ng/suhosin.sls index 9099199..903a335 100644 --- a/php/ng/suhosin.sls +++ b/php/ng/suhosin.sls @@ -1,2 +1,89 @@ -{% set state = 'suhosin' %} -{% include "php/ng/installed.jinja" %} +{% from "php/ng/map.jinja" import php with context %} + +include: + - php.ng + - php.ng.dev + +{% set phpng_version = salt['pillar.get']('php:ng:version', '7.0')|string %} + +{% if salt['grains.get']('os') == "Ubuntu" %} + {% if phpng_version >= '7.0' %} + {% set suhosin_ext = php.lookup.pkgs.suhosin7_ext %} + {% set suhosin_name = 'suhosin7' %} + {% set suhosin_repo = php.lookup.pkgs.suhosin7_repo %} + {% set tmppath = '/tmp/suhosin7' %} + {% else %} + {% set suhosin_ext = php.lookup.pkgs.suhosin5_ext %} + {% set suhosin_name = 'suhosin' %} + {% set suhosin_repo = php.lookup.pkgs.suhosin5_repo %} + {% set tmppath = '/tmp/suhosin5' %} + {% endif %} +{% elif salt['grains.get']('os_family') == "RedHat" %} + {% if grains['osmajorrelease'] == "7" %} + {% set suhosin_ext = php.lookup.pkgs.suhosin5_ext %} + {% set suhosin_name = 'suhosin' %} + {% set suhosin_repo = php.lookup.pkgs.suhosin5_repo %} + {% set tmppath = '/tmp/suhosin5' %} + {% else %} + {# RHEL version 6 contains PHP 5.3, which is not supported by Suhosin #} + {% endif %} +{% else %} + {% set suhosin_ext = php.lookup.pkgs.suhosin5_ext %} + {% set suhosin_name = 'suhosin' %} + {% set suhosin_repo = php.lookup.pkgs.suhosin5_repo %} + {% set tmppath = '/tmp/suhosin5' %} +{% endif %} + +build-pkgs: + pkg.installed: + - pkgs: {{ php.lookup.pkgs.build_pkgs }} + +git: + pkg.installed: [] + +suhosin-source: + git.latest: + - name: {{ suhosin_repo }} + - target: {{ tmppath }} + - unless: + - test -d {{ tmppath }} + - require: + - pkg: git + +install-suhosin: + cmd.run: + - name: | + phpize + ./configure + make + make install + - cwd: {{ tmppath }} + - shell: /bin/bash + - runas: root + - unless: + - test -e {{ php.lookup.pkgs.ext_conf_path }}/{{ suhosin_name }}.ini + - require: + - pkg: build-pkgs + - git: suhosin-source + +php-suhosin-conf: + file.managed: + - name: {{ php.lookup.pkgs.ext_conf_path }}/{{ suhosin_name }}.ini + - contents: | + extension={{ suhosin_ext }} + suhosin.executor.include.whitelist=phar + - require: + - pkg: php + - cmd: install-suhosin + - unless: + - test -e {{ php.lookup.pkgs.ext_conf_path }}/{{ suhosin_name }}.ini + +{% if salt['grains.get']('os_family') == "Debian" %} + +php-suhosin-enable: + cmd.run: + - name: {{ php.lookup.pkgs.phpenmod_command }} {{ suhosin_name }} + - require: + - file: php-suhosin-conf + +{% endif %} diff --git a/php/ng/twig.sls b/php/ng/twig.sls deleted file mode 100644 index 1fc1189..0000000 --- a/php/ng/twig.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'twig' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/xcache/ini.sls b/php/ng/xcache/ini.sls index efed11d..bbea836 100644 --- a/php/ng/xcache/ini.sls +++ b/php/ng/xcache/ini.sls @@ -1,5 +1,5 @@ # Manages the php cli main ini file -{% from 'php/ng/map.jinja' import php with context %} +{% from "php/ng/map.jinja" import php with context %} {% from "php/ng/ini.jinja" import php_ini %} {% set settings = php.xcache.ini.defaults %} diff --git a/php/oauth.sls b/php/oauth.sls index c89b1ae..347cb39 100644 --- a/php/oauth.sls +++ b/php/oauth.sls @@ -1,4 +1,7 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} + +include: + - php php-oauth: pkg.installed: diff --git a/php/pear.sls b/php/pear.sls index d39e2c5..f21619a 100644 --- a/php/pear.sls +++ b/php/pear.sls @@ -1,4 +1,7 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} + +include: + - php php-pear: pkg.installed: diff --git a/php/pgsql.sls b/php/pgsql.sls index 119e968..9aa0835 100644 --- a/php/pgsql.sls +++ b/php/pgsql.sls @@ -1,4 +1,7 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} + +include: + - php php-pgsql: pkg.installed: diff --git a/php/readline.sls b/php/readline.sls index e54892e..e761dd5 100644 --- a/php/readline.sls +++ b/php/readline.sls @@ -1,4 +1,7 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} + +include: + - php php-readline: pkg: diff --git a/php/redis.sls b/php/redis.sls index 9cf4eb4..d4608d5 100644 --- a/php/redis.sls +++ b/php/redis.sls @@ -1,4 +1,7 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} + +include: + - php php-redis: pkg.installed: diff --git a/php/soap.sls b/php/soap.sls index 4ff190e..3427451 100644 --- a/php/soap.sls +++ b/php/soap.sls @@ -1,4 +1,7 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} + +include: + - php php-soap: pkg.installed: diff --git a/php/sqlite.sls b/php/sqlite.sls index 97a2064..d865d0a 100644 --- a/php/sqlite.sls +++ b/php/sqlite.sls @@ -1,4 +1,7 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} + +include: + - php php-sqlite: pkg.installed: diff --git a/php/suhosin.sls b/php/suhosin.sls index e57d1e4..6c88ce8 100644 --- a/php/suhosin.sls +++ b/php/suhosin.sls @@ -1,5 +1,89 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} -php-suhosin: +include: + - php + - php.dev + +{%- set php_version = salt['pillar.get']('php:version', '7.0')|string %} + +{%- if salt['grains.get']('os') == "Ubuntu" %} + {%- if php_version >= '7.0' %} + {%- set suhosin_ext = php.suhosin7_ext %} + {%- set suhosin_name = 'suhosin7' %} + {%- set suhosin_repo = php.suhosin7_repo %} + {%- set tmppath = '/tmp/suhosin7' %} + {%- else %} + {%- set suhosin_ext = php.suhosin5_ext %} + {%- set suhosin_name = 'suhosin' %} + {%- set suhosin_repo = php.suhosin5_repo %} + {%- set tmppath = '/tmp/suhosin5' %} + {%- endif %} +{%- elif salt['grains.get']('os_family') == "RedHat" %} + {%- if grains['osmajorrelease'] == "7" %} + {%- set suhosin_ext = php.suhosin5_ext %} + {%- set suhosin_name = 'suhosin' %} + {%- set suhosin_repo = php.suhosin5_repo %} + {%- set tmppath = '/tmp/suhosin5' %} + {%- else %} + {# RHEL version 6 contains PHP 5.3, which is not supported by Suhosin #} + {%- endif %} +{%- else %} + {%- set suhosin_ext = php.suhosin5_ext %} + {%- set suhosin_name = 'suhosin' %} + {%- set suhosin_repo = php.suhosin5_repo %} + {%- set tmppath = '/tmp/suhosin5' %} +{%- endif %} + +build-pkgs: pkg.installed: - - name: {{ php.suhosin_pkg }} + - pkgs: {{ php.build_pkgs }} + +git: + pkg.installed: [] + +suhosin-source: + git.latest: + - name: {{ suhosin_repo }} + - target: {{ tmppath }} + - unless: + - test -d {{ tmppath }} + - require: + - pkg: git + +install-suhosin: + cmd.run: + - name: | + phpize + ./configure + make + make install + - cwd: {{ tmppath }} + - shell: /bin/bash + - runas: root + - unless: + - test -e {{ php.ext_conf_path }}/{{ suhosin_name }}.ini + - require: + - pkg: build-pkgs + - git: suhosin-source + +php-suhosin-conf: + file.managed: + - name: {{ php.ext_conf_path }}/{{ suhosin_name }}.ini + - contents: | + extension={{ suhosin_ext }} + suhosin.executor.include.whitelist=phar + - require: + - pkg: {{ php.php_pkg }} + - cmd: install-suhosin + - unless: + - test -e {{ php.ext_conf_path }}/{{ suhosin_name }}.ini + +{%- if salt['grains.get']('os_family') == "Debian" %} + +php-suhosin-enable: + cmd.run: + - name: {{ php.phpenmod_command }} {{ suhosin_name }} + - require: + - file: php-suhosin-conf + +{%- endif %} diff --git a/php/xml.sls b/php/xml.sls index c9057cf..47d39ec 100644 --- a/php/xml.sls +++ b/php/xml.sls @@ -1,4 +1,7 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} + +include: + - php php-xml: pkg.installed: diff --git a/php/zip.sls b/php/zip.sls index d7420bf..668fd2b 100644 --- a/php/zip.sls +++ b/php/zip.sls @@ -1,4 +1,7 @@ -{% from "php/map.jinja" import php with context %} +{%- from "php/map.jinja" import php with context %} + +include: + - php php-zip: pkg.installed: diff --git a/pillar.example b/pillar.example index fafc975..c016190 100644 --- a/pillar.example +++ b/pillar.example @@ -4,7 +4,7 @@ php: # Use ppa instead the default repository (only Debian family) use_ppa: True # Set the ppa name (valid only if use_ppa is not none) - ppa_name: 'ondrej/php5' + ppa_name: 'ondrej/php' # Set the MongoDB driver version. You can specify (optionally) the driver version # when you add the php.mongo formula to your execution list mongo_version: "1.5.5"