From f1b71d00ae5ec7110742d2b137d99ba4da922768 Mon Sep 17 00:00:00 2001 From: sticky-note Date: Thu, 8 Aug 2019 02:01:55 +1100 Subject: [PATCH] feat(ng): promote NG formula BREAKING CHANGES: users must adapt their pillar. See `docs.REAME.rst` --- docs/README.rst | 444 +- php/adodb.sls | 11 +- php/{ng => }/apache2/files/mod_php.conf.jinja | 6 +- php/apache2/ini.sls | 9 + php/apache2/init.sls | 13 + php/apache2/install.sls | 18 + php/apc.sls | 11 +- php/apcu.sls | 11 +- php/auth-sasl.sls | 2 + php/bcmath.sls | 11 +- php/bz2.sls | 2 + php/cache-lite.sls | 2 + php/cgi.sls | 11 +- php/cli.sls | 9 - php/cli/ini.sls | 26 + php/cli/init.sls | 22 + php/cli/install.sls | 28 + php/composer.sls | 31 +- php/console-table.sls | 2 + php/ctype.sls | 2 + php/curl.sls | 11 +- php/dba.sls | 2 + php/deprecated.sls | 41 +- php/dev.sls | 11 +- php/dom.sls | 2 + php/fileinfo.sls | 2 + php/{ng => }/files/php.ini | 0 php/filter.sls | 2 + php/fpm.sls | 11 - php/fpm/config.sls | 63 + php/fpm/init.sls | 44 + php/fpm/install.sls | 2 + php/fpm/pools.sls | 24 + php/fpm/pools_config.sls | 45 + php/fpm/service.sls | 18 + php/gd.sls | 11 +- php/gearman.sls | 2 + php/geoip.sls | 2 + php/geshi.sls | 2 + php/gettext.sls | 2 + php/gmp.sls | 2 + php/hash.sls | 2 + php/hhvm/config.sls | 16 + php/hhvm/init.sls | 23 + php/hhvm/install.sls | 2 + php/hhvm/repo.sls | 19 + php/hhvm/service.sls | 19 + php/http.sls | 2 + php/iconv.sls | 2 + php/igbinary.sls | 2 + php/imagick.sls | 11 +- php/imap.sls | 11 +- php/{ng => }/ini.jinja | 4 +- php/init.sls | 35 +- php/{ng => }/installed.jinja | 6 +- php/intl.sls | 11 +- php/json.sls | 11 +- php/ldap.sls | 11 +- php/{ng => }/macro.jinja | 0 php/mail.sls | 11 +- php/map.jinja | 3675 ++++++++++++++--- php/mbstring.sls | 11 +- php/mcrypt.sls | 11 +- php/mdb2/init.sls | 2 + php/mdb2/mysql.sls | 3 + php/mdb2/pgsql.sls | 3 + php/memcache.sls | 11 +- php/memcached.sls | 11 +- php/modules.sls | 23 + php/mongo.sls | 45 +- php/mongodb.sls | 2 + php/msgpack.sls | 2 + php/mysql.sls | 11 +- php/mysqlnd.sls | 11 +- php/net-smtp.sls | 2 + php/net4.sls | 2 + php/net6.sls | 9 + php/ng/adodb.sls | 4 +- php/ng/apache2/ini.sls | 12 +- php/ng/apache2/init.sls | 14 +- php/ng/apache2/install.sls | 21 +- php/ng/apc.sls | 4 +- php/ng/apcu.sls | 4 +- php/ng/auth-sasl.sls | 4 +- php/ng/bcmath.sls | 4 +- php/ng/bz2.sls | 4 +- php/ng/cache-lite.sls | 4 +- php/ng/cgi.sls | 4 +- php/ng/cli/ini.sls | 29 +- php/ng/cli/init.sls | 23 +- php/ng/cli/install.sls | 31 +- php/ng/composer.sls | 62 +- php/ng/console-table.sls | 4 +- php/ng/ctype.sls | 4 +- php/ng/curl.sls | 4 +- php/ng/dba.sls | 4 +- php/ng/deprecated.sls | 40 - php/ng/dev.sls | 4 +- php/ng/dom.sls | 4 +- php/ng/fileinfo.sls | 4 +- php/ng/filter.sls | 4 +- php/ng/fpm/config.sls | 66 +- php/ng/fpm/init.sls | 45 +- php/ng/fpm/install.sls | 5 +- php/ng/fpm/pools.sls | 25 +- php/ng/fpm/pools_config.sls | 48 +- php/ng/fpm/service.sls | 19 +- php/ng/gd.sls | 4 +- php/ng/gearman.sls | 4 +- php/ng/geoip.sls | 4 +- php/ng/geshi.sls | 4 +- php/ng/gettext.sls | 4 +- php/ng/gmp.sls | 4 +- php/ng/hash.sls | 4 +- php/ng/hhvm/config.sls | 19 +- php/ng/hhvm/init.sls | 24 +- php/ng/hhvm/install.sls | 5 +- php/ng/hhvm/repo.sls | 20 +- php/ng/hhvm/service.sls | 20 +- php/ng/http.sls | 4 +- php/ng/iconv.sls | 4 +- php/ng/igbinary.sls | 4 +- php/ng/imagick.sls | 4 +- php/ng/imap.sls | 4 +- php/ng/init.sls | 4 +- php/ng/intl.sls | 4 +- php/ng/json.sls | 4 +- php/ng/ldap.sls | 4 +- php/ng/mail.sls | 4 +- php/ng/map.jinja | 3247 --------------- php/ng/mbstring.sls | 4 +- php/ng/mcrypt.sls | 4 +- php/ng/mdb2/init.sls | 5 +- php/ng/mdb2/mysql.sls | 6 +- php/ng/mdb2/pgsql.sls | 6 +- php/ng/memcache.sls | 4 +- php/ng/memcached.sls | 4 +- php/ng/modules.sls | 25 +- php/ng/mongo.sls | 4 +- php/ng/mongodb.sls | 4 +- php/ng/msgpack.sls | 4 +- php/ng/mysql.sls | 4 +- php/ng/mysqlnd.sls | 4 +- php/ng/net-smtp.sls | 4 +- php/ng/net4.sls | 4 +- php/ng/net6.sls | 11 +- php/ng/oauth.sls | 4 +- php/ng/opcache.sls | 4 +- php/ng/openssl.sls | 4 +- php/ng/pdo.sls | 4 +- php/ng/pdo_mysql.sls | 4 +- php/ng/pear.sls | 4 +- php/ng/pgsql.sls | 4 +- php/ng/phar.sls | 4 +- php/ng/posix.sls | 4 +- php/ng/pspell.sls | 4 +- php/ng/readline.sls | 4 +- php/ng/redis.sls | 4 +- php/ng/seclib.sls | 4 +- php/ng/session.sls | 4 +- php/ng/simplexml.sls | 4 +- php/ng/snmp.sls | 4 +- php/ng/soap.sls | 4 +- php/ng/sqlite.sls | 4 +- php/ng/ssh2.sls | 4 +- php/ng/suhosin.sls | 90 +- php/ng/svn.sls | 4 +- php/ng/sybase.sls | 4 +- php/ng/tcpdf.sls | 4 +- php/ng/tidy.sls | 4 +- php/ng/tokenizer.sls | 4 +- php/ng/uuid.sls | 4 +- php/ng/xcache/ini.sls | 18 +- php/ng/xcache/init.sls | 12 +- php/ng/xcache/install.sls | 5 +- php/ng/xdebug.sls | 4 +- php/ng/xml.sls | 4 +- php/ng/xmlwriter.sls | 4 +- php/ng/xsl.sls | 4 +- php/ng/zip.sls | 4 +- php/oauth.sls | 11 +- php/opcache.sls | 2 + php/openssl.sls | 2 + php/pdo.sls | 2 + php/pdo_mysql.sls | 2 + php/pear.sls | 11 +- php/pgsql.sls | 11 +- php/phar.sls | 2 + php/posix.sls | 2 + php/pspell.sls | 2 + php/readline.sls | 12 +- php/redis.sls | 11 +- php/seclib.sls | 2 + php/session.sls | 2 + php/simplexml.sls | 2 + php/snmp.sls | 2 + php/soap.sls | 11 +- php/sqlite.sls | 11 +- php/ssh2.sls | 2 + php/suhosin.sls | 73 +- php/svn.sls | 2 + php/sybase.sls | 11 +- php/tcpdf.sls | 2 + php/tidy.sls | 2 + php/tokenizer.sls | 2 + php/uuid.sls | 2 + php/xcache/ini.sls | 15 + php/xcache/init.sls | 11 + php/xcache/install.sls | 2 + php/xdebug.sls | 2 + php/xml.sls | 11 +- php/xmlwriter.sls | 2 + php/xsl.sls | 2 + php/zip.sls | 11 +- pillar.example | 351 +- pre-commit_semantic-release.sh | 2 - release.config.js | 2 +- 217 files changed, 4371 insertions(+), 5487 deletions(-) rename php/{ng => }/apache2/files/mod_php.conf.jinja (64%) create mode 100644 php/apache2/ini.sls create mode 100644 php/apache2/init.sls create mode 100644 php/apache2/install.sls create mode 100644 php/auth-sasl.sls create mode 100644 php/bz2.sls create mode 100644 php/cache-lite.sls delete mode 100644 php/cli.sls create mode 100644 php/cli/ini.sls create mode 100644 php/cli/init.sls create mode 100644 php/cli/install.sls create mode 100644 php/console-table.sls create mode 100644 php/ctype.sls create mode 100644 php/dba.sls create mode 100644 php/dom.sls create mode 100644 php/fileinfo.sls rename php/{ng => }/files/php.ini (100%) create mode 100644 php/filter.sls delete mode 100644 php/fpm.sls create mode 100644 php/fpm/config.sls create mode 100644 php/fpm/init.sls create mode 100644 php/fpm/install.sls create mode 100644 php/fpm/pools.sls create mode 100644 php/fpm/pools_config.sls create mode 100644 php/fpm/service.sls create mode 100644 php/gearman.sls create mode 100644 php/geoip.sls create mode 100644 php/geshi.sls create mode 100644 php/gettext.sls create mode 100644 php/gmp.sls create mode 100644 php/hash.sls create mode 100644 php/hhvm/config.sls create mode 100644 php/hhvm/init.sls create mode 100644 php/hhvm/install.sls create mode 100644 php/hhvm/repo.sls create mode 100644 php/hhvm/service.sls create mode 100644 php/http.sls create mode 100644 php/iconv.sls create mode 100644 php/igbinary.sls rename php/{ng => }/ini.jinja (74%) rename php/{ng => }/installed.jinja (95%) rename php/{ng => }/macro.jinja (100%) create mode 100644 php/mdb2/init.sls create mode 100644 php/mdb2/mysql.sls create mode 100644 php/mdb2/pgsql.sls create mode 100644 php/modules.sls create mode 100644 php/mongodb.sls create mode 100644 php/msgpack.sls create mode 100644 php/net-smtp.sls create mode 100644 php/net4.sls create mode 100644 php/net6.sls delete mode 100644 php/ng/deprecated.sls delete mode 100644 php/ng/map.jinja create mode 100644 php/opcache.sls create mode 100644 php/openssl.sls create mode 100644 php/pdo.sls create mode 100644 php/pdo_mysql.sls create mode 100644 php/phar.sls create mode 100644 php/posix.sls create mode 100644 php/pspell.sls create mode 100644 php/seclib.sls create mode 100644 php/session.sls create mode 100644 php/simplexml.sls create mode 100644 php/snmp.sls create mode 100644 php/ssh2.sls create mode 100644 php/svn.sls create mode 100644 php/tcpdf.sls create mode 100644 php/tidy.sls create mode 100644 php/tokenizer.sls create mode 100644 php/uuid.sls create mode 100644 php/xcache/ini.sls create mode 100644 php/xcache/init.sls create mode 100644 php/xcache/install.sls create mode 100644 php/xdebug.sls create mode 100644 php/xmlwriter.sls create mode 100644 php/xsl.sls diff --git a/docs/README.rst b/docs/README.rst index 17a40af5..1d8891c4 100644 --- a/docs/README.rst +++ b/docs/README.rst @@ -21,25 +21,28 @@ Formula to set up and configure php :header-rows: 1 :widths: 1 - * - WARNING: BREAKING CHANGES IN UPCOMING ``v1.0.0`` - * - This formula currently provides two methods for managing PHP; the old method - under ``php`` and the new method under ``php.ng``. - In upcoming `v1.0.0 `_, - the old method will be removed and ``php.ng`` will be promoted to ``php`` in its place. - - If you are not in a position to migrate, you will need to pin your repo to - the final release tag before + * - WARNING: BREAKING CHANGES SINCE ``v1.0.0`` + * - Prior to `v1.0.0 `_, - which is expected to be + this formula provided two methods for managing PHP; + the old method under ``php`` and the new method under ``php.ng``. + The old method has now been removed and ``php.ng`` has been promoted to + be ``php`` in its place. + + If you are not in a position to migrate, please pin your repo to the final + release tag before + `v1.0.0 `_, + i.e. `v0.40.1 `_. - If you are currently using ``php.ng``, there is nothing to do until - `v1.0.0 `_ - is released. + To migrate from ``php.ng``, simply modify your pillar to promote the + entire section under ``php:ng`` so that it is under ``php`` instead. + So with the editor of your choice, highlight the entire section and then + unindent one level. Finish by removing the ``ng:`` line. - To migrate from the old ``php``, the first step is to convert to ``php.ng``, - before `v1.0.0 `_ - is released. + To migrate from the old ``php``, first convert to ``php.ng`` under + `v0.40.1 `_. + and then follow the steps laid out in the paragraph directly above. .. contents:: **Table of Contents** @@ -70,694 +73,489 @@ Available states .. contents:: :local: -``php`` -^^^^^^^ - -Installs the php package. - -``php.adodb`` -^^^^^^^^^^^^^ - -Installs the php-adodb package. - -``php.apc`` -^^^^^^^^^^^ - -Installs the php-apc package. -Disabled by default on opensuse need server:php repo - -``php.apcu`` -^^^^^^^^^^^^ - -Installs the php-apcu package. -Disabled by default on opensuse need server:php repo - -``php.bcmath`` -^^^^^^^^^^^^^^ - -Installs the php-bcmath package. - -``php.cgi`` -^^^^^^^^^^^ - -Installs the php-cgi package. -Disabled on opensuse not available, only fastcgi - -``php.cli`` -^^^^^^^^^^^ - -Installs the php-cli package. - -``php.composer`` -^^^^^^^^^^^^^^^^ - -Installs [composer](https://getcomposer.org) and keeps it updated. - -``php.curl`` -^^^^^^^^^^^^ - -Installs the php5-curl package on Debian, and ensures that curl itself is -installed for RedHat systems, this is due to the curl libs being provided by -php-common, which will get installed with the main php package. - -``php.dev`` -^^^^^^^^^^^ - -Installs the php-dev package. - -``php.fileinfo`` -^^^^^^^^^^^^^^^^ - -Installs the php-fileinfo package and enables it. - -``php.fpm`` -^^^^^^^^^^^ - -Installs the php-fpm package, starts the service, and enables it. - -``php.gd`` -^^^^^^^^^^ - -Installs the php-gd package. - -``php.imagick`` -^^^^^^^^^^^^^^^ - -Installs the php-imagick package. -Disabled on opensuse not available. - -``php.imap`` -^^^^^^^^^^^^ - -Installs the php-imap package. - -``php.intl`` -^^^^^^^^^^^^ - -Installs the php-intl package. - -``php.json`` -^^^^^^^^^^^^ - -Installs the php-json package. - -``php.ldap`` -^^^^^^^^^^^^ - -Installs the php-ldap package. - -``php.mail`` -^^^^^^^^^^^^ - -Installs the php-mail package. - -``php.mbstring`` -^^^^^^^^^^^^^^^^ - -Installs the php-mbstring package. - -``php.mcrypt`` -^^^^^^^^^^^^^^ - -Installs the php-mcrypt package. - -``php.memcache`` -^^^^^^^^^^^^^^^^ - -Installs the php-memcache package. -Disabled on opensuse need server:php:extensions repo - -``php.memcached`` -^^^^^^^^^^^^^^^^^ - -Installs the php-memcached package. -Disabled on opensuse need server:php:extensions repo - -``php.mongo`` -^^^^^^^^^^^^^ - -Installs the php-mongo package. -Disabled on opensuse need server:php:extensions repo - -``php.mysql`` -^^^^^^^^^^^^^ - -Installs the php-mysql package. - -``php.mysqlnd`` -^^^^^^^^^^^^^^^ - -Installs the php-mysqlnd package. -Disabled on opensuse no package. - -``php.oauth`` -^^^^^^^^^^^^^ - -Installs the php-oauth package. - -``php.pear`` -^^^^^^^^^^^^ - -Installs the php-pear package. - -``php.pgsql`` -^^^^^^^^^^^^^ - -Installs the php-pgsql package. - -``php.readline`` -^^^^^^^^^^^^^^^^ - -Installs the php-readline package. - -``php.redis`` -^^^^^^^^^^^^^ - -Installs the php-redis package. -Disabled on opensuse need server:php:extensions repo - -``php.soap`` -^^^^^^^^^^^^ - -Installs the php-soap package. - -``php.sqlite`` -^^^^^^^^^^^^^^ - -Installs the php-sqlite package, - -``php.suhosin`` -^^^^^^^^^^^^^^^ - -Installs the php-suhosin package. - -``php.sybase`` -^^^^^^^^^^^^^^ - -Installs the php-sybase package for Sybase/MS-SQL. Debian / Ubuntu as RedHat has no similar package. - -``php.tokenizer`` -^^^^^^^^^^^^^^^^^ - -Installs the php-tokenizer package and enables it. - -``php.xml`` -^^^^^^^^^^^ - -Installs the php-xml package. - -``php.zip`` -^^^^^^^^^^^ - -Installs the php-zip package. - -Next-generation, alternate approach ------------------------------------ - -The following states provide an alternate approach to managing PHP and FPM -pools, as well as code organization. Please provide feedback by filing issues, +Please provide feedback by filing issues, discussing in ``#salt`` in Freenode and the mailing list as normal. -**Note:** php.ng states require the merge parameter of salt.modules.pillar.get(), +**Note:** php states require the merge parameter of salt.modules.pillar.get(), first available in the Helium release. .. contents:: :local: -``php.ng`` +``php`` ^^^^^^^^^^ Installs the php package. -``php.ng.adodb`` +``php.adodb`` ^^^^^^^^^^^^^^^^ Installs the php-adodb package. -``php.ng.apache2`` +``php.apache2`` ^^^^^^^^^^^^^^^^^^ -Meta-state that combines `php.ng.apache2.install`_ and `php.ng.apache2.ini`_. +Meta-state that combines `php.apache2.install`_ and `php.apache2.ini`_. -``php.ng.apache2.ini`` +``php.apache2.ini`` ^^^^^^^^^^^^^^^^^^^^^^ Manages the apache2 php.ini file -``php.ng.apache2.install`` +``php.apache2.install`` ^^^^^^^^^^^^^^^^^^^^^^^^^^ Installs the apache2 and libapache2-mod-php5 package. Debian Only. -``php.ng.apc`` +``php.apc`` ^^^^^^^^^^^^^^ Installs the php-apc package. Disabled on opensuse need server:php repo -``php.ng.apcu`` +``php.apcu`` ^^^^^^^^^^^^^^^ Installs the php-apcu package. Disabled on opensuse need server:php repo -``php.ng.auth-sasl`` +``php.auth-sasl`` ^^^^^^^^^^^^^^^^^^^^ Installs the php-auth-sasl package. -``php.ng.bcmath`` +``php.bcmath`` ^^^^^^^^^^^^^^^^^ Installs the php-bcmath package. -``php.ng.bz2`` +``php.bz2`` ^^^^^^^^^^^^^^ Installs the php-bz2 package. -``php.ng.cache-lite`` +``php.cache-lite`` ^^^^^^^^^^^^^^^^^^^^^ Installs the php-cache-lite package. -``php.ng.cgi`` +``php.cgi`` ^^^^^^^^^^^^^^ Installs the php-cgi package. Disabled on opensuse only php5-fastcgi available. -``php.ng.cli`` +``php.cli`` ^^^^^^^^^^^^^^ -Meta-state that combines `php.ng.cli.install`_ and `php.ng.cli.ini`_. +Meta-state that combines `php.cli.install`_ and `php.cli.ini`_. -``php.ng.cli.ini`` +``php.cli.ini`` ^^^^^^^^^^^^^^^^^^ Manages the php-cli ini file. -``php.ng.cli.install`` +``php.cli.install`` ^^^^^^^^^^^^^^^^^^^^^^ Installs the php-cli package. -``php.ng.composer`` +``php.composer`` ^^^^^^^^^^^^^^^^^^^ Installs [composer](https://getcomposer.org) and keeps it updated. -``php.ng.console-table`` +``php.console-table`` ^^^^^^^^^^^^^^^^^^^^^^^^ Installs the php-console-table package. -``php.ng.ctype`` +``php.ctype`` ^^^^^^^^^^^^^^^^ Installs the php-ctype package. -``php.ng.curl`` +``php.curl`` ^^^^^^^^^^^^^^^ Installs the php5-curl package on Debian, and ensures that curl itself is installed for RedHat systems, this is due to the curl libs being provided by php-common, which will get installed with the main php package. -``php.ng.dba`` +``php.dba`` ^^^^^^^^^^^^^^ Installs the php-dba package. -``php.ng.dev`` +``php.dev`` ^^^^^^^^^^^^^^ Installs the php5-dev and build-essential package. -``php.ng.filter`` +``php.filter`` ^^^^^^^^^^^^^^^^^ Installs the php-filter package. -``php.ng.fpm`` +``php.fpm`` ^^^^^^^^^^^^^^ -Meta-state that combines all php.ng.fpm states. +Meta-state that combines all php.fpm states. -``php.ng.fpm.config`` +``php.fpm.config`` ^^^^^^^^^^^^^^^^^^^^^ Manages the (non-pool) php-fpm config files. -``php.ng.fpm.install`` +``php.fpm.install`` ^^^^^^^^^^^^^^^^^^^^^^ Installs the php-fpm package. -``php.ng.fpm.pools`` +``php.fpm.pools`` ^^^^^^^^^^^^^^^^^^^^ -Meta-state that combines `php.ng.fpm.service`_ and `php.ng.fpm.pools_config`_ +Meta-state that combines `php.fpm.service`_ and `php.fpm.pools_config`_ -``php.ng.fpm.pools_config`` +``php.fpm.pools_config`` ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Manages php-fpm pool config files. -``php.ng.fpm.service`` +``php.fpm.service`` ^^^^^^^^^^^^^^^^^^^^^^ Manages the php-fpm service. -``php.ng.gd`` +``php.gd`` ^^^^^^^^^^^^^ Installs the php-gd package. -``php.ng.gearman`` +``php.gearman`` ^^^^^^^^^^^^^^^^^^ Installs the php-gearman package. -``php.ng.geoip`` +``php.geoip`` ^^^^^^^^^^^^^^^^ Installs the php-geoip package. -``php.ng.geshi`` +``php.geshi`` ^^^^^^^^^^^^^^^^ Installs the php-geshi package. -``php.ng.gettext`` +``php.gettext`` ^^^^^^^^^^^^^^^^^^ Installs the php-gettext package. -``php.ng.gmp`` +``php.gmp`` ^^^^^^^^^^^^^^ Installs the php-gmp package. Debian Only. -``php.ng.hash`` +``php.hash`` ^^^^^^^^^^^^^^^ Installs the php-hash package. -``php.ng.http`` +``php.http`` ^^^^^^^^^^^^^^^ Installs the php-http package. -``php.ng.hhvm`` +``php.hhvm`` ^^^^^^^^^^^^^^^ -Meta-state that combines php.ng.hhvm states +Meta-state that combines php.hhvm states -``php.ng.hhvm.config`` +``php.hhvm.config`` ^^^^^^^^^^^^^^^^^^^^^^ Manages the php-hhvm config files -``php.ng.hhvm.install`` +``php.hhvm.install`` ^^^^^^^^^^^^^^^^^^^^^^^ Installs the php-hhvm package -``php.ng.hhvm.repo`` +``php.hhvm.repo`` ^^^^^^^^^.REPO^^^^^^ Configures the hhvm repo for debian/ubuntu -``php.ng.hhvm.service`` +``php.hhvm.service`` ^^^^^^^^^^^^^^^^^^^^^^^ Manages the php-hhvm service. -``php.ng.igbinary`` +``php.igbinary`` ^^^^^^^^^^^^^^^^^^^ Installs the php-igbinary package. -``php.ng.imagick`` +``php.imagick`` ^^^^^^^^^^^^^^^^^^ Installs the php-imagick package. Disabled on opensuse no package. -``php.ng.imap`` +``php.imap`` ^^^^^^^^^^^^^^^ Installs the php-imap package. -``php.ng.intl`` +``php.intl`` ^^^^^^^^^^^^^^^ Installs the php-intl package. -``php.ng.json`` +``php.json`` ^^^^^^^^^^^^^^^ Installs the php-json package. -``php.ng.ldap`` +``php.ldap`` ^^^^^^^^^^^^^^^ Installs the php-ldap package. -``php.ng.mail`` +``php.mail`` ^^^^^^^^^^^^^^^ Installs the php-mail package. -``php.ng.mbstring`` +``php.mbstring`` ^^^^^^^^^^^^^^^^^^^ Installs the php-mbstring package. -``php.ng.mcrypt`` +``php.mcrypt`` ^^^^^^^^^^^^^^^^^ Installs the php-mcrypt package. -``php.ng.mdb2`` +``php.mdb2`` ^^^^^^^^^^^^^^^ Installs the php-mdb2 package. -``php.ng.mdb2-driver-mysql`` +``php.mdb2-driver-mysql`` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Installs the php-mdb2-driver-mysql package. -``php.ng.mdb2-driver-pgsql`` +``php.mdb2-driver-pgsql`` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Installs the php-mdb2-driver-pgsql package. -``php.ng.memcache`` +``php.memcache`` ^^^^^^^^^^^^^^^^^^^ Installs the php-memcache package. Disabled on opensuse need server:php:extensions repo -``php.ng.memcached`` +``php.memcached`` ^^^^^^^^^^^^^^^^^^^^ Installs the php-memcached package. Disabled on opensuse need server:php:extensions repo -``php.ng.modules`` +``php.modules`` ^^^^^^^^^^^^^^^^^^ -Calls ``php.ng.`` for each entry in ``php:ng:modules`` if available, or +Calls ``php.`` for each entry in ``php:modules`` if available, or try to install the matching packages that can be set via from -``php:ng:lookup:pkgs`` +``php:lookup:pkgs`` -``php.ng.mongo`` +``php.mongo`` ^^^^^^^^^^^^^^^^ Installs the php-mongo package. -``php.ng.mongodb`` +``php.mongodb`` ^^^^^^^^^^^^^^^^^^ Installs the php-mongodb package. -``php.ng.msgpack`` +``php.msgpack`` ^^^^^^^^^^^^^^^^^^ Installs the php-msgpack package. -``php.ng.mysql`` +``php.mysql`` ^^^^^^^^^^^^^^^^ Installs the php-mysql package. -``php.ng.mysqlnd`` +``php.mysqlnd`` ^^^^^^^^^^^^^^^^^^ Installs the php-mysqlnd package. Disabled on opensuse no package. -``php.ng.net-smtp`` +``php.net-smtp`` ^^^^^^^^^^^^^^^^^^^ Installs the php-net-smtp package. -``php.ng.net4`` +``php.net4`` ^^^^^^^^^^^^^^^ Installs the php-net4 package. -``php.ng.net6`` +``php.net6`` ^^^^^^^^^^^NET6 Installs the php-net6 package. -``php.ng.oauth`` +``php.oauth`` ^^^^^^^^^^^^^^^^ Installs the php-oauth package. -``php.ng.opcache`` +``php.opcache`` ^^^^^^^^^^^^^^^^^^ Installs the php-opcache package. -``php.ng.openssl`` +``php.openssl`` ^^^^^^^^^^^^^^^^^^ Installs the php-openssl package. -``php.ng.pear`` +``php.pear`` ^^^^^^^^^^^^^^^ Installs the php-pear package. -``php.ng.pgsql`` +``php.pgsql`` ^^^^^^^^^^^^^^^^ Installs the php-pgsql package. -``php.ng.phar`` +``php.phar`` ^^^^^^^^^^^^^^^ Installs the php-phar package. -``php.ng.posix`` +``php.posix`` ^^^^^^^^^^^^^^^^ Installs the php-posix package. -``php.ng.pspell`` +``php.pspell`` ^^^^^^^^^^^^^^^^^ Installs the php-pspell package. -``php.ng.readline`` +``php.readline`` ^^^^^^^^^^^^^^^^^^^ Installs the php-readline package. -``php.ng.redis`` +``php.redis`` ^^^^^^^^^^^^^^^^ Installs the php-redis package. Disabled on opensuse need server:php:extensions repo -``php.ng.seclib`` +``php.seclib`` ^^^^^^^^^^^^^^^^^ Installs the php-seclib package. -``php.ng.session`` +``php.session`` ^^^^^^^^^^^^^^^^^^ Installs the php-session package. -``php.ng.snmp`` +``php.snmp`` ^^^^^^^^^^^^^^^ Installs the php-snmp package. -``php.ng.soap`` +``php.soap`` ^^^^^^^^^^^^^^^ Installs the php-soap package. -``php.ng.sqlite`` +``php.sqlite`` ^^^^^^^^^^^^^^^^^ Installs the php-sqlite package, -``php.ng.ssh2`` +``php.ssh2`` ^^^^^^^^^^^^^^^ Installs the php-ssh2 package, -``php.ng.suhosin`` +``php.suhosin`` ^^^^^^^^^^^^^^^^^^ Installs the php-suhosin package. -``php.ng.svn`` +``php.svn`` ^^^^^^^^^^^^^^ Installs the php-svn package. -``php.ng.sybase`` +``php.sybase`` ^^^^^^^^^^^^^^^^^ Installs the php-sybase package. -``php.ng.tcpdf`` +``php.tcpdf`` ^^^^^^^^^^^^^^^^ Installs the php-tcpdf package. -``php.ng.tidy`` +``php.tidy`` ^^^^^^^^^^^^^^^ Installs the php-tidy package. -``php.ng.uuid`` +``php.uuid`` ^^^^^^^^^^^^^^^ Installs the php-uuid package. -``php.ng.xcache`` +``php.xcache`` ^^^^^^^^^^^^^^^^^ -Meta-state that combines `php.ng.xcache.install`_ and `php.ng.xcache.ini`_. +Meta-state that combines `php.xcache.install`_ and `php.xcache.ini`_. -``php.ng.xcache.ini`` +``php.xcache.ini`` ^^^^^^^^^^^^^^^^^^^^^ Manages the php-xcache ini file -``php.ng.xcache.install`` +``php.xcache.install`` ^^^^^^^^^^^^^^^^^^^^^^^^^ Installs the php-xcache package. Disabled on opensuse need server:php:extensions repo -``php.ng.xdebug`` +``php.xdebug`` ^^^^^^^^^^^^^^^^^ Installs the php-xdebug package. -``php.ng.xml`` +``php.xml`` ^^^^^^^^^^^^^^ Installs the php-xml package. -``php.ng.xsl`` +``php.xsl`` ^^^^^^^^^^^^^^ Installs the php-xsl package. -``php.ng.zip`` +``php.zip`` ^^^^^^^^^^^^^^ Installs the php-zip package. diff --git a/php/adodb.sls b/php/adodb.sls index 2cf3569c..16de912d 100644 --- a/php/adodb.sls +++ b/php/adodb.sls @@ -1,9 +1,2 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-adodb: - pkg.installed: - - name: {{ php.adodb_pkg }} +{% set state = 'adodb' %} +{% include "php/installed.jinja" %} diff --git a/php/ng/apache2/files/mod_php.conf.jinja b/php/apache2/files/mod_php.conf.jinja similarity index 64% rename from php/ng/apache2/files/mod_php.conf.jinja rename to php/apache2/files/mod_php.conf.jinja index 9c70790c..f8b45e60 100644 --- a/php/ng/apache2/files/mod_php.conf.jinja +++ b/php/apache2/files/mod_php.conf.jinja @@ -1,6 +1,6 @@ -{% from "php/ng/map.jinja" import php with context %} -{% from "php/ng/map.jinja" import phpng_version with context %} -{% set major = phpng_version.split('.')|first %} +{% from "php/map.jinja" import php with context %} +{% from "php/map.jinja" import php_version with context %} +{% set major = php_version.split('.')|first %} LoadModule php{{ major }}_module /usr/local/libexec/{{ php.lookup.apache2.name }}/libphp{{ major }}.so diff --git a/php/apache2/ini.sls b/php/apache2/ini.sls new file mode 100644 index 00000000..3debad4e --- /dev/null +++ b/php/apache2/ini.sls @@ -0,0 +1,9 @@ +# Manages the main Apache2 ini file +{% from "php/map.jinja" import php with context %} +{% from "php/ini.jinja" import php_ini %} + +{% set settings = php.ini.defaults %} +{% do settings.update(php.apache2.ini.settings) %} + +php_apache2_ini: + {{ php_ini(php.lookup.apache2.ini, php.apache2.ini.opts, settings) }} diff --git a/php/apache2/init.sls b/php/apache2/init.sls new file mode 100644 index 00000000..d4dae3fa --- /dev/null +++ b/php/apache2/init.sls @@ -0,0 +1,13 @@ +{% if grains['os_family'] in ["Debian", "FreeBSD"] %} +include: + - php.apache2.install +{% endif %} #END: os = Debian|FreeBSD +{% if grains['os_family'] == "Debian" %} + - php.apache2.ini + +extend: + php_apache2_ini: + file: + - require: + - sls: php.apache2.install +{% endif %} #END: os = debian diff --git a/php/apache2/install.sls b/php/apache2/install.sls new file mode 100644 index 00000000..52f0f229 --- /dev/null +++ b/php/apache2/install.sls @@ -0,0 +1,18 @@ +{% from "php/map.jinja" import php with context %} + +{% set state = 'apache2' %} +{% include "php/installed.jinja" %} + +{% if grains['os_family'] == "FreeBSD" %} +{{ php.lookup.apache2.module_config }}: + file.managed: + - source: salt://php/apache2/files/mod_php.conf.jinja + - template: jinja +{% if salt['pillar.get']('php:use_apache_formula', True) %} + - makedirs: true + - require_in: + - sls: apache + - watch_in: + - module: apache-restart +{% endif %} #END: use apache formula +{% endif %} #END: os = debian diff --git a/php/apc.sls b/php/apc.sls index 2a3d2cab..2dd0fdd1 100644 --- a/php/apc.sls +++ b/php/apc.sls @@ -1,9 +1,2 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-apc: - pkg.installed: - - name: {{ php.apc_pkg }} +{% set state = 'apc' %} +{% include "php/installed.jinja" %} diff --git a/php/apcu.sls b/php/apcu.sls index 76eb429a..cfd0eb3d 100644 --- a/php/apcu.sls +++ b/php/apcu.sls @@ -1,9 +1,2 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-apcu: - pkg.installed: - - name: {{ php.apcu_pkg }} +{% set state = 'apcu' %} +{% include "php/installed.jinja" %} diff --git a/php/auth-sasl.sls b/php/auth-sasl.sls new file mode 100644 index 00000000..9af77ccd --- /dev/null +++ b/php/auth-sasl.sls @@ -0,0 +1,2 @@ +{% set state = 'auth-sasl' %} +{% include "php/installed.jinja" %} diff --git a/php/bcmath.sls b/php/bcmath.sls index bcfb84f1..7e00b6b9 100644 --- a/php/bcmath.sls +++ b/php/bcmath.sls @@ -1,9 +1,2 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-bcmath: - pkg.installed: - - name: {{ php.bcmath_pkg }} +{% set state = 'bcmath' %} +{% include "php/installed.jinja" %} diff --git a/php/bz2.sls b/php/bz2.sls new file mode 100644 index 00000000..851d4c47 --- /dev/null +++ b/php/bz2.sls @@ -0,0 +1,2 @@ +{% set state = 'bz2' %} +{% include "php/installed.jinja" %} diff --git a/php/cache-lite.sls b/php/cache-lite.sls new file mode 100644 index 00000000..bda6a2ae --- /dev/null +++ b/php/cache-lite.sls @@ -0,0 +1,2 @@ +{% set state = 'cache-lite' %} +{% include "php/installed.jinja" %} diff --git a/php/cgi.sls b/php/cgi.sls index ce53a5f0..220a8fea 100644 --- a/php/cgi.sls +++ b/php/cgi.sls @@ -1,9 +1,2 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-cgi: - pkg.installed: - - name: {{ php.cgi_pkg }} +{% set state = 'cgi' %} +{% include "php/installed.jinja" %} diff --git a/php/cli.sls b/php/cli.sls deleted file mode 100644 index b7017107..00000000 --- a/php/cli.sls +++ /dev/null @@ -1,9 +0,0 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-cli: - pkg.installed: - - name: {{ php.cli_pkg }} diff --git a/php/cli/ini.sls b/php/cli/ini.sls new file mode 100644 index 00000000..d8274085 --- /dev/null +++ b/php/cli/ini.sls @@ -0,0 +1,26 @@ +# Manages the php cli main ini file +{% from "php/map.jinja" import php with context %} +{% from "php/ini.jinja" import php_ini %} + +{% set settings = php.ini.defaults %} +{% for key, value in php.cli.ini.settings.items() %} + {% if settings[key] is defined %} + {% do settings[key].update(value) %} + {% else %} + {% do settings.update({key: value}) %} + {% endif %} +{% endfor %} + +{% set pillar_php_ng_version = salt['pillar.get']('php:ng:version', '7.0') %} +{% if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %} + {% for version in pillar_php_ng_version %} + {% set first_version = pillar_php_ng_version[0]|string %} + {% set ini = php.lookup.cli.ini|replace(first_version, version) %} +php_cli_ini_{{ version }}: + {{ php_ini(ini, php.cli.ini.opts, settings) }} + {% endfor %} +{% else %} + +php_cli_ini: + {{ php_ini(php.lookup.cli.ini, php.cli.ini.opts, settings) }} +{% endif %} diff --git a/php/cli/init.sls b/php/cli/init.sls new file mode 100644 index 00000000..6d4f9dea --- /dev/null +++ b/php/cli/init.sls @@ -0,0 +1,22 @@ +# Installs php-cli and manages the associated php.ini + +include: + - php.cli.install + - php.cli.ini + +{% set pillar_php_version = salt['pillar.get']('php:version', '7.0') %} +{% if pillar_php_version is iterable and pillar_php_version is not string %} +extend: + {% for version in pillar_php_version %} + php_cli_ini_{{ version }}: + file: + - require: + - sls: php.cli.install + {% endfor %} +{% else %} +extend: + php_cli_ini: + file: + - require: + - sls: php.cli.install +{% endif %} diff --git a/php/cli/install.sls b/php/cli/install.sls new file mode 100644 index 00000000..64d351b7 --- /dev/null +++ b/php/cli/install.sls @@ -0,0 +1,28 @@ +{% set state = 'cli' %} +{% include "php/installed.jinja" %} + +{%- if salt['grains.get']('os_family') == "Debian" %} +{% set current_php = salt['alternatives.show_current']('php') %} +{% set pillar_php_version = salt['pillar.get']('php:version', '7.0') %} +{% if pillar_php_version is iterable and pillar_php_version is not string %} + {% if 'alternatives_version' in salt['pillar.get']('php') %} + {% set php_version = salt['pillar.get']('php:alternatives_version') %} + {% else %} + {% set php_version = false %} + {% endif %} +{% else %} +{% set php_version = salt['pillar.get']('php:version', '7.0')|string %} +{% endif %} + +{% if php_version %} +php_{{ php_version }}_link: + alternatives.set: + - name: php + - path: /usr/bin/php{{ php_version }} + - require_in: + - pkg: php_install_{{ state }} + - onlyif: + - which php + - test {{ current_php }} != $(which php{{ php_version }}) +{% endif %} +{% endif %} diff --git a/php/composer.sls b/php/composer.sls index e4abc4c9..2b61c6fe 100644 --- a/php/composer.sls +++ b/php/composer.sls @@ -1,22 +1,29 @@ -{%- from "php/map.jinja" import php with context %} +{% from "php/map.jinja" import php with context %} -{%- set install_file = php.local_bin + '/' + php.composer_bin %} +{% 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 %} +{% 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') %} +{% set salt_user_home = salt['user.info'](salt_user).get('home', '/root') %} include: - - php.deprecated - php +{% if grains['os_family'] == 'FreeBSD' %} + - php.filter + - php.hash + - php.json + - php.mbstring + - php.openssl + - php.phar +{% endif %} get-composer: file.managed: - - name: {{ php.temp_dir }}/installer + - name: {{ php.lookup.pkgs.temp_dir }}/installer - mode: 0755 - unless: test -f {{ install_file }} - source: https://getcomposer.org/installer @@ -26,7 +33,7 @@ get-composer: install-composer: cmd.run: - - name: php {{ php.temp_dir }}/installer --filename={{ php.composer_bin }} --install-dir={{ php.local_bin }} + - 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 }} @@ -47,7 +54,7 @@ update-composer: {% else %} - unless: test $(date -d "60 days $({{ install_file }} --version | cut -d ' ' -f 4,5)" "+%s") -gt $(date "+%s") {% endif %} - - cwd: {{ php.local_bin }} + - cwd: {{ php.lookup.pkgs.local_bin }} - env: - HOME: {{ salt_user_home }} - require: diff --git a/php/console-table.sls b/php/console-table.sls new file mode 100644 index 00000000..b196f0e4 --- /dev/null +++ b/php/console-table.sls @@ -0,0 +1,2 @@ +{% set state = 'console-table' %} +{% include "php/installed.jinja" %} diff --git a/php/ctype.sls b/php/ctype.sls new file mode 100644 index 00000000..9ad3c798 --- /dev/null +++ b/php/ctype.sls @@ -0,0 +1,2 @@ +{% set state = 'ctype' %} +{% include "php/installed.jinja" %} diff --git a/php/curl.sls b/php/curl.sls index e633d82a..ebb21113 100644 --- a/php/curl.sls +++ b/php/curl.sls @@ -1,9 +1,2 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-curl: - pkg.installed: - - name: {{ php.curl_pkg }} +{% set state = 'curl' %} +{% include "php/installed.jinja" %} diff --git a/php/dba.sls b/php/dba.sls new file mode 100644 index 00000000..74903cb7 --- /dev/null +++ b/php/dba.sls @@ -0,0 +1,2 @@ +{% set state = 'dba' %} +{% include "php/installed.jinja" %} diff --git a/php/deprecated.sls b/php/deprecated.sls index becb5a12..633d25ed 100644 --- a/php/deprecated.sls +++ b/php/deprecated.sls @@ -1,41 +1,32 @@ # -*- coding: utf-8 -*- # vim: ft=sls -{#- Evaluating as `False` by default, using this method since `defaults.yaml` not available in this repo #} -{%- if not salt['config.get']('php').get('warning_messages', {}).get('v1.0.0', {}).get('mute_critical', False) %} -php-deprecated-in-v1.0.0-test-succeed: - test.succeed_without_changes: +php-deprecated-in-v1.0.0-test-fail: + test.fail_without_changes: - name: | ################################################################################ # # - # WARNING: BREAKING CHANGES IN UPCOMING VERSION `v1.0.0` # + # WARNING: BREAKING CHANGES SINCE `v1.0.0` # # # ################################################################################ # # - # This formula currently provides two methods for managing PHP; the old method # - # under `php` and the new method under `php.ng`. In upcoming `v1.0.0`, the old # - # method will be removed and `php.ng` will be promoted to `php` in its place. # + # Prior to `v1.0.0`, this formula provided two methods for managing PHP; the # + # old method under `php` and the new method under `php.ng`. The old method # + # has now been removed and `php.ng` has been promoted to be `php` in its # + # place. # # # - # If you are not in a position to migrate, you will need to pin your repo to # - # the final release tag before `v1.0.0`, which is expected to be `v0.40.1`. # + # If you are not in a position to migrate, please pin your repo to the final # + # release tag before `v1.0.0`, i.e. `v0.40.1`. # # # - # If you are currently using `php.ng`, there is nothing to do until `v1.0.0` # - # is released. # + # To migrate from `php.ng`, simply modify your pillar to promote the entire # + # section under `php:ng` so that it is under `php` instead. So with the # + # editor of your choice, highlight the entire section and then unindent one # + # level. Finish by removing the `ng:` line. # # # - # To migrate from the old `php`, the first step is to convert to `php.ng`, # - # before `v1.0.0` is released. # - # # - # To prevent this message being displayed again, set the pillar/config value: # - # # - # ``` # - # php: # - # warning_messages: # - # v1.0.0: # - # mute_critical: True # - # ``` # + # To migrate from the old `php`, first convert to `php.ng` under `v0.40.1` # + # and then follow the steps laid out in the paragraph directly above. # # # ################################################################################ - # - failhard: True -{%- endif %} + - failhard: True diff --git a/php/dev.sls b/php/dev.sls index 41e6c62a..10da462d 100644 --- a/php/dev.sls +++ b/php/dev.sls @@ -1,9 +1,2 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-dev: - pkg.installed: - - name: {{ php.dev_pkg }} +{% set state = 'dev' %} +{% include "php/installed.jinja" %} diff --git a/php/dom.sls b/php/dom.sls new file mode 100644 index 00000000..fcbd666b --- /dev/null +++ b/php/dom.sls @@ -0,0 +1,2 @@ +{% set state = 'dom' %} +{% include "php/installed.jinja" %} diff --git a/php/fileinfo.sls b/php/fileinfo.sls new file mode 100644 index 00000000..663a418e --- /dev/null +++ b/php/fileinfo.sls @@ -0,0 +1,2 @@ +{% set state = 'fileinfo' %} +{% include "php/installed.jinja" %} diff --git a/php/ng/files/php.ini b/php/files/php.ini similarity index 100% rename from php/ng/files/php.ini rename to php/files/php.ini diff --git a/php/filter.sls b/php/filter.sls new file mode 100644 index 00000000..e150276e --- /dev/null +++ b/php/filter.sls @@ -0,0 +1,2 @@ +{% set state = 'filter' %} +{% include "php/installed.jinja" %} diff --git a/php/fpm.sls b/php/fpm.sls deleted file mode 100644 index 0777c296..00000000 --- a/php/fpm.sls +++ /dev/null @@ -1,11 +0,0 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - -php-fpm: - pkg.installed: - - name: {{ php.fpm_pkg }} - service.running: - - name: {{ php.fpm_service }} - - enable: True diff --git a/php/fpm/config.sls b/php/fpm/config.sls new file mode 100644 index 00000000..5252bcfc --- /dev/null +++ b/php/fpm/config.sls @@ -0,0 +1,63 @@ +# Manages the php-fpm main ini file +{% from 'php/map.jinja' import php with context %} +{% from "php/ini.jinja" import php_ini %} + +{% set ini_settings = php.ini.defaults %} +{% for key, value in php.fpm.config.ini.settings.items() %} + {% if ini_settings[key] is defined %} + {% do ini_settings[key].update(value) %} + {% else %} + {% do ini_settings.update({key: value}) %} + {% endif %} +{% endfor %} + +{% set pillar_php_ng_version = salt['pillar.get']('php:ng:version', '7.0') %} +{% if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %} + {% for version in pillar_php_ng_version %} + {% set conf_settings = odict(php.lookup.fpm.defaults) %} + {% set first_version = pillar_php_ng_version[0]|string %} + {% set ini = php.lookup.fpm.ini|replace(first_version, version) %} + {% set conf = php.lookup.fpm.conf|replace(first_version, version) %} + {% set pools = php.lookup.fpm.pools|replace(first_version, version) %} + + {% for key, value in conf_settings.items() %} + {% if value is string %} + {% do conf_settings.update({key: value.replace(first_version, version)}) %} + {% endif %} + {% endfor %} + {% do conf_settings.global.update({'pid': '/var/run/php' + version + '-fpm.pid' }) %} + {% do conf_settings.global.update({'error_log': '/var/log/php' + version + '-fpm.log' }) %} + +php_fpm_ini_config_{{ version }}: + {{ php_ini(ini, php.fpm.config.ini.opts, ini_settings) }} + +php_fpm_conf_config_{{ version }}: + {{ php_ini(conf, php.fpm.config.conf.opts, odict(conf_settings)) }} + +{{ pools }}: + file.directory: + - name: {{ pools }} + - user: {{ php.lookup.fpm.user }} + - group: {{ php.lookup.fpm.group }} + - file_mode: 755 + - make_dirs: True + {% endfor %} +{% else %} + +{% set conf_settings = php.lookup.fpm.defaults %} +{% do conf_settings.update(php.fpm.config.conf.settings) %} + +php_fpm_ini_config: + {{ php_ini(php.lookup.fpm.ini, php.fpm.config.ini.opts, ini_settings) }} + +php_fpm_conf_config: + {{ php_ini(php.lookup.fpm.conf, php.fpm.config.conf.opts, conf_settings) }} + +{{ php.lookup.fpm.pools }}: + file.directory: + - name: {{ php.lookup.fpm.pools }} + - user: {{ php.lookup.fpm.user }} + - group: {{ php.lookup.fpm.group }} + - file_mode: 755 + - make_dirs: True +{% endif %} diff --git a/php/fpm/init.sls b/php/fpm/init.sls new file mode 100644 index 00000000..777fda0c --- /dev/null +++ b/php/fpm/init.sls @@ -0,0 +1,44 @@ +# Meta-state to fully install php.fpm + +include: + - php.fpm.config + - php.fpm.service + - php.fpm.pools + +{% set pillar_php_ng_version = salt['pillar.get']('php:ng:version', '7.0') %} +extend: + php_fpm_service: + service: + - watch: + {% if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %} + {% for version in pillar_php_ng_version %} + - file: php_fpm_ini_config_{{ version }} + - file: php_fpm_conf_config_{{ version }} + {% endfor %} + {% else %} + - file: php_fpm_ini_config + - file: php_fpm_conf_config + {% endif %} + - require: + - sls: php.fpm.config + {% if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %} + {% for version in pillar_php_ng_version %} + php_fpm_ini_config_{{ version }}: + file: + - require: + - pkg: php_install_fpm + php_fpm_conf_config_{{ version }}: + file: + - require: + - pkg: php_install_fpm + {% endfor %} + {% else %} + php_fpm_ini_config: + file: + - require: + - pkg: php_install_fpm + php_fpm_conf_config: + file: + - require: + - pkg: php_install_fpm + {% endif %} diff --git a/php/fpm/install.sls b/php/fpm/install.sls new file mode 100644 index 00000000..5cc8d4c2 --- /dev/null +++ b/php/fpm/install.sls @@ -0,0 +1,2 @@ +{% set state = 'fpm' %} +{% include "php/installed.jinja" %} diff --git a/php/fpm/pools.sls b/php/fpm/pools.sls new file mode 100644 index 00000000..bd5cc28d --- /dev/null +++ b/php/fpm/pools.sls @@ -0,0 +1,24 @@ +# Manages the php-fpm pools config files +{% from "php/map.jinja" import php with context %} +{% from "php/macro.jinja" import sls_block %} +{% from "php/fpm/pools_config.sls" import pool_states with context %} + +{% macro file_requisites(states) %} + {%- for state in states %} + - file: {{ state }} + {%- endfor -%} +{% endmacro %} + +include: + - php.fpm.service + - php.fpm.pools_config + +{% if pool_states %} +extend: + php_fpm_service: + service: + - watch: +{{ file_requisites(pool_states) }} + - require: +{{ file_requisites(pool_states) }} +{% endif %} diff --git a/php/fpm/pools_config.sls b/php/fpm/pools_config.sls new file mode 100644 index 00000000..0fc9cb08 --- /dev/null +++ b/php/fpm/pools_config.sls @@ -0,0 +1,45 @@ +# Manages the php-fpm pools config files +{% from 'php/map.jinja' import php with context %} +{% from "php/macro.jinja" import sls_block, serialize %} + +# Simple path concatenation. +{% macro path_join(file, root) -%} + {{ root ~ '/' ~ file }} +{%- endmacro %} + +{% set pool_states = [] %} + +{% for pool, config in php.fpm.pools.items() %} +{% if pool == 'defaults' %}{% continue %}{% endif %} +{% for pkey, pvalues in config.get('settings', {}).items() %} +{% set pool_defaults = php.fpm.pools.get('defaults', {}).copy() %} + {% do pool_defaults.update(pvalues) %} + {% do pvalues.update(pool_defaults) %} +{% endfor %} +{% set state = 'php_fpm_pool_conf_' ~ loop.index0 %} + +{% set pillar_php_ng_version = salt['pillar.get']('php:ng:version', '7.0') %} +{% if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %} + {% set first_fpath = path_join(config.get('filename', pool), php.lookup.fpm.pools) %} + {% set first_version = pillar_php_ng_version[0]|string %} + {% set fpath = first_fpath.replace(first_version, config.get('phpversion', '7.0')) %} +{% else %} + {% set fpath = path_join(config.get('filename', pool), php.lookup.fpm.pools) %} +{% endif %} + +{{ state }}: +{% if config.enabled %} + file.managed: + {{ sls_block(config.get('opts', {})) }} + - name: {{ fpath }} + - source: salt://php/files/php.ini + - template: jinja + - context: + config: {{ serialize(config.get('settings', {})) }} +{% else %} + file.absent: + - name: {{ fpath }} +{% endif %} + +{% do pool_states.append(state) %} +{% endfor %} diff --git a/php/fpm/service.sls b/php/fpm/service.sls new file mode 100644 index 00000000..bed2ff2c --- /dev/null +++ b/php/fpm/service.sls @@ -0,0 +1,18 @@ +# Manages the php-fpm service. +{% from "php/map.jinja" import php with context %} +{% from "php/macro.jinja" import sls_block %} + +{% set service_function = {True:'running', False:'dead'}.get(php.fpm.service.enabled) %} + +include: + - php.fpm.install + +php_fpm_service: + service.{{ service_function }}: + {{ sls_block(php.fpm.service.opts) }} + - name: {{ php.lookup.fpm.service }} + - enable: {{ php.fpm.service.enabled }} + - require: + - sls: php.fpm.install + - watch: + - pkg: php_install_fpm diff --git a/php/gd.sls b/php/gd.sls index 8761e60b..c7973d68 100644 --- a/php/gd.sls +++ b/php/gd.sls @@ -1,9 +1,2 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-gd: - pkg.installed: - - name: {{ php.gd_pkg }} +{% set state = 'gd' %} +{% include "php/installed.jinja" %} diff --git a/php/gearman.sls b/php/gearman.sls new file mode 100644 index 00000000..75bb0a60 --- /dev/null +++ b/php/gearman.sls @@ -0,0 +1,2 @@ +{% set state = 'gearman' %} +{% include "php/installed.jinja" %} diff --git a/php/geoip.sls b/php/geoip.sls new file mode 100644 index 00000000..6269734f --- /dev/null +++ b/php/geoip.sls @@ -0,0 +1,2 @@ +{% set state = 'geoip' %} +{% include "php/installed.jinja" %} diff --git a/php/geshi.sls b/php/geshi.sls new file mode 100644 index 00000000..eab4f5b7 --- /dev/null +++ b/php/geshi.sls @@ -0,0 +1,2 @@ +{% set state = 'geshi' %} +{% include "php/installed.jinja" %} diff --git a/php/gettext.sls b/php/gettext.sls new file mode 100644 index 00000000..623cfde6 --- /dev/null +++ b/php/gettext.sls @@ -0,0 +1,2 @@ +{% set state = 'gettext' %} +{% include "php/installed.jinja" %} diff --git a/php/gmp.sls b/php/gmp.sls new file mode 100644 index 00000000..e70259fa --- /dev/null +++ b/php/gmp.sls @@ -0,0 +1,2 @@ +{% set state = 'gmp' %} +{% include "php/installed.jinja" %} diff --git a/php/hash.sls b/php/hash.sls new file mode 100644 index 00000000..9a6d84d6 --- /dev/null +++ b/php/hash.sls @@ -0,0 +1,2 @@ +{% set state = 'hash' %} +{% include "php/installed.jinja" %} diff --git a/php/hhvm/config.sls b/php/hhvm/config.sls new file mode 100644 index 00000000..78f0cf3b --- /dev/null +++ b/php/hhvm/config.sls @@ -0,0 +1,16 @@ +# Manages the php-hhvm main ini file +{% from "php/map.jinja" import php with context %} +{% from "php/ini.jinja" import php_ini %} + +{% set server_settings = php.lookup.hhvm.server %} +{% do server_settings.update(php.hhvm.config.server.settings) %} + +{% set php_settings = php.lookup.hhvm.php %} +{% do php_settings.update(php.hhvm.config.php.settings) %} + +php_hhvm_ini_config: + {{ php_ini(php.lookup.hhvm.conf, php.hhvm.config.server.opts, server_settings) }} + +php_hhvm_conf_config: + {{ php_ini(php.lookup.hhvm.ini, php.hhvm.config.php.opts, php_settings) }} + diff --git a/php/hhvm/init.sls b/php/hhvm/init.sls new file mode 100644 index 00000000..791925c7 --- /dev/null +++ b/php/hhvm/init.sls @@ -0,0 +1,23 @@ +# Meta-state to fully install php.hhvm + +include: + - php.hhvm.repo + - php.hhvm.config + - php.hhvm.service + +extend: + php_hhvm_service: + service: + - watch: + - file: php_hhvm_ini_config + - file: php_hhvm_conf_config + - require: + - sls: php.hhvm.config + php_hhvm_ini_config: + file: + - require: + - pkg: php_install_hhvm + php_hhvm_conf_config: + file: + - require: + - pkg: php_install_hhvm diff --git a/php/hhvm/install.sls b/php/hhvm/install.sls new file mode 100644 index 00000000..1ccb016f --- /dev/null +++ b/php/hhvm/install.sls @@ -0,0 +1,2 @@ +{% set state = 'hhvm' %} +{% include "php/installed.jinja" %} diff --git a/php/hhvm/repo.sls b/php/hhvm/repo.sls new file mode 100644 index 00000000..84c2b613 --- /dev/null +++ b/php/hhvm/repo.sls @@ -0,0 +1,19 @@ +# Manages the php-hhvm service. +{% from "php/map.jinja" import php with context %} + +include: + - php.hhvm.install + + +{% if salt['grains.get']('os_family') == 'Debian' -%} + +hhvm_repo: + pkgrepo.managed: + - name: deb http://dl.hhvm.com/{{ salt['grains.get']('os')|lower }} {{ salt['grains.get']('oscodename')}} main + - file: /etc/apt/sources.list.d/hhvm.list + - keyid: 0x5a16e7281be7a449 + - keyserver: keyserver.ubuntu.com + - refresh_db: True + - require_in: + - pkg: php_install_hhvm +{%- endif %} diff --git a/php/hhvm/service.sls b/php/hhvm/service.sls new file mode 100644 index 00000000..bf03ff7d --- /dev/null +++ b/php/hhvm/service.sls @@ -0,0 +1,19 @@ +# Manages the php-hhvm service. +{% from "php/map.jinja" import php with context %} +{% from "php/macro.jinja" import sls_block %} + +{% set service_function = {True:'running', False:'dead'}.get(php.hhvm.service.enabled) %} + +include: + - php.hhvm.install + +php_hhvm_service: + service.{{ service_function }}: + {{ sls_block(php.hhvm.service.opts) }} + - name: {{ php.lookup.hhvm.service }} + - enable: {{ php.hhvm.service.enabled }} + - require: + - sls: php.hhvm.install + - watch: + - pkg: php_install_hhvm + diff --git a/php/http.sls b/php/http.sls new file mode 100644 index 00000000..6bd4fc4a --- /dev/null +++ b/php/http.sls @@ -0,0 +1,2 @@ +{% set state = 'http' %} +{% include "php/installed.jinja" %} diff --git a/php/iconv.sls b/php/iconv.sls new file mode 100644 index 00000000..2edaabfe --- /dev/null +++ b/php/iconv.sls @@ -0,0 +1,2 @@ +{% set state = 'iconv' %} +{% include "php/installed.jinja" %} diff --git a/php/igbinary.sls b/php/igbinary.sls new file mode 100644 index 00000000..725b5277 --- /dev/null +++ b/php/igbinary.sls @@ -0,0 +1,2 @@ +{% set state = 'igbinary' %} +{% include "php/installed.jinja" %} diff --git a/php/imagick.sls b/php/imagick.sls index 1c8cd58a..633bfd06 100644 --- a/php/imagick.sls +++ b/php/imagick.sls @@ -1,9 +1,2 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-imagick: - pkg.installed: - - name: {{ php.imagick_pkg }} +{% set state = 'imagick' %} +{% include "php/installed.jinja" %} diff --git a/php/imap.sls b/php/imap.sls index 79649fa7..30becdb7 100644 --- a/php/imap.sls +++ b/php/imap.sls @@ -1,9 +1,2 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-imap: - pkg.installed: - - name: {{ php.imap_pkg }} +{% set state = 'imap' %} +{% include "php/installed.jinja" %} diff --git a/php/ng/ini.jinja b/php/ini.jinja similarity index 74% rename from php/ng/ini.jinja rename to php/ini.jinja index d63b9601..feeb574c 100644 --- a/php/ng/ini.jinja +++ b/php/ini.jinja @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- # vim: ft=jinja {# php.ini management macro. #} -{% from "php/ng/macro.jinja" import sls_block, serialize %} +{% from "php/macro.jinja" import sls_block, serialize %} {% macro php_ini(filename, opts={}, settings={}) %} file.managed: {{ sls_block(opts) }} - name: {{ filename }} - - source: salt://php/ng/files/php.ini + - source: salt://php/files/php.ini - template: jinja - context: config: {{ serialize(odict(settings)) }} diff --git a/php/init.sls b/php/init.sls index ab84c03c..db1b2542 100644 --- a/php/init.sls +++ b/php/init.sls @@ -1,33 +1,2 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - -{%- if not 'ng' in salt['pillar.get']('php', {}) %} - - {%- if grains['os'] == "Ubuntu" %} - {%- set use_external_repo = salt['pillar.get']('php:use_external_repo', False) %} - - {%- if use_external_repo %} - {%- set external_repo_name = salt['pillar.get']('php:external_repo_name', 'ondrej/php') %} - -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 - - {%- endif %} - - {%- endif %} - -php: - pkg.installed: - - name: {{ php.php_pkg }} - -{%- endif %} \ No newline at end of file +{% set state = 'php' %} +{% include "php/installed.jinja" %} diff --git a/php/ng/installed.jinja b/php/installed.jinja similarity index 95% rename from php/ng/installed.jinja rename to php/installed.jinja index ad2f2e8d..59d18d7e 100644 --- a/php/ng/installed.jinja +++ b/php/installed.jinja @@ -1,8 +1,8 @@ # -*- 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 %} +{% from "php/map.jinja" import php with context %} +{% from "php/macro.jinja" import sls_block %} {% set pkginfo = php.lookup.pkgs.get(state) %} @@ -89,7 +89,7 @@ php_ppa_{{ state }}: {% elif grains['os_family'] == "RedHat" and (state == 'cli' or state == 'fpm' or state == 'php') %} {% set use_scl_repo = salt['pillar.get']('php:use_scl_repo', False) %} {% set scl_php_version = salt['pillar.get']('php:scl_php_version', 71) %} - {% set enable_php_repo = salt['pillar.get']('php:ng:lookup:enable_php_repo', False) %} + {% set enable_php_repo = salt['pillar.get']('php:lookup:enable_php_repo', False) %} {% if use_scl_repo and grains['os'] == 'CentOS' %} php_centos_scl_enable_{{ state }}: pkg.installed: diff --git a/php/intl.sls b/php/intl.sls index 5b594f44..2a53842e 100644 --- a/php/intl.sls +++ b/php/intl.sls @@ -1,9 +1,2 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-intl: - pkg.installed: - - name: {{ php.intl_pkg }} +{% set state = 'intl' %} +{% include "php/installed.jinja" %} diff --git a/php/json.sls b/php/json.sls index aff16ac2..9250c3bb 100644 --- a/php/json.sls +++ b/php/json.sls @@ -1,9 +1,2 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-json: - pkg.installed: - - name: {{ php.json_pkg }} +{% set state = 'json' %} +{% include "php/installed.jinja" %} diff --git a/php/ldap.sls b/php/ldap.sls index 8c4cab6e..8e4ce4ef 100644 --- a/php/ldap.sls +++ b/php/ldap.sls @@ -1,9 +1,2 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-ldap: - pkg.installed: - - name: {{ php.ldap_pkg }} +{% set state = 'ldap' %} +{% include "php/installed.jinja" %} diff --git a/php/ng/macro.jinja b/php/macro.jinja similarity index 100% rename from php/ng/macro.jinja rename to php/macro.jinja diff --git a/php/mail.sls b/php/mail.sls index 953622af..46a04175 100644 --- a/php/mail.sls +++ b/php/mail.sls @@ -1,9 +1,2 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-mail: - pkg.installed: - - name : {{ php.mail_pkg }} +{% set state = 'mail' %} +{% include "php/installed.jinja" %} diff --git a/php/map.jinja b/php/map.jinja index f5c476f1..9fc102cd 100644 --- a/php/map.jinja +++ b/php/map.jinja @@ -1,500 +1,3247 @@ # -*- coding: utf-8 -*- # vim: ft=jinja +{% set pillar_php_version = salt['pillar.get']('php:version', '7.0') %} +{%- if pillar_php_version is iterable and pillar_php_version is not string %} + {%- set php_version = pillar_php_version[0]|string %} +{% else %} + {%- set php_version = pillar_php_version|string %} +{% endif %} +{%- set freebsd_php_version = php_version.replace('.', '') %} + {%- 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', + {%- set php = salt['pillar.get']('php', { + 'lookup': salt['grains.filter_by']({ + 'Debian': { + 'pkgs': { + 'adodb': 'libphp-adodb', + 'apache2': 'libapache2-mod-php' + php_version, + 'apc': 'php-apcu', + 'apcu': 'php-apcu-bc', + 'bcmath': 'php' + php_version + '-bcmath', + 'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev', 'pkg-config', 'libsslcommon2-dev', 'gcc', 'make', 'autoconf', 'libc-dev', 'pkg-config'], + 'bz2': 'php' + php_version + '-bz2', + 'cache-lite': 'php-cache-lite', + 'cgi': 'php' + php_version + '-cgi', + 'cli': 'php' + php_version + '-cli', + 'composer_bin': 'composer', + 'console-table': 'php-console-table', + 'curl': 'php' + php_version + '-curl', + 'dba': 'php' + php_version + '-dba', + 'dev': 'php' + php_version + '-dev', + 'ext_conf_path': '/etc/php/' + php_version + '/mods-available', + 'fpm': 'php' + php_version + '-fpm', + 'gd': 'php' + php_version + '-gd', + 'gearman': 'php-gearman', + 'geoip': 'php-geoip', + 'geshi': 'php-geshi', + 'gettext': 'php' + php_version, + 'gmp': 'php' + php_version + '-gmp', + 'hhvm': 'hhvm', + 'imagick': 'php-imagick', + 'imap': 'php' + php_version + '-imap', + 'intl': 'php' + php_version + '-intl', + 'json': 'php' + php_version + '-json', + 'ldap': 'php' + php_version + '-ldap', + 'local_bin': '/usr/local/bin', + 'auth-sasl': 'php-auth-sasl', + 'mail': 'php-mail', + 'mbstring': 'php' + php_version + '-mbstring', + 'mcrypt': 'php' + php_version + '-mcrypt', + 'memcache': 'php-memcache', + 'memcached': 'php-memcached', + 'mongo': 'php-mongo', + 'mongodb': 'php-mongodb', + 'mysql': 'php' + php_version + '-mysql', + 'mysqlnd': 'php' + php_version + '-mysql', + 'net-smtp': 'php-net-smtp', + 'net4': 'php-net-ipv4', + 'net6': 'php-net-ipv6', + 'oauth': 'php-oauth', + 'opcache': 'php' + php_version + '-opcache', + 'pear': 'php-pear', + 'pgsql': 'php' + php_version + '-pgsql', + 'php': 'php' + php_version, + 'phpenmod_command': 'phpenmod -v' + php_version, + 'pspell': 'php' + php_version + '-pspell', + 'redis': 'php' + php_version + '-redis', + 'seclib': ['php-phpseclib', 'php-seclib'], + 'snmp': 'php' + php_version + '-snmp', + 'soap': 'php' + php_version + '-soap', + 'ssh2': 'php-ssh2', + 'sqlite': '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', + 'sybase': 'php' + php_version + '-sybase', + 'tcpdf': 'php-tcpdf', + 'temp_dir': '/tmp', + 'tidy': 'php' + php_version + '-tidy', + 'xdebug': 'php' + php_version + '-xdebug', + 'xml': ['php' + php_version + '-xml', 'php' + php_version + '-xmlrpc'], + 'xsl': 'php' + php_version + '-xsl', + 'zip': 'php' + php_version + '-zip', + }, + 'fpm': { + 'conf': '/etc/php/' + php_version + '/fpm/php-fpm.conf', + 'ini': '/etc/php/' + php_version + '/fpm/php.ini', + 'pools': '/etc/php/' + php_version + '/fpm/pool.d', + 'service': 'php' + php_version + '-fpm', + 'user': 'root', + 'group': 'root', + 'defaults': odict([ + ('global', odict([ + ('pid', '/var/run/php' + php_version + '-fpm.pid'), + ('error_log', '/var/log/php' + php_version + '-fpm.log'), + ])), + ('include', '/etc/php/' + php_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/' + php_version + '/cli/php.ini', + }, + 'apache2': { + 'ini': '/etc/php/' + php_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) %} + {%- else %} + {%- set php = salt['pillar.get']('php', { + 'lookup': salt['grains.filter_by']({ + 'Debian': { + 'pkgs': { + 'adodb': 'libphp-adodb', + 'apache2': 'libapache2-mod-php' + php_version, + 'apc': 'php-apcu', + 'apcu': 'php-apcu-bc', + 'bcmath': 'php' + php_version + '-bcmath', + 'bz2': 'php' + php_version + '-bz2', + 'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev', 'gcc', 'make', 'autoconf', 'libc-dev', 'pkg-config'], + 'cache-lite': 'php-cache-lite', + 'cgi': 'php' + php_version + '-cgi', + 'cli': 'php' + php_version + '-cli', + 'composer_bin': 'composer', + 'console-table': 'php-console-table', + 'curl': 'php' + php_version + '-curl', + 'dba': 'php' + php_version + '-dba', + 'dev': 'php' + php_version + '-dev', + 'ext_conf_path': '/etc/php/' + php_version + '/mods-available', + 'fpm': 'php' + php_version + '-fpm', + 'gd': 'php' + php_version + '-gd', + 'gearman': 'php-gearman', + 'geoip': 'php-geoip', + 'geshi': 'php-geshi', + 'gettext': 'php' + php_version, + 'gmp': 'php' + php_version + '-gmp', + 'hhvm': 'hhvm', + 'imagick': 'php-imagick', + 'imap': 'php' + php_version + '-imap', + 'intl': 'php' + php_version + '-intl', + 'json': 'php' + php_version + '-json', + 'ldap': 'php' + php_version + '-ldap', + 'local_bin': '/usr/local/bin', + 'auth-sasl': 'php-auth-sasl', + 'mail': 'php-mail', + 'mbstring': 'php' + php_version + '-mbstring', + 'mcrypt': 'php' + php_version + '-mcrypt', + 'memcache': 'php-memcache', + 'memcached': 'php-memcached', + 'mongo': 'php-mongo', + 'mongodb': 'php-mongodb', + 'mysql': 'php' + php_version + '-mysql', + 'mysqlnd': 'php' + php_version + '-mysql', + 'net-smtp': 'php-net-smtp', + 'net4': 'php-net-ipv4', + 'net6': 'php-net-ipv6', + 'oauth': 'php-oauth', + 'opcache': 'php' + php_version + '-opcache', + 'pear': 'php-pear', + 'pgsql': 'php' + php_version + '-pgsql', + 'php': 'php' + php_version, + 'phpenmod_command': 'phpenmod -v' + php_version, + 'pspell': 'php' + php_version + '-pspell', + 'readline': 'php' + php_version + '-readline', + 'redis': 'php' + php_version + '-redis', + 'seclib': 'php-seclib', + 'snmp': 'php' + php_version + '-snmp', + 'soap': 'php' + php_version + '-soap', + 'ssh2': 'php-ssh2', + 'sqlite': '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', + 'sybase': 'php' + php_version + '-sybase', + 'tcpdf': 'php-tcpdf', + 'temp_dir': '/tmp', + 'tidy': 'php' + php_version + '-tidy', + 'xdebug': 'php' + php_version + '-xdebug', + 'xml': ['php' + php_version + '-xml', 'php' + php_version + '-xmlrpc'], + 'xsl': 'php' + php_version + '-xsl', + 'zip': 'php' + php_version + '-zip', + }, + 'fpm': { + 'conf': '/etc/php/' + php_version + '/fpm/php-fpm.conf', + 'ini': '/etc/php/' + php_version + '/fpm/php.ini', + 'pools': '/etc/php/' + php_version + '/fpm/pool.d', + 'service': 'php' + php_version + '-fpm', + 'user': 'root', + 'group': 'root', + 'defaults': odict([ + ('global', odict([ + ('pid', '/var/run/php' + php_version + '-fpm.pid'), + ('error_log', '/var/log/php' + php_version + '-fpm.log'), + ])), + ('include', '/etc/php/' + php_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/' + php_version + '/cli/php.ini', + }, + 'apache2': { + 'ini': '/etc/php/' + php_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 >= '18.04' %} + {%- set php = salt['pillar.get']('php', { + 'lookup': salt['grains.filter_by']({ + 'Ubuntu': { + 'pkgs': { + 'adodb': 'libphp-adodb', + 'apache2': 'libapache2-mod-php', + 'apc': 'php', + 'apcu': 'php-apcu', + 'bcmath': 'php7.2-bcmath', + 'bz2': 'php7.2-bz2', + 'cache-lite': 'php-cache-lite', + 'cgi': 'php-cgi', + 'cli': 'php-cli', + 'console-table': 'php-console-table', + 'composer_bin': 'composer', + 'curl': 'php-curl', + 'dev': 'php7.2-dev', + 'dba': 'php7.2-dba', + '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', + 'local_bin': '/usr/local/bin', + 'auth-sasl': 'php-auth-sasl', + 'mail': 'php-mail', + 'mbstring': 'php-mbstring', + 'mcrypt': 'php-mcrypt', + 'memcache': 'php-memcache', + 'memcached': 'php-memcached', + 'mongodb': 'php-mongodb', + 'mysql': 'php-mysql', + 'mysqlnd': 'php', + 'net-smtp': 'php-net-smtp', + 'net4': 'php-net-ipv4', + 'net6': 'php-net-ipv6', + 'oauth': 'php-oauth', + 'opcache': 'php7.2-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', + 'sybase': 'php-sybase', + 'tcpdf': 'php-tcpdf', + 'temp_dir': '/tmp', + 'tidy': 'php7.2-tidy', + 'xcache': 'php', + 'xdebug': 'php-xdebug', + 'xml': ['php-xml', 'php-xmlrpc'], + 'xsl': 'php7.2-xsl', + 'zip': 'php-zip', + }, + 'fpm': { + 'conf': '/etc/php/7.2/fpm/php-fpm.conf', + 'ini': '/etc/php/7.2/fpm/php.ini', + 'pools': '/etc/php/7.2/fpm/pool.d', + 'service': 'php7.2-fpm', + 'user': 'root', + 'group': 'root', + 'defaults': odict([ + ('global', odict([ + ('pid', '/var/run/php7.2-fpm.pid'), + ('error_log', '/var/log/php7.2-fpm.log'), + ])), + ('include', '/etc/php/7.2/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.2/cli/php.ini', + }, + 'apache2': { + 'ini': '/etc/php/7.2/apache2/php.ini', + }, + 'xcache': { + 'ini': '/etc/php/7.2/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': { + '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': { + '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) %} + {%- elif salt['grains.get']('osrelease')|string >= '17.10' %} + {%- set php = salt['pillar.get']('php', { + 'lookup': salt['grains.filter_by']({ + 'Ubuntu': { + 'pkgs': { + 'adodb': 'libphp-adodb', + 'apache2': 'libapache2-mod-php', + 'apc': 'php', + 'apcu': 'php-apcu', + 'bcmath': 'php7.1-bcmath', + 'bz2': 'php7.1-bz2', + 'cache-lite': 'php-cache-lite', + 'cgi': 'php-cgi', + 'cli': 'php-cli', + 'console-table': 'php-console-table', + 'composer_bin': 'composer', + 'curl': 'php-curl', + 'dba': 'php7.1-dba', + 'dev': 'php7.1-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', + 'local_bin': '/usr/local/bin', + 'auth-sasl': 'php-auth-sasl', + 'mail': 'php-mail', + 'mbstring': 'php-mbstring', + 'mcrypt': 'php-mcrypt', + 'memcache': 'php-memcache', + 'memcached': 'php-memcached', + 'mongodb': 'php-mongodb', + 'mysql': 'php-mysql', + 'mysqlnd': 'php', + 'net-smtp': 'php-net-smtp', + 'net4': 'php-net-ipv4', + 'net6': 'php-net-ipv6', + 'oauth': 'php-oauth', + 'opcache': 'php7.1-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', + 'sybase': 'php-sybase', + 'tcpdf': 'php-tcpdf', + 'temp_dir': '/tmp', + 'tidy': 'php7.1-tidy', + 'xcache': 'php', + 'xdebug': 'php-xdebug', + 'xml': ['php-xml', 'php-xmlrpc'], + 'xsl': 'php7.1-xsl', + 'zip': 'php-zip', + }, + 'fpm': { + 'conf': '/etc/php/7.1/fpm/php-fpm.conf', + 'ini': '/etc/php/7.1/fpm/php.ini', + 'pools': '/etc/php/7.1/fpm/pool.d', + 'service': 'php7.1-fpm', + 'user': 'root', + 'group': 'root', + 'defaults': odict([ + ('global', odict([ + ('pid', '/var/run/php7.1-fpm.pid'), + ('error_log', '/var/log/php7.1-fpm.log'), + ])), + ('include', '/etc/php/7.1/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.1/cli/php.ini', + }, + 'apache2': { + 'ini': '/etc/php/7.1/apache2/php.ini', + }, + 'xcache': { + 'ini': '/etc/php/7.1/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': { + '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': { + '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) %} + {%- elif salt['grains.get']('osrelease')|string >= '16.04' %} + {%- set php = salt['pillar.get']('php', { + 'lookup': salt['grains.filter_by']({ + 'Ubuntu': { + 'pkgs': { + 'adodb': 'libphp-adodb', + 'apache2': 'libapache2-mod-php', + 'apc': 'php', + 'apcu': 'php-apcu', + 'bcmath': 'php7.0-bcmath', + 'bz2': 'php7.0-bz2', + 'cache-lite': 'php-cache-lite', + 'cgi': 'php-cgi', + 'cli': 'php-cli', + 'console-table': 'php-console-table', + 'composer_bin': 'composer', + 'curl': 'php-curl', + 'dba': 'php7.0-dba', + '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', + 'local_bin': '/usr/local/bin', + 'auth-sasl': 'php-auth-sasl', + 'mail': 'php-mail', + 'mbstring': 'php-mbstring', + 'mcrypt': 'php-mcrypt', + 'memcache': 'php-memcache', + 'memcached': 'php-memcached', + 'mongodb': 'php-mongodb', + 'mysql': 'php-mysql', + 'mysqlnd': 'php', + 'net-smtp': 'php-net-smtp', + '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', + 'sybase': 'php-sybase', + 'tcpdf': 'php-tcpdf', + 'temp_dir': '/tmp', + 'tidy': 'php7.0-tidy', + 'xcache': 'php', + 'xdebug': 'php-xdebug', + 'xml': ['php-xml', 'php-xmlrpc'], + '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', + 'user': 'root', + 'group': 'root', + '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': { + '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': { + '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', { + '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', + 'auth-sasl': 'php-auth-sasl', + 'mail': 'php-mail', + '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', + 'net-smtp': 'php-net-smtp', + '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', + 'user': 'root', + 'group': 'root', + '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': {}, + }, + }, + }, + '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': { + '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 %} + {%- endif %} +{%- elif salt['grains.get']('os') == "Debian" %} + {%- if php_version|string == '5' %} + {%- set confdir = '/etc/php5' %} + {%- else %} + {%- set confdir = '/etc/php/' + php_version %} + {%- endif %} + {%- set php = salt['pillar.get']('php', { + 'lookup': salt['grains.filter_by']({ + 'Debian': { + 'pkgs': { + 'adodb': 'libphp-adodb', + 'apache2': 'libapache2-mod-php' + php_version, + 'apc': 'php-apcu', + 'apcu': 'php-apcu-bc', + 'bcmath': 'php' + php_version + '-bcmath', + 'bz2': 'php' + php_version + '-bz2', + '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' + php_version + '-cgi', + 'cli': 'php' + php_version + '-cli', + 'composer_bin': 'composer', + 'console-table': 'php-console-table', + 'curl': 'php' + php_version + '-curl', + 'dba': 'php' + php_version + '-dba', + 'dev': 'php' + php_version + '-dev', + 'ext_conf_path': '/etc/php/' + php_version + '/mods-available', + 'fpm': 'php' + php_version + '-fpm', + 'gd': 'php' + php_version + '-gd', + 'gearman': 'php-gearman', + 'geoip': 'php-geoip', + 'geshi': 'php-geshi', + 'gettext': 'php' + php_version, + 'gmp': 'php' + php_version + '-gmp', + 'hhvm': 'hhvm', + 'igbinary': 'php-igbinary', + 'imagick': 'php-imagick', + 'imap': 'php' + php_version + '-imap', + 'intl': 'php' + php_version + '-intl', + 'json': 'php' + php_version + '-json', + 'ldap': 'php' + php_version + '-ldap', + 'local_bin': '/usr/local/bin', + 'auth-sasl': 'php-auth-sasl', + 'mail': 'php-mail', + 'mbstring': 'php' + php_version + '-mbstring', + 'mcrypt': 'php' + php_version + '-mcrypt', + 'memcache': 'php-memcache', + 'memcached': 'php-memcached', + 'mongo': 'php-mongo', + 'mongodb': 'php-mongodb', + 'msgpack': 'php-msgpack', + 'mysql': 'php' + php_version + '-mysql', + 'mysqlnd': 'php' + php_version + '-mysql', + 'net-smtp': 'php-net-smtp', + 'net4': 'php-net-ipv4', + 'net6': 'php-net-ipv6', + 'oauth': 'php-oauth', + 'opcache': 'php' + php_version + '-opcache', + 'pear': 'php-pear', + 'pgsql': 'php' + php_version + '-pgsql', + 'php': 'php' + php_version, + 'phpenmod_command': 'phpenmod -v' + php_version, + 'pspell': 'php' + php_version + '-pspell', + 'readline': 'php' + php_version + '-readline', + 'redis': 'php-redis', + 'seclib': ['php-phpseclib', 'php-seclib'], + 'snmp': 'php' + php_version + '-snmp', + 'soap': 'php' + php_version + '-soap', + 'ssh2': 'php-ssh2', + 'sqlite': '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', + 'sybase': 'php' + php_version + '-sybase', + 'tcpdf': 'php-tcpdf', + 'temp_dir': '/tmp', + 'tidy': 'php' + php_version + '-tidy', + 'xdebug': 'php' + php_version + '-xdebug', + 'xml': ['php' + php_version + '-xml', 'php' + php_version + '-xmlrpc'], + 'xsl': 'php' + php_version + '-xsl', + 'zip': 'php' + php_version + '-zip', + }, + 'fpm': { + 'conf': confdir + '/fpm/php-fpm.conf', + 'ini': confdir + '/fpm/php.ini', + 'pools': confdir + '/fpm/pool.d', + 'user': 'root', + 'group': 'root', + 'service': 'php' + php_version + '-fpm', + 'user': 'root', + 'group': 'root', + 'defaults': odict([ + ('global', odict([ + ('pid', '/var/run/php' + php_version + '-fpm.pid'), + ('error_log', '/var/log/php' + php_version + '-fpm.log'), + ])), + ('include', confdir + '/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': confdir + '/cli/php.ini', + }, + 'apache2': { + 'ini': confdir + '/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) %} +{%- else %} + {%- set useversion = php_version | replace(".", "-") -%} + {#- Red Hat Softwarecollection prefix lookup belongs to the Red Hat part + further down but has to go here due to Jinja parsing rules. -#} + {%- if salt['pillar.get']('php:use_scl_repo', False) -%} + {%- set rh_prefix = 'rh-php{}-'.format(salt['pillar.get']('php:scl_php_version', '')) -%} + {%- set sclo_prefix = 'sclo-php{}-'.format(salt['pillar.get']('php:scl_php_version', '')) -%} + {%- set path_suffix = 'opt/rh/rh-php{}/'.format(salt['pillar.get']('php:scl_php_version', '')) -%} + {%- else -%} + {%- set rh_prefix = '' -%} + {%- set sclo_prefix = '' -%} + {%- set path_suffix = '' -%} + {%- endif -%} + {%- set php = salt['pillar.get']('php', { + 'lookup': salt['grains.filter_by']({ + 'Debian': { + 'pkgs': { + 'adodb': 'php5-adodb', + 'apache2': 'libapache2-mod-php5', + 'apc': 'php-apc', + 'apcu': 'php5-apcu', + 'bcmath': 'php5', + 'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev'], + 'bz2': 'php5-bz2', + 'cache-lite': 'php-cache-lite', + 'cgi': 'php5-cgi', + 'cli': 'php5-cli', + 'console-table': 'php-console-table', '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', + 'curl': 'php5-curl', + 'dba': 'php5-dba', + 'dev': ['php5-dev','build-essential'], + 'ext_conf_path': '/etc/php5/mods-available', + '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', - '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', + 'auth-sasl': 'php-auth-sasl', + 'mail': 'php-mail', + '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', + 'net-smtp': 'php-net-smtp', + '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', + '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', - 'sybase_pkg': 'php' + php_version + '-sybase', + 'svn': 'php5-svn', + 'sybase': 'php5-sybase', + 'tcpdf': 'php-tcpdf', 'temp_dir': '/tmp', - 'xml_pkg': 'php' + php_version + '-xml', - 'zip_pkg': 'php' + php_version + '-zip', - } - }, 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', + 'tidy': 'php5-tidy', + 'uuid': 'php-uuid', + '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', + 'user': 'root', + 'group': 'root', + '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': {}, + }, + }, + 'Gentoo' : { + 'pkgs': { + 'apache2': [{'name': 'dev-lang/php','version': ':' + php_version + '[apache2]'}], + 'apc': [{'name': 'dev-php/pecl-apcu_bc','version': '[php_targets_php' + useversion + ']'}], + 'apcu': [{'name': 'dev-php/pecl-apcu','version': '[php_targets_php' + useversion + ']'}], + 'bcmath': [{'name': 'dev-lang/php','version': ':' + php_version + '[bcmath]'}], + 'bz2': [{'name': 'dev-lang/php','version': ':' + php_version + '[bzip2]'}], + 'cache-lite': 'dev-php/PEAR-Cache_Lite', + 'cgi': [{'name': 'dev-lang/php','version': ':' + php_version + '[cgi]'}], + 'cli': [{'name': 'dev-lang/php','version': ':' + 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', + 'console-table': 'dev-php/PEAR-Console_Table', + 'curl': [{'name': 'dev-lang/php','version': ':' + php_version + '[curl]'}], + 'ext_conf_path': '/etc/php/fpm-php' + php_version + '/ext', + 'fpm': [{'name': 'dev-lang/php','version': ':' + php_version + '[fpm]'}], + 'gd': [{'name': 'dev-lang/php','version': ':' + php_version + '[gd]'}], + 'geoip': [{'name': 'dev-php/pecl-geoip','version': '[php_targets_php' + useversion + ']'}], + 'gettext': 'dev-php/PEAR-File_Gettext', + 'gmp': [{'name': 'dev-lang/php','version': ':' + php_version + '[gmp]'}], + 'imagick': [{'name': 'dev-php/pecl-imagick','version': '[php_targets_php' + useversion + ']'}], + 'imap': [{'name': 'dev-lang/php','version': ':' + php_version + '[imap]'}], + 'intl': [{'name': 'dev-lang/php','version': ':' + php_version + '[intl]'}], + 'json': [{'name': 'dev-lang/php','version': ':' + php_version + '[json]'}], + 'ldap': [{'name': 'dev-lang/php','version': ':' + 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', - 'sybase_pkg': 'php' + php_version + '-sybase', + 'auth-sasl': 'dev-php/PEAR-Auth_SASL', + 'mail': 'dev-php/PHPMailer', + 'memcache': [{'name': 'dev-php/pecl-memcache','version': '[php_targets_php' + useversion + ']'}], + 'memcached': [{'name': 'dev-php/pecl-memcached','version': '[php_targets_php' + useversion + ']'}], + 'mongo': [{'name': 'dev-php/pecl-mongo','version': '[php_targets_php' + useversion + ']'}], + 'mongodb': [{'name': 'dev-php/pecl-mongodb','version': '[php_targets_php' + useversion + ']'}], + 'mysqlnd': [{'name': 'dev-lang/php','version': ':' + php_version + '[mysql]'}], + 'mysql': [{'name': 'dev-lang/php','version': ':' + php_version + '[mysqli]'}], + 'net-smtp': 'dev-php/PEAR-Net_SMTP', + 'net4': 'dev-php/PEAR-Net_IPv4', + 'net6': 'dev-php/PEAR-Net_IPv6', + 'oauth': [{'name': 'dev-php/pecl-oauth','version': '[php_targets_php' + useversion + ']'}], + 'opcache': [{'name': 'dev-lang/php','version': ':' + php_version + '[opcache]'}], + 'pear': 'dev-php/pear', + 'pgsql': [{'name': 'dev-lang/php','version': ':' + php_version + '[postgres]'}], + 'php': [{'name': 'dev-lang/php','version': ':' + php_version}], + 'pspell': [{'name': 'dev-lang/php','version': ':' + php_version + '[spell]'}], + 'redis': [{'name': 'dev-php/pecl-redis','version': '[php_targets_php' + useversion + ']'}], + 'snmp': [{'name': 'dev-lang/php','version': ':' + php_version + '[snmp]'}], + 'soap': [{'name': 'dev-lang/php','version': ':' + php_version + '[soap]'}], + 'ssh2': [{'name': 'dev-php/pecl-ssh2','version': '[php_targets_php' + useversion + ']'}], + 'sqlite': [{'name': 'dev-lang/php','version': ':' + php_version + '[sqlite]'}], + 'sybase': [{'name': 'dev-lang/php','version': ':' + php_version + '[sybase-ct]'}], + 'tcpdf': 'dev-php/tcpdf', '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 >= '17.10' %} - {# Ubuntu 17.10+ 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', + 'tidy': [{'name': 'dev-lang/php','version': ':' + php_version + '[tidy]'}], + 'xdebug': [{'name': 'dev-lang/php','version': ':' + php_version + '[debug]'}], + 'xml': [{'name': 'dev-lang/php','version': ':' + php_version + '[xml]'}], + 'xsl': [{'name': 'dev-lang/php','version': ':' + php_version + '[xslt]'}], + 'zip': [{'name': 'dev-lang/php','version': ':' + php_version + '[zip]'}], + }, + 'fpm': { + 'conf': '/etc/php/fpm-php' + php_version + '/php-fpm.conf', + 'ini': '/etc/php/fpm-php' + php_version + '/php.ini', + 'pools': '/etc/php/fpm-php' + php_version + '/fpm.d', + 'service': 'php-fpm', + 'user': 'root', + 'group': 'root', + 'defaults': odict([ + ('global', odict([ + ('pid', '/var/run/php-fpm-php' + php_version + '.pid'), + ('error_log', '/var/log/php' + php_version + '-fpm.log'), + ])), + ('include', '/etc/php/fpm-php' + php_version + '/fpm.d/*.conf'), + ]), + }, + 'cli': { + 'ini': '/etc/php/cli-php' + php_version + '/php.ini', + }, + 'apache2': { + 'ini': '/etc/php/apache2-php' + php_version + '/php.ini', + }, + }, + 'RedHat': { + 'pkgs': { + 'adodb': 'php-adodb', + 'apc': 'php-pecl-apc', + 'apcu': rh_prefix + 'php-pecl-apcu', + 'bcmath': rh_prefix + 'php-bcmath', + 'build_pkgs': ['openssl-devel', 'gcc'], + 'cache-lite': 'php-pear-Cache-Lite', + 'cgi': rh_prefix + 'php-cgi', + 'cli': rh_prefix + 'php-cli', + 'composer': 'composer', 'composer_bin': 'composer', - 'curl_pkg': 'php-curl', - 'dev_pkg': 'php-dev', - 'ext_conf_path': '/etc/php/7.1/mods-available', - 'fpm_pkg': 'php-fpm', - 'fpm_service': 'php7.1-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', + 'console-table': 'php-pear-Console-Table', + 'curl': [rh_prefix + 'php-common', 'curl'], + 'dba': [rh_prefix + 'php-dba', 'dba'], + 'dev': rh_prefix + 'php-devel', + 'ext_conf_path': '/etc/' + path_suffix + 'php.d', + 'fpm': rh_prefix + 'php-fpm', + 'gd': rh_prefix + 'php-gd', + 'geoip': sclo_prefix + 'php-pecl-geoip', + 'geshi': 'php-geshi', + 'gettext': 'php-php-gettext', + 'http': sclo_prefix + 'php-pecl-http', + 'imagick': sclo_prefix + 'php-pecl-imagick', + 'imap': sclo_prefix + 'php-imap', + 'intl': rh_prefix + 'php-intl', + 'json': rh_prefix + 'php-common', + 'ldap': rh_prefix + '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.1/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', + 'auth-sasl': 'php-pear-Auth-SASL', + 'mail': 'php-pear-Mail', + 'mbstring': rh_prefix + 'php-mbstring', + 'mcrypt': sclo_prefix + 'php-mcrypt', + 'memcache': 'php-pecl-memcache', + 'memcached': sclo_prefix + 'php-pecl-memcached', + 'mysql': 'php-mysql', + 'mysqlnd': rh_prefix + 'php-mysqlnd', + 'net-smtp': 'php-pear-Net-SMTP', + 'net4': 'php-pear-Net-IPv4', + 'oauth': 'php-pecl-oauth', + 'opcache': rh_prefix + 'php-opcache' if salt['pillar.get']('php:use_scl_repo', False) else 'php-pecl-zendopcache', + 'pear': rh_prefix + 'php-pear', + 'pgsql': rh_prefix + 'php-pgsql', + 'php': rh_prefix + 'php', + 'pspell': rh_prefix + 'php-pspell', + 'redis': sclo_prefix + 'php-pecl-redis', + 'seclib': 'php-phpseclib', + 'snmp': rh_prefix + 'php-snmp', + 'soap': rh_prefix + 'php-soap', + 'sqlite': rh_prefix + 'php-pdo', + 'ssh2': sclo_prefix + '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', - 'sybase_pkg': 'php-sybase', + 'tcpdf': 'php-tcpdf', 'temp_dir': '/tmp', - 'xml_pkg': 'php-xml', - 'zip_pkg': 'php-zip', - } - }, grain="os", merge=salt['pillar.get']('php:lookup')) %} - {%- elif 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', + 'tidy': sclo_prefix + 'php-tidy', + 'uuid': sclo_prefix + 'php-pecl-uuid', + 'xcache': 'php-xcache', + 'xdebug': sclo_prefix + 'php-pecl-xdebug', + 'xml': [rh_prefix + 'php-xml', rh_prefix + 'php-xmlrpc'], + 'xsl': rh_prefix + 'php-xml', + 'zip': rh_prefix + 'php', + }, + 'fpm': { + 'conf': '/etc/' + path_suffix + 'php-fpm.conf', + 'ini': '/etc/' + path_suffix + 'php.ini', + 'pools': '/etc/' + path_suffix + 'php-fpm.d', + 'service': rh_prefix + 'php-fpm', + 'user': 'root', + 'group': 'root', + 'defaults': { + 'global': { + 'pid': '/var/' + path_suffix + 'run/php-fpm/php-fpm.pid', + 'error_log': '/var/' + path_suffix + 'log/php-fpm/error.log', + }, + 'include': '/etc/' + path_suffix + 'php-fpm.d/*.conf', + }, + }, + 'cli': { + 'ini': '/etc/' + path_suffix + 'php.ini', + }, + 'xcache': { + 'ini': '/etc/' + path_suffix + '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', + 'user': 'root', + 'group': 'root', + '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_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', + 'curl': 'curl', + 'fpm': 'php-fpm', + 'gd': 'php-gd', + 'geoip': 'php-geoip', + 'imap': 'php-imap', + 'intl': 'php-intl', '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', - 'sybase_pkg': 'php-sybase', + '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', - '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', + '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', + 'user': 'root', + 'group': 'root', + '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', + }, + }, + 'FreeBSD': { + 'apache2': { + 'ini': '/usr/local/etc/php.ini', + 'module_config': '/usr/local/etc/apache24/modules.d/050_mod_php.conf', + 'name': 'apache24', + }, + 'cli': { + 'ini': '/usr/local/etc/php.ini' + }, + 'pkgs': { + 'apache2': 'mod_php' + freebsd_php_version, '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', + 'cli': 'php' + freebsd_php_version, + 'ctype': 'php' + freebsd_php_version + '-ctype', + 'curl': 'php' + freebsd_php_version + '-curl', + 'dom': 'php' + freebsd_php_version + '-dom', + 'filter': 'php' + freebsd_php_version + '-filter', + 'fileinfo': 'php' + freebsd_php_version + '-fileinfo', + 'fpm': 'php' + freebsd_php_version, + 'gd': 'php' + freebsd_php_version + '-gd', + 'hash': 'php' + freebsd_php_version + '-hash', + 'iconv': 'php' + freebsd_php_version + '-iconv', + 'intl': 'php' + freebsd_php_version + '-intl', + 'json': 'php' + freebsd_php_version + '-json', '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', - 'sybase_pkg': 'php5-sybase', + 'memcached': 'php' + freebsd_php_version + '-pecl-memcached', + 'mbstring': 'php' + freebsd_php_version + '-mbstring', + 'mcrypt': 'php' + freebsd_php_version + '-mcrypt', + 'mysql': 'php' + freebsd_php_version + '-mysqli', + 'opcache': 'php' + freebsd_php_version + '-opcache', + 'openssl': 'php' + freebsd_php_version + '-openssl', + 'pdo': 'php' + freebsd_php_version + '-pdo', + 'pdo_mysql': 'php' + freebsd_php_version + '-pdo_mysql', + 'pear': 'php' + freebsd_php_version + '-pear', + 'php': 'php' + freebsd_php_version, + 'phar': 'php' + freebsd_php_version + '-phar', + 'posix': 'php' + freebsd_php_version + '-posix', + 'session': 'php' + freebsd_php_version + '-session', + 'simplexml': 'php' + freebsd_php_version + '-simplexml', + 'snmp': 'php' + freebsd_php_version + '-snmp', 'temp_dir': '/tmp', - 'xml_pkg': 'php5', - 'zip_pkg': 'php5', + 'tokenizer': 'php' + freebsd_php_version + '-tokenizer', + 'xdebug': 'php' + freebsd_php_version + '-pecl-xdebug', + 'xml': 'php' + freebsd_php_version + '-xml', + 'xmlwriter': 'php' + freebsd_php_version + '-xmlwriter', + 'zip': 'php' + freebsd_php_version + '-zip', }, - }, grain='os', merge=salt['pillar.get']('php:lookup')) %} - {%- endif %} - {%- endif %} -{%- else %} - {%- set php = salt['grains.filter_by']({ - 'Debian': { - 'adodb_pkg': salt['grains.filter_by']({ - 'jessie': 'php5-adodb', - 'stretch': 'libphp-adodb', - }, grain='oscodename'), - 'apc_pkg': 'php-apc', - 'apcu_pkg': salt['grains.filter_by']({ - 'wheezy': 'php-apc', - 'jessie': 'php5-apcu', - 'stretch': 'php-apcu', - }, grain='oscodename'), - 'bcmath_pkg': 'php5-fpm', - 'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev', 'build-essential'], - 'cgi_pkg': 'php5-cgi', - 'cli_pkg': salt['grains.filter_by']({ - 'wheezy': 'php-cli', - 'jessie': 'php5-cli', - 'stretch': 'php-cli', - }, grain='oscodename'), - 'composer_bin': 'composer', - 'curl_pkg': salt['grains.filter_by']({ - 'wheezy': 'php-curl', - 'jessie': 'php5-curl', - 'stretch': 'php-curl', - }, grain='oscodename'), - 'dev_pkg': salt['grains.filter_by']({ - 'wheezy': 'php-dev', - 'jessie': 'php5-dev', - 'stretch': 'php-dev', - }, grain='oscodename'), - 'ext_conf_path': salt['grains.filter_by']({ - 'jessie': '/etc/php5/mods-available', - 'stretch': '/etc/php/7.0/mods-available/', - }, grain='oscodename'), - 'fpm_pkg': salt['grains.filter_by']({ - 'wheezy': 'php-fpm', - 'jessie': 'php5-fpm', - 'stretch': 'php-fpm', - }, grain='oscodename'), - 'fpm_service': salt['grains.filter_by']({ - 'wheezy': 'php-fpm', - 'jessie': 'php5-fpm', - 'stretch': 'php-fpm', - }, grain='oscodename'), - 'gd_pkg': salt['grains.filter_by']({ - 'wheezy': 'php-gd', - 'jessie': 'php5-gd', - 'stretch': 'php-gd', - }, grain='oscodename'), - 'imagick_pkg': salt['grains.filter_by']({ - 'wheezy': 'php-imagick', - 'jessie': 'php5-imagick', - 'stretch': 'php-imagick', - }, grain='oscodename'), - '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': salt['grains.filter_by']({ - 'wheezy': 'php-mcrypt', - 'jessie': 'php5-mcrypt', - 'stretch': 'php-mcrypt', - }, grain='oscodename'), - 'memcache_pkg': salt['grains.filter_by']({ - 'wheezy': 'php-memcache', - 'jessie': 'php5-memcache', - 'stretch': 'php-memcache', - }, grain='oscodename'), - 'memcached_pkg': salt['grains.filter_by']({ - 'wheezy': 'php-memcached', - 'jessie': 'php5-memcached', - 'stretch': 'php-memcached', - }, grain='oscodename'), - 'mongo_ext': 'mongo.so', - 'mongo_pecl': 'mongo', - 'mysql_pkg': salt['grains.filter_by']({ - 'wheezy': 'php-mysql', - 'jessie': 'php5-mysql', - 'stretch': 'php-mysql', - }, grain='oscodename'), - 'mysqlnd_pkg': 'php5-mysqlnd', - 'oauth_pkg': 'php5-oauth', - 'pear_pkg': 'php-pear', - 'pgsql_pkg': salt['grains.filter_by']({ - 'wheezy': 'php-pgsql', - 'jessie': 'php5-pgsql', - 'stretch': 'php-pqsql', - }, grain='oscodename'), - 'php_ini': salt['grains.filter_by']({ - 'jessie': '/etc/php5/apache2/php.ini', - 'stretch': '/etc/php/7.0/apache2/php.ini', - }, grain='oscodename'), - 'php_pkg': salt['grains.filter_by']({ - 'wheezy': 'php', - 'jessie': 'php5', - 'stretch': 'php', - }, grain='oscodename'), - 'phpenmod_command': salt['grains.filter_by']({ - 'wheezy': 'php5enmod', - 'jessie': 'php5enmod', - 'stretch': 'phpenmod', - }, grain='oscodename'), - 'readline_pkg': salt['grains.filter_by']({ - 'wheezy': 'php-readline', - 'jessie': 'php5-readline', - 'stretch': 'php-readline', - }, grain='oscodename'), - 'redis_pkg': salt['grains.filter_by']({ - 'wheezy': 'php-redis', - 'jessie': 'php5-redis', - 'stretch': 'php-redis', - }, grain='oscodename'), - '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', - 'sybase_pkg': 'php5-sybase', - 'temp_dir': '/tmp', - 'xml_pkg': 'php5', - 'zip_pkg': 'php5', + 'fpm': { + 'conf': '/usr/local/etc/php-fpm.conf', + 'ini': '/usr/local/etc/php.ini', + 'pools': '/usr/local/etc/php-fpm.d', + 'service': 'php-fpm', + 'user': 'root', + 'group': 'wheel', + 'defaults': { + 'global': { + 'pid': 'run/php-fpm.pid', + 'error_log': 'log/php-fpm.log', + }, + 'include': '/usr/local/etc/php-fpm.d/*.conf', + }, + }, + }, + }), + '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': {}, + }, + }, }, - 'RedHat': { - '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', - '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', - 'pgsql_pkg': 'php-pgsql', - 'php_ini': '/etc/php.ini', - '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', - 'xml_pkg': 'php-xml', - 'zip_pkg': 'php', + 'cli': { + 'ini': { + 'opts': {}, + 'settings': {}, + } }, - 'Suse': { - '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', - '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-xmlreader','php5-xmlwriter','php5-xmlrpc'], - 'zip_pkg': 'php5-zip', + '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': {}, + } }, - 'FreeBSD': { - 'local_bin': '/usr/local/bin', - 'composer_bin': 'composer', - 'temp_dir': '/tmp', + 'ini': { + 'defaults': { + 'PHP': { + 'engine': 'On', + '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', + '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=salt['pillar.get']('php:lookup')) %} + }, merge=True) %} {%- endif %} diff --git a/php/mbstring.sls b/php/mbstring.sls index b285467d..eafebbf2 100644 --- a/php/mbstring.sls +++ b/php/mbstring.sls @@ -1,9 +1,2 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-mbstring: - pkg.installed: - - name: {{ php.mbstring_pkg }} +{% set state = 'mbstring' %} +{% include "php/installed.jinja" %} diff --git a/php/mcrypt.sls b/php/mcrypt.sls index 95fa37ad..3580ebd1 100644 --- a/php/mcrypt.sls +++ b/php/mcrypt.sls @@ -1,9 +1,2 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-mcrypt: - pkg.installed: - - name: {{ php.mcrypt_pkg }} +{% set state = 'mcrypt' %} +{% include "php/installed.jinja" %} diff --git a/php/mdb2/init.sls b/php/mdb2/init.sls new file mode 100644 index 00000000..26910d0c --- /dev/null +++ b/php/mdb2/init.sls @@ -0,0 +1,2 @@ +{% set state = 'mdb2' %} +{% include "php/installed.jinja" %} diff --git a/php/mdb2/mysql.sls b/php/mdb2/mysql.sls new file mode 100644 index 00000000..a3e59827 --- /dev/null +++ b/php/mdb2/mysql.sls @@ -0,0 +1,3 @@ +{% set state = 'mdb2-driver-mysql' %} +{% include "php/installed.jinja" %} +{% include "php/mdb2/init.sls" %} diff --git a/php/mdb2/pgsql.sls b/php/mdb2/pgsql.sls new file mode 100644 index 00000000..44093886 --- /dev/null +++ b/php/mdb2/pgsql.sls @@ -0,0 +1,3 @@ +{% set state = 'mdb2-driver-pgsql' %} +{% include "php/installed.jinja" %} +{% include "php/mdb2/init.sls" %} diff --git a/php/memcache.sls b/php/memcache.sls index f96571de..696adf0f 100644 --- a/php/memcache.sls +++ b/php/memcache.sls @@ -1,9 +1,2 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-memcache: - pkg.installed: - - name: {{ php.memcache_pkg }} +{% set state = 'memcache' %} +{% include "php/installed.jinja" %} diff --git a/php/memcached.sls b/php/memcached.sls index a1d84cf4..3929f993 100644 --- a/php/memcached.sls +++ b/php/memcached.sls @@ -1,9 +1,2 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-memcached: - pkg.installed: - - name: {{ php.memcached_pkg }} +{% set state = 'memcached' %} +{% include "php/installed.jinja" %} diff --git a/php/modules.sls b/php/modules.sls new file mode 100644 index 00000000..8e312370 --- /dev/null +++ b/php/modules.sls @@ -0,0 +1,23 @@ +{% from "php/map.jinja" import php with context %} + +{% set modules = salt['pillar.get']('php:modules') or [] %} +{% set base_name = 'php.' %} +{% set existing_states = salt['cp.list_states']() %} + +{% set includes = [] %} +{% set install = [] %} + +{% for module in modules %} +{% set state = base_name ~ module %} +{% if state in existing_states %} +{% do includes.append(state) %} +{% else %} +{% do install.append(module) %} +{% endif %} +{% endfor %} + +include: {{ includes|json }} + +{% for state in install %} +{% include "php/installed.jinja" %} +{% endfor %} diff --git a/php/mongo.sls b/php/mongo.sls index defaac4d..3c941cfc 100644 --- a/php/mongo.sls +++ b/php/mongo.sls @@ -1,43 +1,2 @@ -{%- from "php/map.jinja" import php with context %} - -{%- set version = salt['pillar.get']('php:mongo_version', none) %} - -include: - - php.deprecated - - 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 }} - - pkg: build_pkgs - -build_pkgs: - pkg.installed: - - pkgs: {{ php.build_pkgs }} - -php-mongo-conf: - file.managed: - - name: {{ php.ext_conf_path }}/mongo.ini - - contents: | - extension={{ php.mongo_ext }} - - require: - - pkg: {{ php.php_pkg }} - -{%- if salt['grains.get']('os_family') == "Debian" %} - -php-mongo-enable: - cmd.run: - - name: {{ php.phpenmod_command }} mongo - - require: - - file: php-mongo-conf - -{%- endif %} +{% set state = 'mongo' %} +{% include "php/installed.jinja" %} diff --git a/php/mongodb.sls b/php/mongodb.sls new file mode 100644 index 00000000..dbd49e10 --- /dev/null +++ b/php/mongodb.sls @@ -0,0 +1,2 @@ +{% set state = 'mongodb' %} +{% include "php/installed.jinja" %} diff --git a/php/msgpack.sls b/php/msgpack.sls new file mode 100644 index 00000000..da47cc2b --- /dev/null +++ b/php/msgpack.sls @@ -0,0 +1,2 @@ +{% set state = 'msgpack' %} +{% include "php/installed.jinja" %} diff --git a/php/mysql.sls b/php/mysql.sls index c1170396..bce04e22 100644 --- a/php/mysql.sls +++ b/php/mysql.sls @@ -1,9 +1,2 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-mysql: - pkg.installed: - - name: {{ php.mysql_pkg }} +{% set state = 'mysql' %} +{% include "php/installed.jinja" %} diff --git a/php/mysqlnd.sls b/php/mysqlnd.sls index 20351b63..f145281c 100644 --- a/php/mysqlnd.sls +++ b/php/mysqlnd.sls @@ -1,9 +1,2 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-mysqlnd: - pkg.installed: - - name: {{ php.mysqlnd_pkg }} +{% set state = 'mysqlnd' %} +{% include "php/installed.jinja" %} diff --git a/php/net-smtp.sls b/php/net-smtp.sls new file mode 100644 index 00000000..3ee6c82e --- /dev/null +++ b/php/net-smtp.sls @@ -0,0 +1,2 @@ +{% set state = 'net-smtp' %} +{% include "php/installed.jinja" %} diff --git a/php/net4.sls b/php/net4.sls new file mode 100644 index 00000000..7eeac978 --- /dev/null +++ b/php/net4.sls @@ -0,0 +1,2 @@ +{% set state = 'net4' %} +{% include "php/installed.jinja" %} diff --git a/php/net6.sls b/php/net6.sls new file mode 100644 index 00000000..b467213a --- /dev/null +++ b/php/net6.sls @@ -0,0 +1,9 @@ +{% 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/installed.jinja" %} +{% endif %} \ No newline at end of file diff --git a/php/ng/adodb.sls b/php/ng/adodb.sls index 5561747a..5cbb5ccd 100644 --- a/php/ng/adodb.sls +++ b/php/ng/adodb.sls @@ -1,2 +1,2 @@ -{% set state = 'adodb' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/apache2/ini.sls b/php/ng/apache2/ini.sls index 6e9bc398..5cbb5ccd 100644 --- a/php/ng/apache2/ini.sls +++ b/php/ng/apache2/ini.sls @@ -1,12 +1,2 @@ -# Manages the main Apache2 ini file -{% from "php/ng/map.jinja" import php with context %} -{% from "php/ng/ini.jinja" import php_ini %} - -{% set settings = php.ini.defaults %} -{% do settings.update(php.apache2.ini.settings) %} - include: - - php.ng.deprecated - -php_apache2_ini: - {{ php_ini(php.lookup.apache2.ini, php.apache2.ini.opts, settings) }} + - php.deprecated diff --git a/php/ng/apache2/init.sls b/php/ng/apache2/init.sls index f7b94196..5cbb5ccd 100644 --- a/php/ng/apache2/init.sls +++ b/php/ng/apache2/init.sls @@ -1,14 +1,2 @@ -{% if grains['os_family'] in ["Debian", "FreeBSD"] %} include: - - php.ng.deprecated - - php.ng.apache2.install -{% endif %} #END: os = Debian|FreeBSD -{% if grains['os_family'] == "Debian" %} - - php.ng.apache2.ini - -extend: - php_apache2_ini: - file: - - require: - - sls: php.ng.apache2.install -{% endif %} #END: os = debian + - php.deprecated diff --git a/php/ng/apache2/install.sls b/php/ng/apache2/install.sls index 51e1500a..5cbb5ccd 100644 --- a/php/ng/apache2/install.sls +++ b/php/ng/apache2/install.sls @@ -1,21 +1,2 @@ -{% from "php/ng/map.jinja" import php with context %} - include: - - php.ng.deprecated - -{% set state = 'apache2' %} -{% include "php/ng/installed.jinja" %} - -{% if grains['os_family'] == "FreeBSD" %} -{{ php.lookup.apache2.module_config }}: - file.managed: - - source: salt://php/ng/apache2/files/mod_php.conf.jinja - - template: jinja -{% if salt['pillar.get']('php:ng:use_apache_formula', True) %} - - makedirs: true - - require_in: - - sls: apache - - watch_in: - - module: apache-restart -{% endif %} #END: use apache formula -{% endif %} #END: os = debian + - php.deprecated diff --git a/php/ng/apc.sls b/php/ng/apc.sls index d1c7f1ac..5cbb5ccd 100644 --- a/php/ng/apc.sls +++ b/php/ng/apc.sls @@ -1,2 +1,2 @@ -{% set state = 'apc' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/apcu.sls b/php/ng/apcu.sls index 389c837c..5cbb5ccd 100644 --- a/php/ng/apcu.sls +++ b/php/ng/apcu.sls @@ -1,2 +1,2 @@ -{% set state = 'apcu' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/auth-sasl.sls b/php/ng/auth-sasl.sls index 98f8e559..5cbb5ccd 100644 --- a/php/ng/auth-sasl.sls +++ b/php/ng/auth-sasl.sls @@ -1,2 +1,2 @@ -{% set state = 'auth-sasl' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/bcmath.sls b/php/ng/bcmath.sls index 14a2da6d..5cbb5ccd 100644 --- a/php/ng/bcmath.sls +++ b/php/ng/bcmath.sls @@ -1,2 +1,2 @@ -{% set state = 'bcmath' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/bz2.sls b/php/ng/bz2.sls index be634c34..5cbb5ccd 100644 --- a/php/ng/bz2.sls +++ b/php/ng/bz2.sls @@ -1,2 +1,2 @@ -{% set state = 'bz2' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/cache-lite.sls b/php/ng/cache-lite.sls index 34783a94..5cbb5ccd 100644 --- a/php/ng/cache-lite.sls +++ b/php/ng/cache-lite.sls @@ -1,2 +1,2 @@ -{% set state = 'cache-lite' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/cgi.sls b/php/ng/cgi.sls index 655e92a9..5cbb5ccd 100644 --- a/php/ng/cgi.sls +++ b/php/ng/cgi.sls @@ -1,2 +1,2 @@ -{% set state = 'cgi' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/cli/ini.sls b/php/ng/cli/ini.sls index e334d5ea..5cbb5ccd 100644 --- a/php/ng/cli/ini.sls +++ b/php/ng/cli/ini.sls @@ -1,29 +1,2 @@ -# Manages the php cli main ini file -{% from "php/ng/map.jinja" import php with context %} -{% from "php/ng/ini.jinja" import php_ini %} - include: - - php.ng.deprecated - -{% set settings = php.ini.defaults %} -{% for key, value in php.cli.ini.settings.items() %} - {% if settings[key] is defined %} - {% do settings[key].update(value) %} - {% else %} - {% do settings.update({key: value}) %} - {% endif %} -{% endfor %} - -{% set pillar_php_ng_version = salt['pillar.get']('php:ng:version', '7.0') %} -{% if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %} - {% for version in pillar_php_ng_version %} - {% set first_version = pillar_php_ng_version[0]|string %} - {% set ini = php.lookup.cli.ini|replace(first_version, version) %} -php_cli_ini_{{ version }}: - {{ php_ini(ini, php.cli.ini.opts, settings) }} - {% endfor %} -{% else %} - -php_cli_ini: - {{ php_ini(php.lookup.cli.ini, php.cli.ini.opts, settings) }} -{% endif %} + - php.deprecated diff --git a/php/ng/cli/init.sls b/php/ng/cli/init.sls index fad7a0ad..5cbb5ccd 100644 --- a/php/ng/cli/init.sls +++ b/php/ng/cli/init.sls @@ -1,23 +1,2 @@ -# Installs php-cli and manages the associated php.ini - include: - - php.ng.deprecated - - php.ng.cli.install - - php.ng.cli.ini - -{% set pillar_php_ng_version = salt['pillar.get']('php:ng:version', '7.0') %} -{% if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %} -extend: - {% for version in pillar_php_ng_version %} - php_cli_ini_{{ version }}: - file: - - require: - - sls: php.ng.cli.install - {% endfor %} -{% else %} -extend: - php_cli_ini: - file: - - require: - - sls: php.ng.cli.install -{% endif %} + - php.deprecated diff --git a/php/ng/cli/install.sls b/php/ng/cli/install.sls index 2f7df206..5cbb5ccd 100644 --- a/php/ng/cli/install.sls +++ b/php/ng/cli/install.sls @@ -1,31 +1,2 @@ -{% set state = 'cli' %} -{% include "php/ng/installed.jinja" %} - include: - - php.ng.deprecated - -{%- if salt['grains.get']('os_family') == "Debian" %} -{% set current_php = salt['alternatives.show_current']('php') %} -{% set pillar_php_ng_version = salt['pillar.get']('php:ng:version', '7.0') %} -{% if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %} - {% if 'alternatives_version' in salt['pillar.get']('php:ng') %} - {% set phpng_version = salt['pillar.get']('php:ng:alternatives_version') %} - {% else %} - {% set phpng_version = false %} - {% endif %} -{% else %} -{% set phpng_version = salt['pillar.get']('php:ng:version', '7.0')|string %} -{% endif %} - -{% if phpng_version %} -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.deprecated diff --git a/php/ng/composer.sls b/php/ng/composer.sls index b5776e66..5cbb5ccd 100644 --- a/php/ng/composer.sls +++ b/php/ng/composer.sls @@ -1,62 +1,2 @@ -{% 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.deprecated - - php.ng -{% if grains['os_family'] == 'FreeBSD' %} - - php.ng.filter - - php.ng.hash - - php.ng.json - - php.ng.mbstring - - php.ng.openssl - - php.ng.phar -{% endif %} - -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 version date and check if older than 60day (defaultvalue of COMPOSER_DEV_WARNING_TIME) -# 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" -{% if grains['os_family'] == 'FreeBSD' %} - - unless: test $(date -v+60d -j -f "%Y-%m-%d %H:%M:%S" "$({{ install_file }} --version | cut -d ' ' -f 4,5)" "+%s") -gt $(date "+%s") -{% else %} - - unless: test $(date -d "60 days $({{ install_file }} --version | cut -d ' ' -f 4,5)" "+%s") -gt $(date "+%s") -{% endif %} - - cwd: {{ php.lookup.pkgs.local_bin }} - - env: - - HOME: {{ salt_user_home }} - - require: - - cmd: install-composer + - php.deprecated diff --git a/php/ng/console-table.sls b/php/ng/console-table.sls index 659ebdcd..5cbb5ccd 100644 --- a/php/ng/console-table.sls +++ b/php/ng/console-table.sls @@ -1,2 +1,2 @@ -{% set state = 'console-table' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/ctype.sls b/php/ng/ctype.sls index 97fc9104..5cbb5ccd 100644 --- a/php/ng/ctype.sls +++ b/php/ng/ctype.sls @@ -1,2 +1,2 @@ -{% set state = 'ctype' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/curl.sls b/php/ng/curl.sls index 6ad15ede..5cbb5ccd 100644 --- a/php/ng/curl.sls +++ b/php/ng/curl.sls @@ -1,2 +1,2 @@ -{% set state = 'curl' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/dba.sls b/php/ng/dba.sls index 320dca6f..5cbb5ccd 100644 --- a/php/ng/dba.sls +++ b/php/ng/dba.sls @@ -1,2 +1,2 @@ -{% set state = 'dba' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/deprecated.sls b/php/ng/deprecated.sls deleted file mode 100644 index 50860638..00000000 --- a/php/ng/deprecated.sls +++ /dev/null @@ -1,40 +0,0 @@ -# -*- coding: utf-8 -*- -# vim: ft=sls - -{#- Evaluating as `False` by default, using this method since `defaults.yaml` not available in this repo #} -{%- if not salt['config.get']('php').get('warning_messages', {}).get('v1.0.0', {}).get('mute_upcoming', False) %} -php-deprecated-in-v1.0.0-test-succeed: - test.succeed_without_changes: - - name: | - - - ################################################################################ - # # - # WARNING: BREAKING CHANGES IN UPCOMING VERSION `v1.0.0` # - # # - ################################################################################ - # # - # This formula currently provides two methods for managing PHP; the old method # - # under `php` and the new method under `php.ng`. In upcoming `v1.0.0`, the old # - # method will be removed and `php.ng` will be promoted to `php` in its place. # - # # - # If you are not in a position to migrate, you will need to pin your repo to # - # the final release tag before `v1.0.0`, which is expected to be `v0.40.1`. # - # # - # If you are currently using `php.ng`, there is nothing to do until `v1.0.0` # - # is released. # - # # - # To migrate from the old `php`, the first step is to convert to `php.ng`, # - # before `v1.0.0` is released. # - # # - # To prevent this message being displayed again, set the pillar/config value: # - # # - # ``` # - # php: # - # warning_messages: # - # v1.0.0: # - # mute_upcoming: True # - # ``` # - # # - ################################################################################ -{%- endif %} diff --git a/php/ng/dev.sls b/php/ng/dev.sls index 2ad11716..5cbb5ccd 100644 --- a/php/ng/dev.sls +++ b/php/ng/dev.sls @@ -1,2 +1,2 @@ -{% set state = 'dev' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/dom.sls b/php/ng/dom.sls index 64b7add5..5cbb5ccd 100644 --- a/php/ng/dom.sls +++ b/php/ng/dom.sls @@ -1,2 +1,2 @@ -{% set state = 'dom' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/fileinfo.sls b/php/ng/fileinfo.sls index 31567e09..5cbb5ccd 100644 --- a/php/ng/fileinfo.sls +++ b/php/ng/fileinfo.sls @@ -1,2 +1,2 @@ -{% set state = 'fileinfo' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/filter.sls b/php/ng/filter.sls index 46c155b9..5cbb5ccd 100644 --- a/php/ng/filter.sls +++ b/php/ng/filter.sls @@ -1,2 +1,2 @@ -{% set state = 'filter' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/fpm/config.sls b/php/ng/fpm/config.sls index 1227d01d..5cbb5ccd 100644 --- a/php/ng/fpm/config.sls +++ b/php/ng/fpm/config.sls @@ -1,66 +1,2 @@ -# Manages the php-fpm main ini file -{% from 'php/ng/map.jinja' import php with context %} -{% from "php/ng/ini.jinja" import php_ini %} - include: - - php.ng.deprecated - -{% set ini_settings = php.ini.defaults %} -{% for key, value in php.fpm.config.ini.settings.items() %} - {% if ini_settings[key] is defined %} - {% do ini_settings[key].update(value) %} - {% else %} - {% do ini_settings.update({key: value}) %} - {% endif %} -{% endfor %} - -{% set pillar_php_ng_version = salt['pillar.get']('php:ng:version', '7.0') %} -{% if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %} - {% for version in pillar_php_ng_version %} - {% set conf_settings = odict(php.lookup.fpm.defaults) %} - {% set first_version = pillar_php_ng_version[0]|string %} - {% set ini = php.lookup.fpm.ini|replace(first_version, version) %} - {% set conf = php.lookup.fpm.conf|replace(first_version, version) %} - {% set pools = php.lookup.fpm.pools|replace(first_version, version) %} - - {% for key, value in conf_settings.items() %} - {% if value is string %} - {% do conf_settings.update({key: value.replace(first_version, version)}) %} - {% endif %} - {% endfor %} - {% do conf_settings.global.update({'pid': '/var/run/php' + version + '-fpm.pid' }) %} - {% do conf_settings.global.update({'error_log': '/var/log/php' + version + '-fpm.log' }) %} - -php_fpm_ini_config_{{ version }}: - {{ php_ini(ini, php.fpm.config.ini.opts, ini_settings) }} - -php_fpm_conf_config_{{ version }}: - {{ php_ini(conf, php.fpm.config.conf.opts, odict(conf_settings)) }} - -{{ pools }}: - file.directory: - - name: {{ pools }} - - user: {{ php.lookup.fpm.user }} - - group: {{ php.lookup.fpm.group }} - - file_mode: 755 - - make_dirs: True - {% endfor %} -{% else %} - -{% set conf_settings = php.lookup.fpm.defaults %} -{% do conf_settings.update(php.fpm.config.conf.settings) %} - -php_fpm_ini_config: - {{ php_ini(php.lookup.fpm.ini, php.fpm.config.ini.opts, ini_settings) }} - -php_fpm_conf_config: - {{ php_ini(php.lookup.fpm.conf, php.fpm.config.conf.opts, conf_settings) }} - -{{ php.lookup.fpm.pools }}: - file.directory: - - name: {{ php.lookup.fpm.pools }} - - user: {{ php.lookup.fpm.user }} - - group: {{ php.lookup.fpm.group }} - - file_mode: 755 - - make_dirs: True -{% endif %} + - php.deprecated diff --git a/php/ng/fpm/init.sls b/php/ng/fpm/init.sls index 59a1f08e..5cbb5ccd 100644 --- a/php/ng/fpm/init.sls +++ b/php/ng/fpm/init.sls @@ -1,45 +1,2 @@ -# Meta-state to fully install php.fpm - include: - - php.ng.deprecated - - php.ng.fpm.config - - php.ng.fpm.service - - php.ng.fpm.pools - -{% set pillar_php_ng_version = salt['pillar.get']('php:ng:version', '7.0') %} -extend: - php_fpm_service: - service: - - watch: - {% if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %} - {% for version in pillar_php_ng_version %} - - file: php_fpm_ini_config_{{ version }} - - file: php_fpm_conf_config_{{ version }} - {% endfor %} - {% else %} - - file: php_fpm_ini_config - - file: php_fpm_conf_config - {% endif %} - - require: - - sls: php.ng.fpm.config - {% if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %} - {% for version in pillar_php_ng_version %} - php_fpm_ini_config_{{ version }}: - file: - - require: - - pkg: php_install_fpm - php_fpm_conf_config_{{ version }}: - file: - - require: - - pkg: php_install_fpm - {% endfor %} - {% else %} - php_fpm_ini_config: - file: - - require: - - pkg: php_install_fpm - php_fpm_conf_config: - file: - - require: - - pkg: php_install_fpm - {% endif %} + - php.deprecated diff --git a/php/ng/fpm/install.sls b/php/ng/fpm/install.sls index 72fa5c84..5cbb5ccd 100644 --- a/php/ng/fpm/install.sls +++ b/php/ng/fpm/install.sls @@ -1,5 +1,2 @@ include: - - php.ng.deprecated - -{% set state = 'fpm' %} -{% include "php/ng/installed.jinja" %} + - php.deprecated diff --git a/php/ng/fpm/pools.sls b/php/ng/fpm/pools.sls index b3d7454f..5cbb5ccd 100644 --- a/php/ng/fpm/pools.sls +++ b/php/ng/fpm/pools.sls @@ -1,25 +1,2 @@ -# Manages the php-fpm pools config files -{% from "php/ng/map.jinja" import php with context %} -{% from "php/ng/macro.jinja" import sls_block %} -{% from "php/ng/fpm/pools_config.sls" import pool_states with context %} - -{% macro file_requisites(states) %} - {%- for state in states %} - - file: {{ state }} - {%- endfor -%} -{% endmacro %} - include: - - php.ng.deprecated - - php.ng.fpm.service - - php.ng.fpm.pools_config - -{% if pool_states %} -extend: - php_fpm_service: - service: - - watch: -{{ file_requisites(pool_states) }} - - require: -{{ file_requisites(pool_states) }} -{% endif %} + - php.deprecated diff --git a/php/ng/fpm/pools_config.sls b/php/ng/fpm/pools_config.sls index 6ffcdb48..5cbb5ccd 100644 --- a/php/ng/fpm/pools_config.sls +++ b/php/ng/fpm/pools_config.sls @@ -1,48 +1,2 @@ -# Manages the php-fpm pools config files -{% from 'php/ng/map.jinja' import php with context %} -{% from "php/ng/macro.jinja" import sls_block, serialize %} - include: - - php.ng.deprecated - -# Simple path concatenation. -{% macro path_join(file, root) -%} - {{ root ~ '/' ~ file }} -{%- endmacro %} - -{% set pool_states = [] %} - -{% for pool, config in php.fpm.pools.items() %} -{% if pool == 'defaults' %}{% continue %}{% endif %} -{% for pkey, pvalues in config.get('settings', {}).items() %} -{% set pool_defaults = php.fpm.pools.get('defaults', {}).copy() %} - {% do pool_defaults.update(pvalues) %} - {% do pvalues.update(pool_defaults) %} -{% endfor %} -{% set state = 'php_fpm_pool_conf_' ~ loop.index0 %} - -{% set pillar_php_ng_version = salt['pillar.get']('php:ng:version', '7.0') %} -{% if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %} - {% set first_fpath = path_join(config.get('filename', pool), php.lookup.fpm.pools) %} - {% set first_version = pillar_php_ng_version[0]|string %} - {% set fpath = first_fpath.replace(first_version, config.get('phpversion', '7.0')) %} -{% else %} - {% set fpath = path_join(config.get('filename', pool), php.lookup.fpm.pools) %} -{% endif %} - -{{ state }}: -{% if config.enabled %} - file.managed: - {{ sls_block(config.get('opts', {})) }} - - name: {{ fpath }} - - source: salt://php/ng/files/php.ini - - template: jinja - - context: - config: {{ serialize(config.get('settings', {})) }} -{% else %} - file.absent: - - name: {{ fpath }} -{% endif %} - -{% do pool_states.append(state) %} -{% endfor %} + - php.deprecated diff --git a/php/ng/fpm/service.sls b/php/ng/fpm/service.sls index 084a5395..5cbb5ccd 100644 --- a/php/ng/fpm/service.sls +++ b/php/ng/fpm/service.sls @@ -1,19 +1,2 @@ -# Manages the php-fpm service. -{% from "php/ng/map.jinja" import php with context %} -{% from "php/ng/macro.jinja" import sls_block %} - -{% set service_function = {True:'running', False:'dead'}.get(php.fpm.service.enabled) %} - include: - - php.ng.deprecated - - php.ng.fpm.install - -php_fpm_service: - service.{{ service_function }}: - {{ sls_block(php.fpm.service.opts) }} - - name: {{ php.lookup.fpm.service }} - - enable: {{ php.fpm.service.enabled }} - - require: - - sls: php.ng.fpm.install - - watch: - - pkg: php_install_fpm + - php.deprecated diff --git a/php/ng/gd.sls b/php/ng/gd.sls index fe55c71a..5cbb5ccd 100644 --- a/php/ng/gd.sls +++ b/php/ng/gd.sls @@ -1,2 +1,2 @@ -{% set state = 'gd' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/gearman.sls b/php/ng/gearman.sls index 1598d8ca..5cbb5ccd 100644 --- a/php/ng/gearman.sls +++ b/php/ng/gearman.sls @@ -1,2 +1,2 @@ -{% set state = 'gearman' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/geoip.sls b/php/ng/geoip.sls index 550b9a37..5cbb5ccd 100644 --- a/php/ng/geoip.sls +++ b/php/ng/geoip.sls @@ -1,2 +1,2 @@ -{% set state = 'geoip' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/geshi.sls b/php/ng/geshi.sls index 45888654..5cbb5ccd 100644 --- a/php/ng/geshi.sls +++ b/php/ng/geshi.sls @@ -1,2 +1,2 @@ -{% set state = 'geshi' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/gettext.sls b/php/ng/gettext.sls index 310b3ba2..5cbb5ccd 100644 --- a/php/ng/gettext.sls +++ b/php/ng/gettext.sls @@ -1,2 +1,2 @@ -{% set state = 'gettext' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/gmp.sls b/php/ng/gmp.sls index f9a7542e..5cbb5ccd 100644 --- a/php/ng/gmp.sls +++ b/php/ng/gmp.sls @@ -1,2 +1,2 @@ -{% set state = 'gmp' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/hash.sls b/php/ng/hash.sls index aabf7a66..5cbb5ccd 100644 --- a/php/ng/hash.sls +++ b/php/ng/hash.sls @@ -1,2 +1,2 @@ -{% set state = 'hash' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/hhvm/config.sls b/php/ng/hhvm/config.sls index 4f242e55..5cbb5ccd 100644 --- a/php/ng/hhvm/config.sls +++ b/php/ng/hhvm/config.sls @@ -1,19 +1,2 @@ -# Manages the php-hhvm main ini file -{% from "php/ng/map.jinja" import php with context %} -{% from "php/ng/ini.jinja" import php_ini %} - include: - - php.ng.deprecated - -{% set server_settings = php.lookup.hhvm.server %} -{% do server_settings.update(php.hhvm.config.server.settings) %} - -{% set php_settings = php.lookup.hhvm.php %} -{% do php_settings.update(php.hhvm.config.php.settings) %} - -php_hhvm_ini_config: - {{ php_ini(php.lookup.hhvm.conf, php.hhvm.config.server.opts, server_settings) }} - -php_hhvm_conf_config: - {{ php_ini(php.lookup.hhvm.ini, php.hhvm.config.php.opts, php_settings) }} - + - php.deprecated diff --git a/php/ng/hhvm/init.sls b/php/ng/hhvm/init.sls index ba6576e3..5cbb5ccd 100644 --- a/php/ng/hhvm/init.sls +++ b/php/ng/hhvm/init.sls @@ -1,24 +1,2 @@ -# Meta-state to fully install php.hhvm - include: - - php.ng.deprecated - - php.ng.hhvm.repo - - php.ng.hhvm.config - - php.ng.hhvm.service - -extend: - php_hhvm_service: - service: - - watch: - - file: php_hhvm_ini_config - - file: php_hhvm_conf_config - - require: - - sls: php.ng.hhvm.config - php_hhvm_ini_config: - file: - - require: - - pkg: php_install_hhvm - php_hhvm_conf_config: - file: - - require: - - pkg: php_install_hhvm + - php.deprecated diff --git a/php/ng/hhvm/install.sls b/php/ng/hhvm/install.sls index 65761eee..5cbb5ccd 100644 --- a/php/ng/hhvm/install.sls +++ b/php/ng/hhvm/install.sls @@ -1,5 +1,2 @@ include: - - php.ng.deprecated - -{% set state = 'hhvm' %} -{% include "php/ng/installed.jinja" %} + - php.deprecated diff --git a/php/ng/hhvm/repo.sls b/php/ng/hhvm/repo.sls index 8fd38416..5cbb5ccd 100644 --- a/php/ng/hhvm/repo.sls +++ b/php/ng/hhvm/repo.sls @@ -1,20 +1,2 @@ -# Manages the php-hhvm service. -{% from "php/ng/map.jinja" import php with context %} - include: - - php.ng.deprecated - - php.ng.hhvm.install - - -{% if salt['grains.get']('os_family') == 'Debian' -%} - -hhvm_repo: - pkgrepo.managed: - - name: deb http://dl.hhvm.com/{{ salt['grains.get']('os')|lower }} {{ salt['grains.get']('oscodename')}} main - - file: /etc/apt/sources.list.d/hhvm.list - - keyid: 0x5a16e7281be7a449 - - keyserver: keyserver.ubuntu.com - - refresh_db: True - - require_in: - - pkg: php_install_hhvm -{%- endif %} + - php.deprecated diff --git a/php/ng/hhvm/service.sls b/php/ng/hhvm/service.sls index 458ad7c4..5cbb5ccd 100644 --- a/php/ng/hhvm/service.sls +++ b/php/ng/hhvm/service.sls @@ -1,20 +1,2 @@ -# Manages the php-hhvm service. -{% from "php/ng/map.jinja" import php with context %} -{% from "php/ng/macro.jinja" import sls_block %} - -{% set service_function = {True:'running', False:'dead'}.get(php.hhvm.service.enabled) %} - include: - - php.ng.deprecated - - php.ng.hhvm.install - -php_hhvm_service: - service.{{ service_function }}: - {{ sls_block(php.hhvm.service.opts) }} - - name: {{ php.lookup.hhvm.service }} - - enable: {{ php.hhvm.service.enabled }} - - require: - - sls: php.ng.hhvm.install - - watch: - - pkg: php_install_hhvm - + - php.deprecated diff --git a/php/ng/http.sls b/php/ng/http.sls index 5735eee0..5cbb5ccd 100644 --- a/php/ng/http.sls +++ b/php/ng/http.sls @@ -1,2 +1,2 @@ -{% set state = 'http' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/iconv.sls b/php/ng/iconv.sls index 75e68b94..5cbb5ccd 100644 --- a/php/ng/iconv.sls +++ b/php/ng/iconv.sls @@ -1,2 +1,2 @@ -{% set state = 'iconv' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/igbinary.sls b/php/ng/igbinary.sls index e1c980d4..5cbb5ccd 100644 --- a/php/ng/igbinary.sls +++ b/php/ng/igbinary.sls @@ -1,2 +1,2 @@ -{% set state = 'igbinary' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/imagick.sls b/php/ng/imagick.sls index 7bfcd466..5cbb5ccd 100644 --- a/php/ng/imagick.sls +++ b/php/ng/imagick.sls @@ -1,2 +1,2 @@ -{% set state = 'imagick' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/imap.sls b/php/ng/imap.sls index 20b015e2..5cbb5ccd 100644 --- a/php/ng/imap.sls +++ b/php/ng/imap.sls @@ -1,2 +1,2 @@ -{% set state = 'imap' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/init.sls b/php/ng/init.sls index 80bd5da4..5cbb5ccd 100644 --- a/php/ng/init.sls +++ b/php/ng/init.sls @@ -1,2 +1,2 @@ -{% set state = 'php' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/intl.sls b/php/ng/intl.sls index 2e85c2e7..5cbb5ccd 100644 --- a/php/ng/intl.sls +++ b/php/ng/intl.sls @@ -1,2 +1,2 @@ -{% set state = 'intl' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/json.sls b/php/ng/json.sls index 1f9d6d80..5cbb5ccd 100644 --- a/php/ng/json.sls +++ b/php/ng/json.sls @@ -1,2 +1,2 @@ -{% set state = 'json' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/ldap.sls b/php/ng/ldap.sls index f75346db..5cbb5ccd 100644 --- a/php/ng/ldap.sls +++ b/php/ng/ldap.sls @@ -1,2 +1,2 @@ -{% set state = 'ldap' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/mail.sls b/php/ng/mail.sls index 6193ef7d..5cbb5ccd 100644 --- a/php/ng/mail.sls +++ b/php/ng/mail.sls @@ -1,2 +1,2 @@ -{% set state = 'mail' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/map.jinja b/php/ng/map.jinja deleted file mode 100644 index 92ad002e..00000000 --- a/php/ng/map.jinja +++ /dev/null @@ -1,3247 +0,0 @@ -# -*- coding: utf-8 -*- -# vim: ft=jinja - -{% set pillar_php_ng_version = salt['pillar.get']('php:ng:version', '7.0') %} -{%- if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %} - {%- set phpng_version = pillar_php_ng_version[0]|string %} -{% else %} - {%- set phpng_version = pillar_php_ng_version|string %} -{% endif %} -{%- set freebsd_phpng_version = phpng_version.replace('.', '') %} - -{%- if salt['grains.get']('os') == "Ubuntu" %} - {%- set use_external_repo = salt['pillar.get']('php:use_external_repo', False) %} - {%- if use_external_repo %} - {%- 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'], - 'bz2': 'php' + phpng_version + '-bz2', - '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', - 'dba': 'php' + phpng_version + '-dba', - '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', - 'auth-sasl': 'php-auth-sasl', - 'mail': 'php-mail', - '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', - 'net-smtp': 'php-net-smtp', - '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', - 'sybase': 'php' + phpng_version + '-sybase', - 'tcpdf': 'php-tcpdf', - 'temp_dir': '/tmp', - 'tidy': 'php' + phpng_version + '-tidy', - 'xdebug': 'php' + phpng_version + '-xdebug', - 'xml': ['php' + phpng_version + '-xml', 'php' + phpng_version + '-xmlrpc'], - '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', - 'user': 'root', - 'group': 'root', - '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) %} - {%- 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', - 'bz2': 'php' + phpng_version + '-bz2', - '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', - 'dba': 'php' + phpng_version + '-dba', - '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', - 'auth-sasl': 'php-auth-sasl', - 'mail': 'php-mail', - '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', - 'net-smtp': 'php-net-smtp', - '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', - 'readline': 'php' + phpng_version + '-readline', - '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', - 'sybase': 'php' + phpng_version + '-sybase', - 'tcpdf': 'php-tcpdf', - 'temp_dir': '/tmp', - 'tidy': 'php' + phpng_version + '-tidy', - 'xdebug': 'php' + phpng_version + '-xdebug', - 'xml': ['php' + phpng_version + '-xml', 'php' + phpng_version + '-xmlrpc'], - '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', - 'user': 'root', - 'group': 'root', - '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 >= '18.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.2-bcmath', - 'bz2': 'php7.2-bz2', - 'cache-lite': 'php-cache-lite', - 'cgi': 'php-cgi', - 'cli': 'php-cli', - 'console-table': 'php-console-table', - 'composer_bin': 'composer', - 'curl': 'php-curl', - 'dev': 'php7.2-dev', - 'dba': 'php7.2-dba', - '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', - 'local_bin': '/usr/local/bin', - 'auth-sasl': 'php-auth-sasl', - 'mail': 'php-mail', - 'mbstring': 'php-mbstring', - 'mcrypt': 'php-mcrypt', - 'memcache': 'php-memcache', - 'memcached': 'php-memcached', - 'mongodb': 'php-mongodb', - 'mysql': 'php-mysql', - 'mysqlnd': 'php', - 'net-smtp': 'php-net-smtp', - 'net4': 'php-net-ipv4', - 'net6': 'php-net-ipv6', - 'oauth': 'php-oauth', - 'opcache': 'php7.2-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', - 'sybase': 'php-sybase', - 'tcpdf': 'php-tcpdf', - 'temp_dir': '/tmp', - 'tidy': 'php7.2-tidy', - 'xcache': 'php', - 'xdebug': 'php-xdebug', - 'xml': ['php-xml', 'php-xmlrpc'], - 'xsl': 'php7.2-xsl', - 'zip': 'php-zip', - }, - 'fpm': { - 'conf': '/etc/php/7.2/fpm/php-fpm.conf', - 'ini': '/etc/php/7.2/fpm/php.ini', - 'pools': '/etc/php/7.2/fpm/pool.d', - 'service': 'php7.2-fpm', - 'user': 'root', - 'group': 'root', - 'defaults': odict([ - ('global', odict([ - ('pid', '/var/run/php7.2-fpm.pid'), - ('error_log', '/var/log/php7.2-fpm.log'), - ])), - ('include', '/etc/php/7.2/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.2/cli/php.ini', - }, - 'apache2': { - 'ini': '/etc/php/7.2/apache2/php.ini', - }, - 'xcache': { - 'ini': '/etc/php/7.2/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': { - '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': { - '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) %} - {%- elif salt['grains.get']('osrelease')|string >= '17.10' %} - {%- 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.1-bcmath', - 'bz2': 'php7.1-bz2', - 'cache-lite': 'php-cache-lite', - 'cgi': 'php-cgi', - 'cli': 'php-cli', - 'console-table': 'php-console-table', - 'composer_bin': 'composer', - 'curl': 'php-curl', - 'dba': 'php7.1-dba', - 'dev': 'php7.1-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', - 'local_bin': '/usr/local/bin', - 'auth-sasl': 'php-auth-sasl', - 'mail': 'php-mail', - 'mbstring': 'php-mbstring', - 'mcrypt': 'php-mcrypt', - 'memcache': 'php-memcache', - 'memcached': 'php-memcached', - 'mongodb': 'php-mongodb', - 'mysql': 'php-mysql', - 'mysqlnd': 'php', - 'net-smtp': 'php-net-smtp', - 'net4': 'php-net-ipv4', - 'net6': 'php-net-ipv6', - 'oauth': 'php-oauth', - 'opcache': 'php7.1-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', - 'sybase': 'php-sybase', - 'tcpdf': 'php-tcpdf', - 'temp_dir': '/tmp', - 'tidy': 'php7.1-tidy', - 'xcache': 'php', - 'xdebug': 'php-xdebug', - 'xml': ['php-xml', 'php-xmlrpc'], - 'xsl': 'php7.1-xsl', - 'zip': 'php-zip', - }, - 'fpm': { - 'conf': '/etc/php/7.1/fpm/php-fpm.conf', - 'ini': '/etc/php/7.1/fpm/php.ini', - 'pools': '/etc/php/7.1/fpm/pool.d', - 'service': 'php7.1-fpm', - 'user': 'root', - 'group': 'root', - 'defaults': odict([ - ('global', odict([ - ('pid', '/var/run/php7.1-fpm.pid'), - ('error_log', '/var/log/php7.1-fpm.log'), - ])), - ('include', '/etc/php/7.1/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.1/cli/php.ini', - }, - 'apache2': { - 'ini': '/etc/php/7.1/apache2/php.ini', - }, - 'xcache': { - 'ini': '/etc/php/7.1/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': { - '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': { - '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) %} - {%- elif 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', - 'bz2': 'php7.0-bz2', - 'cache-lite': 'php-cache-lite', - 'cgi': 'php-cgi', - 'cli': 'php-cli', - 'console-table': 'php-console-table', - 'composer_bin': 'composer', - 'curl': 'php-curl', - 'dba': 'php7.0-dba', - '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', - 'local_bin': '/usr/local/bin', - 'auth-sasl': 'php-auth-sasl', - 'mail': 'php-mail', - 'mbstring': 'php-mbstring', - 'mcrypt': 'php-mcrypt', - 'memcache': 'php-memcache', - 'memcached': 'php-memcached', - 'mongodb': 'php-mongodb', - 'mysql': 'php-mysql', - 'mysqlnd': 'php', - 'net-smtp': 'php-net-smtp', - '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', - 'sybase': 'php-sybase', - 'tcpdf': 'php-tcpdf', - 'temp_dir': '/tmp', - 'tidy': 'php7.0-tidy', - 'xcache': 'php', - 'xdebug': 'php-xdebug', - 'xml': ['php-xml', 'php-xmlrpc'], - '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', - 'user': 'root', - 'group': 'root', - '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': { - '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': { - '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']({ - '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', - 'auth-sasl': 'php-auth-sasl', - 'mail': 'php-mail', - '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', - 'net-smtp': 'php-net-smtp', - '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', - 'user': 'root', - 'group': 'root', - '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': {}, - }, - }, - }, - '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': { - '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 %} - {%- endif %} -{%- elif salt['grains.get']('os') == "Debian" %} - {%- if phpng_version|string == '5' %} - {%- set confdir = '/etc/php5' %} - {%- else %} - {%- set confdir = '/etc/php/' + phpng_version %} - {%- endif %} - {%- 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', - 'bz2': 'php' + phpng_version + '-bz2', - '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', - 'dba': 'php' + phpng_version + '-dba', - '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', - 'igbinary': 'php-igbinary', - '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', - 'auth-sasl': 'php-auth-sasl', - 'mail': 'php-mail', - 'mbstring': 'php' + phpng_version + '-mbstring', - 'mcrypt': 'php' + phpng_version + '-mcrypt', - 'memcache': 'php-memcache', - 'memcached': 'php-memcached', - 'mongo': 'php-mongo', - 'mongodb': 'php-mongodb', - 'msgpack': 'php-msgpack', - 'mysql': 'php' + phpng_version + '-mysql', - 'mysqlnd': 'php' + phpng_version + '-mysql', - 'net-smtp': 'php-net-smtp', - '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', - 'readline': 'php' + phpng_version + '-readline', - 'redis': 'php-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', - 'sybase': 'php' + phpng_version + '-sybase', - 'tcpdf': 'php-tcpdf', - 'temp_dir': '/tmp', - 'tidy': 'php' + phpng_version + '-tidy', - 'xdebug': 'php' + phpng_version + '-xdebug', - 'xml': ['php' + phpng_version + '-xml', 'php' + phpng_version + '-xmlrpc'], - 'xsl': 'php' + phpng_version + '-xsl', - 'zip': 'php' + phpng_version + '-zip', - }, - 'fpm': { - 'conf': confdir + '/fpm/php-fpm.conf', - 'ini': confdir + '/fpm/php.ini', - 'pools': confdir + '/fpm/pool.d', - 'user': 'root', - 'group': 'root', - 'service': 'php' + phpng_version + '-fpm', - 'user': 'root', - 'group': 'root', - 'defaults': odict([ - ('global', odict([ - ('pid', '/var/run/php' + phpng_version + '-fpm.pid'), - ('error_log', '/var/log/php' + phpng_version + '-fpm.log'), - ])), - ('include', confdir + '/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': confdir + '/cli/php.ini', - }, - 'apache2': { - 'ini': confdir + '/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) %} -{%- else %} - {%- set useversion = phpng_version | replace(".", "-") -%} - {#- Red Hat Softwarecollection prefix lookup belongs to the Red Hat part - further down but has to go here due to Jinja parsing rules. -#} - {%- if salt['pillar.get']('php:use_scl_repo', False) -%} - {%- set rh_prefix = 'rh-php{}-'.format(salt['pillar.get']('php:scl_php_version', '')) -%} - {%- set sclo_prefix = 'sclo-php{}-'.format(salt['pillar.get']('php:scl_php_version', '')) -%} - {%- set path_suffix = 'opt/rh/rh-php{}/'.format(salt['pillar.get']('php:scl_php_version', '')) -%} - {%- else -%} - {%- set rh_prefix = '' -%} - {%- set sclo_prefix = '' -%} - {%- set path_suffix = '' -%} - {%- endif -%} - {%- set php = salt['pillar.get']('php:ng', { - 'lookup': salt['grains.filter_by']({ - 'Debian': { - 'pkgs': { - 'adodb': 'php5-adodb', - 'apache2': 'libapache2-mod-php5', - 'apc': 'php-apc', - 'apcu': 'php5-apcu', - 'bcmath': 'php5', - 'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev'], - 'bz2': 'php5-bz2', - 'cache-lite': 'php-cache-lite', - 'cgi': 'php5-cgi', - 'cli': 'php5-cli', - 'console-table': 'php-console-table', - 'composer_bin': 'composer', - 'curl': 'php5-curl', - 'dba': 'php5-dba', - 'dev': ['php5-dev','build-essential'], - 'ext_conf_path': '/etc/php5/mods-available', - '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', - 'auth-sasl': 'php-auth-sasl', - 'mail': 'php-mail', - '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', - 'net-smtp': 'php-net-smtp', - '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', - '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', - 'sybase': 'php5-sybase', - 'tcpdf': 'php-tcpdf', - 'temp_dir': '/tmp', - 'tidy': 'php5-tidy', - 'uuid': 'php-uuid', - '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', - 'user': 'root', - 'group': 'root', - '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': {}, - }, - }, - 'Gentoo' : { - 'pkgs': { - 'apache2': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[apache2]'}], - 'apc': [{'name': 'dev-php/pecl-apcu_bc','version': '[php_targets_php' + useversion + ']'}], - 'apcu': [{'name': 'dev-php/pecl-apcu','version': '[php_targets_php' + useversion + ']'}], - 'bcmath': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[bcmath]'}], - 'bz2': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[bzip2]'}], - 'cache-lite': 'dev-php/PEAR-Cache_Lite', - 'cgi': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[cgi]'}], - 'cli': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[cli]'}], - 'composer_bin': 'composer', - 'console-table': 'dev-php/PEAR-Console_Table', - 'curl': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[curl]'}], - 'ext_conf_path': '/etc/php/fpm-php' + phpng_version + '/ext', - 'fpm': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[fpm]'}], - 'gd': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[gd]'}], - 'geoip': [{'name': 'dev-php/pecl-geoip','version': '[php_targets_php' + useversion + ']'}], - 'gettext': 'dev-php/PEAR-File_Gettext', - 'gmp': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[gmp]'}], - 'imagick': [{'name': 'dev-php/pecl-imagick','version': '[php_targets_php' + useversion + ']'}], - 'imap': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[imap]'}], - 'intl': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[intl]'}], - 'json': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[json]'}], - 'ldap': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[ldap]'}], - 'local_bin': '/usr/local/bin', - 'auth-sasl': 'dev-php/PEAR-Auth_SASL', - 'mail': 'dev-php/PHPMailer', - 'memcache': [{'name': 'dev-php/pecl-memcache','version': '[php_targets_php' + useversion + ']'}], - 'memcached': [{'name': 'dev-php/pecl-memcached','version': '[php_targets_php' + useversion + ']'}], - 'mongo': [{'name': 'dev-php/pecl-mongo','version': '[php_targets_php' + useversion + ']'}], - 'mongodb': [{'name': 'dev-php/pecl-mongodb','version': '[php_targets_php' + useversion + ']'}], - 'mysqlnd': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[mysql]'}], - 'mysql': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[mysqli]'}], - 'net-smtp': 'dev-php/PEAR-Net_SMTP', - 'net4': 'dev-php/PEAR-Net_IPv4', - 'net6': 'dev-php/PEAR-Net_IPv6', - 'oauth': [{'name': 'dev-php/pecl-oauth','version': '[php_targets_php' + useversion + ']'}], - 'opcache': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[opcache]'}], - 'pear': 'dev-php/pear', - 'pgsql': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[postgres]'}], - 'php': [{'name': 'dev-lang/php','version': ':' + phpng_version}], - 'pspell': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[spell]'}], - 'redis': [{'name': 'dev-php/pecl-redis','version': '[php_targets_php' + useversion + ']'}], - 'snmp': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[snmp]'}], - 'soap': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[soap]'}], - 'ssh2': [{'name': 'dev-php/pecl-ssh2','version': '[php_targets_php' + useversion + ']'}], - 'sqlite': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[sqlite]'}], - 'sybase': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[sybase-ct]'}], - 'tcpdf': 'dev-php/tcpdf', - 'temp_dir': '/tmp', - 'tidy': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[tidy]'}], - 'xdebug': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[debug]'}], - 'xml': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[xml]'}], - 'xsl': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[xslt]'}], - 'zip': [{'name': 'dev-lang/php','version': ':' + phpng_version + '[zip]'}], - }, - 'fpm': { - 'conf': '/etc/php/fpm-php' + phpng_version + '/php-fpm.conf', - 'ini': '/etc/php/fpm-php' + phpng_version + '/php.ini', - 'pools': '/etc/php/fpm-php' + phpng_version + '/fpm.d', - 'service': 'php-fpm', - 'user': 'root', - 'group': 'root', - 'defaults': odict([ - ('global', odict([ - ('pid', '/var/run/php-fpm-php' + phpng_version + '.pid'), - ('error_log', '/var/log/php' + phpng_version + '-fpm.log'), - ])), - ('include', '/etc/php/fpm-php' + phpng_version + '/fpm.d/*.conf'), - ]), - }, - 'cli': { - 'ini': '/etc/php/cli-php' + phpng_version + '/php.ini', - }, - 'apache2': { - 'ini': '/etc/php/apache2-php' + phpng_version + '/php.ini', - }, - }, - 'RedHat': { - 'pkgs': { - 'adodb': 'php-adodb', - 'apc': 'php-pecl-apc', - 'apcu': rh_prefix + 'php-pecl-apcu', - 'bcmath': rh_prefix + 'php-bcmath', - 'build_pkgs': ['openssl-devel', 'gcc'], - 'cache-lite': 'php-pear-Cache-Lite', - 'cgi': rh_prefix + 'php-cgi', - 'cli': rh_prefix + 'php-cli', - 'composer': 'composer', - 'composer_bin': 'composer', - 'console-table': 'php-pear-Console-Table', - 'curl': [rh_prefix + 'php-common', 'curl'], - 'dba': [rh_prefix + 'php-dba', 'dba'], - 'dev': rh_prefix + 'php-devel', - 'ext_conf_path': '/etc/' + path_suffix + 'php.d', - 'fpm': rh_prefix + 'php-fpm', - 'gd': rh_prefix + 'php-gd', - 'geoip': sclo_prefix + 'php-pecl-geoip', - 'geshi': 'php-geshi', - 'gettext': 'php-php-gettext', - 'http': sclo_prefix + 'php-pecl-http', - 'imagick': sclo_prefix + 'php-pecl-imagick', - 'imap': sclo_prefix + 'php-imap', - 'intl': rh_prefix + 'php-intl', - 'json': rh_prefix + 'php-common', - 'ldap': rh_prefix + 'php-ldap', - 'local_bin': '/usr/local/bin', - 'auth-sasl': 'php-pear-Auth-SASL', - 'mail': 'php-pear-Mail', - 'mbstring': rh_prefix + 'php-mbstring', - 'mcrypt': sclo_prefix + 'php-mcrypt', - 'memcache': 'php-pecl-memcache', - 'memcached': sclo_prefix + 'php-pecl-memcached', - 'mysql': 'php-mysql', - 'mysqlnd': rh_prefix + 'php-mysqlnd', - 'net-smtp': 'php-pear-Net-SMTP', - 'net4': 'php-pear-Net-IPv4', - 'oauth': 'php-pecl-oauth', - 'opcache': rh_prefix + 'php-opcache' if salt['pillar.get']('php:use_scl_repo', False) else 'php-pecl-zendopcache', - 'pear': rh_prefix + 'php-pear', - 'pgsql': rh_prefix + 'php-pgsql', - 'php': rh_prefix + 'php', - 'pspell': rh_prefix + 'php-pspell', - 'redis': sclo_prefix + 'php-pecl-redis', - 'seclib': 'php-phpseclib', - 'snmp': rh_prefix + 'php-snmp', - 'soap': rh_prefix + 'php-soap', - 'sqlite': rh_prefix + 'php-pdo', - 'ssh2': sclo_prefix + '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': sclo_prefix + 'php-tidy', - 'uuid': sclo_prefix + 'php-pecl-uuid', - 'xcache': 'php-xcache', - 'xdebug': sclo_prefix + 'php-pecl-xdebug', - 'xml': [rh_prefix + 'php-xml', rh_prefix + 'php-xmlrpc'], - 'xsl': rh_prefix + 'php-xml', - 'zip': rh_prefix + 'php', - }, - 'fpm': { - 'conf': '/etc/' + path_suffix + 'php-fpm.conf', - 'ini': '/etc/' + path_suffix + 'php.ini', - 'pools': '/etc/' + path_suffix + 'php-fpm.d', - 'service': rh_prefix + 'php-fpm', - 'user': 'root', - 'group': 'root', - 'defaults': { - 'global': { - 'pid': '/var/' + path_suffix + 'run/php-fpm/php-fpm.pid', - 'error_log': '/var/' + path_suffix + 'log/php-fpm/error.log', - }, - 'include': '/etc/' + path_suffix + 'php-fpm.d/*.conf', - }, - }, - 'cli': { - 'ini': '/etc/' + path_suffix + 'php.ini', - }, - 'xcache': { - 'ini': '/etc/' + path_suffix + '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', - 'user': 'root', - 'group': 'root', - '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', - 'user': 'root', - 'group': 'root', - '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', - }, - }, - 'FreeBSD': { - 'apache2': { - 'ini': '/usr/local/etc/php.ini', - 'module_config': '/usr/local/etc/apache24/modules.d/050_mod_php.conf', - 'name': 'apache24', - }, - 'cli': { - 'ini': '/usr/local/etc/php.ini' - }, - 'pkgs': { - 'apache2': 'mod_php' + freebsd_phpng_version, - 'composer_bin': 'composer', - 'cli': 'php' + freebsd_phpng_version, - 'ctype': 'php' + freebsd_phpng_version + '-ctype', - 'curl': 'php' + freebsd_phpng_version + '-curl', - 'dom': 'php' + freebsd_phpng_version + '-dom', - 'filter': 'php' + freebsd_phpng_version + '-filter', - 'fileinfo': 'php' + freebsd_phpng_version + '-fileinfo', - 'fpm': 'php' + freebsd_phpng_version, - 'gd': 'php' + freebsd_phpng_version + '-gd', - 'hash': 'php' + freebsd_phpng_version + '-hash', - 'iconv': 'php' + freebsd_phpng_version + '-iconv', - 'intl': 'php' + freebsd_phpng_version + '-intl', - 'json': 'php' + freebsd_phpng_version + '-json', - 'local_bin': '/usr/local/bin', - 'memcached': 'php' + freebsd_phpng_version + '-pecl-memcached', - 'mbstring': 'php' + freebsd_phpng_version + '-mbstring', - 'mcrypt': 'php' + freebsd_phpng_version + '-mcrypt', - 'mysql': 'php' + freebsd_phpng_version + '-mysqli', - 'opcache': 'php' + freebsd_phpng_version + '-opcache', - 'openssl': 'php' + freebsd_phpng_version + '-openssl', - 'pdo': 'php' + freebsd_phpng_version + '-pdo', - 'pdo_mysql': 'php' + freebsd_phpng_version + '-pdo_mysql', - 'pear': 'php' + freebsd_phpng_version + '-pear', - 'php': 'php' + freebsd_phpng_version, - 'phar': 'php' + freebsd_phpng_version + '-phar', - 'posix': 'php' + freebsd_phpng_version + '-posix', - 'session': 'php' + freebsd_phpng_version + '-session', - 'simplexml': 'php' + freebsd_phpng_version + '-simplexml', - 'snmp': 'php' + freebsd_phpng_version + '-snmp', - 'temp_dir': '/tmp', - 'tokenizer': 'php' + freebsd_phpng_version + '-tokenizer', - 'xdebug': 'php' + freebsd_phpng_version + '-pecl-xdebug', - 'xml': 'php' + freebsd_phpng_version + '-xml', - 'xmlwriter': 'php' + freebsd_phpng_version + '-xmlwriter', - 'zip': 'php' + freebsd_phpng_version + '-zip', - }, - 'fpm': { - 'conf': '/usr/local/etc/php-fpm.conf', - 'ini': '/usr/local/etc/php.ini', - 'pools': '/usr/local/etc/php-fpm.d', - 'service': 'php-fpm', - 'user': 'root', - 'group': 'wheel', - 'defaults': { - 'global': { - 'pid': 'run/php-fpm.pid', - 'error_log': 'log/php-fpm.log', - }, - 'include': '/usr/local/etc/php-fpm.d/*.conf', - }, - }, - }, - }), - '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', - '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', - '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 %} diff --git a/php/ng/mbstring.sls b/php/ng/mbstring.sls index f8dcbcac..5cbb5ccd 100644 --- a/php/ng/mbstring.sls +++ b/php/ng/mbstring.sls @@ -1,2 +1,2 @@ -{% set state = 'mbstring' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/mcrypt.sls b/php/ng/mcrypt.sls index e69fe131..5cbb5ccd 100644 --- a/php/ng/mcrypt.sls +++ b/php/ng/mcrypt.sls @@ -1,2 +1,2 @@ -{% set state = 'mcrypt' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/mdb2/init.sls b/php/ng/mdb2/init.sls index 138ace04..5cbb5ccd 100644 --- a/php/ng/mdb2/init.sls +++ b/php/ng/mdb2/init.sls @@ -1,5 +1,2 @@ include: - - php.ng.deprecated - -{% set state = 'mdb2' %} -{% include "php/ng/installed.jinja" %} + - php.deprecated diff --git a/php/ng/mdb2/mysql.sls b/php/ng/mdb2/mysql.sls index 831515d7..5cbb5ccd 100644 --- a/php/ng/mdb2/mysql.sls +++ b/php/ng/mdb2/mysql.sls @@ -1,6 +1,2 @@ include: - - php.ng.deprecated - -{% set state = 'mdb2-driver-mysql' %} -{% include "php/ng/installed.jinja" %} -{% include "php/ng/mdb2/init.sls" %} + - php.deprecated diff --git a/php/ng/mdb2/pgsql.sls b/php/ng/mdb2/pgsql.sls index 9b9aba4a..5cbb5ccd 100644 --- a/php/ng/mdb2/pgsql.sls +++ b/php/ng/mdb2/pgsql.sls @@ -1,6 +1,2 @@ include: - - php.ng.deprecated - -{% set state = 'mdb2-driver-pgsql' %} -{% include "php/ng/installed.jinja" %} -{% include "php/ng/mdb2/init.sls" %} + - php.deprecated diff --git a/php/ng/memcache.sls b/php/ng/memcache.sls index f1401026..5cbb5ccd 100644 --- a/php/ng/memcache.sls +++ b/php/ng/memcache.sls @@ -1,2 +1,2 @@ -{% set state = 'memcache' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/memcached.sls b/php/ng/memcached.sls index 9509c25d..5cbb5ccd 100644 --- a/php/ng/memcached.sls +++ b/php/ng/memcached.sls @@ -1,2 +1,2 @@ -{% set state = 'memcached' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/modules.sls b/php/ng/modules.sls index 56b20de0..5cbb5ccd 100644 --- a/php/ng/modules.sls +++ b/php/ng/modules.sls @@ -1,23 +1,2 @@ -{% from "php/ng/map.jinja" import php with context %} - -{% set modules = salt['pillar.get']('php:ng:modules') or [] %} -{% set base_name = 'php.ng.' %} -{% set existing_states = salt['cp.list_states']() %} - -{% set includes = [] %} -{% set install = [] %} - -{% for module in modules %} -{% set state = base_name ~ module %} -{% if state in existing_states %} -{% do includes.append(state) %} -{% else %} -{% do install.append(module) %} -{% endif %} -{% endfor %} - -include: {{ includes|json }} - -{% for state in install %} -{% include "php/ng/installed.jinja" %} -{% endfor %} +include: + - php.deprecated diff --git a/php/ng/mongo.sls b/php/ng/mongo.sls index 19048957..5cbb5ccd 100644 --- a/php/ng/mongo.sls +++ b/php/ng/mongo.sls @@ -1,2 +1,2 @@ -{% set state = 'mongo' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/mongodb.sls b/php/ng/mongodb.sls index 22ed84eb..5cbb5ccd 100644 --- a/php/ng/mongodb.sls +++ b/php/ng/mongodb.sls @@ -1,2 +1,2 @@ -{% set state = 'mongodb' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/msgpack.sls b/php/ng/msgpack.sls index ae99d55e..5cbb5ccd 100644 --- a/php/ng/msgpack.sls +++ b/php/ng/msgpack.sls @@ -1,2 +1,2 @@ -{% set state = 'msgpack' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/mysql.sls b/php/ng/mysql.sls index ad0cfe72..5cbb5ccd 100644 --- a/php/ng/mysql.sls +++ b/php/ng/mysql.sls @@ -1,2 +1,2 @@ -{% set state = 'mysql' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/mysqlnd.sls b/php/ng/mysqlnd.sls index 844cc3e8..5cbb5ccd 100644 --- a/php/ng/mysqlnd.sls +++ b/php/ng/mysqlnd.sls @@ -1,2 +1,2 @@ -{% set state = 'mysqlnd' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/net-smtp.sls b/php/ng/net-smtp.sls index 3a9a9707..5cbb5ccd 100644 --- a/php/ng/net-smtp.sls +++ b/php/ng/net-smtp.sls @@ -1,2 +1,2 @@ -{% set state = 'net-smtp' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/net4.sls b/php/ng/net4.sls index 99d250c9..5cbb5ccd 100644 --- a/php/ng/net4.sls +++ b/php/ng/net4.sls @@ -1,2 +1,2 @@ -{% set state = 'net4' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/net6.sls b/php/ng/net6.sls index 78332f35..5cbb5ccd 100644 --- a/php/ng/net6.sls +++ b/php/ng/net6.sls @@ -1,9 +1,2 @@ -{% 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 +include: + - php.deprecated diff --git a/php/ng/oauth.sls b/php/ng/oauth.sls index b1000741..5cbb5ccd 100644 --- a/php/ng/oauth.sls +++ b/php/ng/oauth.sls @@ -1,2 +1,2 @@ -{% set state = 'oauth' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/opcache.sls b/php/ng/opcache.sls index 73ed5063..5cbb5ccd 100644 --- a/php/ng/opcache.sls +++ b/php/ng/opcache.sls @@ -1,2 +1,2 @@ -{% set state = 'opcache' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/openssl.sls b/php/ng/openssl.sls index b37485b1..5cbb5ccd 100644 --- a/php/ng/openssl.sls +++ b/php/ng/openssl.sls @@ -1,2 +1,2 @@ -{% set state = 'openssl' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/pdo.sls b/php/ng/pdo.sls index 6d96b5cb..5cbb5ccd 100644 --- a/php/ng/pdo.sls +++ b/php/ng/pdo.sls @@ -1,2 +1,2 @@ -{% set state = 'pdo' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/pdo_mysql.sls b/php/ng/pdo_mysql.sls index c6e8fc46..5cbb5ccd 100644 --- a/php/ng/pdo_mysql.sls +++ b/php/ng/pdo_mysql.sls @@ -1,2 +1,2 @@ -{% set state = 'pdo_mysql' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/pear.sls b/php/ng/pear.sls index 560d25ad..5cbb5ccd 100644 --- a/php/ng/pear.sls +++ b/php/ng/pear.sls @@ -1,2 +1,2 @@ -{% set state = 'pear' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/pgsql.sls b/php/ng/pgsql.sls index 859e1e9a..5cbb5ccd 100644 --- a/php/ng/pgsql.sls +++ b/php/ng/pgsql.sls @@ -1,2 +1,2 @@ -{% set state = 'pgsql' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/phar.sls b/php/ng/phar.sls index 8a1b9aca..5cbb5ccd 100644 --- a/php/ng/phar.sls +++ b/php/ng/phar.sls @@ -1,2 +1,2 @@ -{% set state = 'phar' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/posix.sls b/php/ng/posix.sls index 817eefee..5cbb5ccd 100644 --- a/php/ng/posix.sls +++ b/php/ng/posix.sls @@ -1,2 +1,2 @@ -{% set state = 'posix' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/pspell.sls b/php/ng/pspell.sls index c42ec731..5cbb5ccd 100644 --- a/php/ng/pspell.sls +++ b/php/ng/pspell.sls @@ -1,2 +1,2 @@ -{% set state = 'pspell' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/readline.sls b/php/ng/readline.sls index cea79870..5cbb5ccd 100644 --- a/php/ng/readline.sls +++ b/php/ng/readline.sls @@ -1,2 +1,2 @@ -{% set state = 'readline' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/redis.sls b/php/ng/redis.sls index 6afe4a37..5cbb5ccd 100644 --- a/php/ng/redis.sls +++ b/php/ng/redis.sls @@ -1,2 +1,2 @@ -{% set state = 'redis' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/seclib.sls b/php/ng/seclib.sls index 9b803919..5cbb5ccd 100644 --- a/php/ng/seclib.sls +++ b/php/ng/seclib.sls @@ -1,2 +1,2 @@ -{% set state = 'seclib' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/session.sls b/php/ng/session.sls index d8c7c482..5cbb5ccd 100644 --- a/php/ng/session.sls +++ b/php/ng/session.sls @@ -1,2 +1,2 @@ -{% set state = 'session' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/simplexml.sls b/php/ng/simplexml.sls index 48068265..5cbb5ccd 100644 --- a/php/ng/simplexml.sls +++ b/php/ng/simplexml.sls @@ -1,2 +1,2 @@ -{% set state = 'simplexml' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/snmp.sls b/php/ng/snmp.sls index 2c405c43..5cbb5ccd 100644 --- a/php/ng/snmp.sls +++ b/php/ng/snmp.sls @@ -1,2 +1,2 @@ -{% set state = 'snmp' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/soap.sls b/php/ng/soap.sls index 28f2344b..5cbb5ccd 100644 --- a/php/ng/soap.sls +++ b/php/ng/soap.sls @@ -1,2 +1,2 @@ -{% set state = 'soap' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/sqlite.sls b/php/ng/sqlite.sls index ac788ebd..5cbb5ccd 100644 --- a/php/ng/sqlite.sls +++ b/php/ng/sqlite.sls @@ -1,2 +1,2 @@ -{% set state = 'sqlite' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/ssh2.sls b/php/ng/ssh2.sls index 530857b8..5cbb5ccd 100644 --- a/php/ng/ssh2.sls +++ b/php/ng/ssh2.sls @@ -1,2 +1,2 @@ -{% set state = 'ssh2' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/suhosin.sls b/php/ng/suhosin.sls index b4b9c2a3..5cbb5ccd 100644 --- a/php/ng/suhosin.sls +++ b/php/ng/suhosin.sls @@ -1,90 +1,2 @@ -{% from "php/ng/map.jinja" import php with context %} - include: - - php.ng.deprecated - - 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 %} + - php.deprecated diff --git a/php/ng/svn.sls b/php/ng/svn.sls index 17ff0f6f..5cbb5ccd 100644 --- a/php/ng/svn.sls +++ b/php/ng/svn.sls @@ -1,2 +1,2 @@ -{% set state = 'svn' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/sybase.sls b/php/ng/sybase.sls index a7e24394..5cbb5ccd 100644 --- a/php/ng/sybase.sls +++ b/php/ng/sybase.sls @@ -1,2 +1,2 @@ -{% set state = 'sybase' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/tcpdf.sls b/php/ng/tcpdf.sls index 40af6393..5cbb5ccd 100644 --- a/php/ng/tcpdf.sls +++ b/php/ng/tcpdf.sls @@ -1,2 +1,2 @@ -{% set state = 'tcpdf' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/tidy.sls b/php/ng/tidy.sls index 530f4ada..5cbb5ccd 100644 --- a/php/ng/tidy.sls +++ b/php/ng/tidy.sls @@ -1,2 +1,2 @@ -{% set state = 'tidy' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/tokenizer.sls b/php/ng/tokenizer.sls index 060b5a15..5cbb5ccd 100644 --- a/php/ng/tokenizer.sls +++ b/php/ng/tokenizer.sls @@ -1,2 +1,2 @@ -{% set state = 'tokenizer' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/uuid.sls b/php/ng/uuid.sls index 8c27a6a9..5cbb5ccd 100644 --- a/php/ng/uuid.sls +++ b/php/ng/uuid.sls @@ -1,2 +1,2 @@ -{% set state = 'uuid' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/xcache/ini.sls b/php/ng/xcache/ini.sls index 46b65519..5cbb5ccd 100644 --- a/php/ng/xcache/ini.sls +++ b/php/ng/xcache/ini.sls @@ -1,18 +1,2 @@ -# Manages the php cli main ini file -{% from "php/ng/map.jinja" import php with context %} -{% from "php/ng/ini.jinja" import php_ini %} - include: - - php.ng.deprecated - -{% set settings = php.xcache.ini.defaults %} -{% for key, value in php.xcache.ini.settings.items() %} - {% if settings[key] is defined %} - {% do settings[key].update(value) %} - {% else %} - {% do settings.update({key: value}) %} - {% endif %} -{% endfor %} - -php_xcache_ini: - {{ php_ini(php.lookup.xcache.ini, php.xcache.ini.opts, settings) }} + - php.deprecated diff --git a/php/ng/xcache/init.sls b/php/ng/xcache/init.sls index 2214246c..5cbb5ccd 100644 --- a/php/ng/xcache/init.sls +++ b/php/ng/xcache/init.sls @@ -1,12 +1,2 @@ -# Installs php-xcache and manages the associated xcache.ini - include: - - php.ng.deprecated - - php.ng.xcache.install - - php.ng.xcache.ini - -extend: - php_xcache_ini: - file: - - require: - - sls: php.ng.xcache.install + - php.deprecated diff --git a/php/ng/xcache/install.sls b/php/ng/xcache/install.sls index 78caa756..5cbb5ccd 100644 --- a/php/ng/xcache/install.sls +++ b/php/ng/xcache/install.sls @@ -1,5 +1,2 @@ include: - - php.ng.deprecated - -{% set state = 'xcache' %} -{% include "php/ng/installed.jinja" %} + - php.deprecated diff --git a/php/ng/xdebug.sls b/php/ng/xdebug.sls index 1abe04a4..5cbb5ccd 100644 --- a/php/ng/xdebug.sls +++ b/php/ng/xdebug.sls @@ -1,2 +1,2 @@ -{% set state = 'xdebug' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/xml.sls b/php/ng/xml.sls index 70c974e0..5cbb5ccd 100644 --- a/php/ng/xml.sls +++ b/php/ng/xml.sls @@ -1,2 +1,2 @@ -{% set state = 'xml' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/xmlwriter.sls b/php/ng/xmlwriter.sls index 8e6dddd4..5cbb5ccd 100644 --- a/php/ng/xmlwriter.sls +++ b/php/ng/xmlwriter.sls @@ -1,2 +1,2 @@ -{% set state = 'xmlwriter' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/xsl.sls b/php/ng/xsl.sls index 9789f2d6..5cbb5ccd 100644 --- a/php/ng/xsl.sls +++ b/php/ng/xsl.sls @@ -1,2 +1,2 @@ -{% set state = 'xsl' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/ng/zip.sls b/php/ng/zip.sls index 1c5bd288..5cbb5ccd 100644 --- a/php/ng/zip.sls +++ b/php/ng/zip.sls @@ -1,2 +1,2 @@ -{% set state = 'zip' %} -{% include "php/ng/installed.jinja" %} +include: + - php.deprecated diff --git a/php/oauth.sls b/php/oauth.sls index e77abaad..79eebe87 100644 --- a/php/oauth.sls +++ b/php/oauth.sls @@ -1,9 +1,2 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-oauth: - pkg.installed: - - name: {{ php.oauth_pkg }} +{% set state = 'oauth' %} +{% include "php/installed.jinja" %} diff --git a/php/opcache.sls b/php/opcache.sls new file mode 100644 index 00000000..a6c70c2c --- /dev/null +++ b/php/opcache.sls @@ -0,0 +1,2 @@ +{% set state = 'opcache' %} +{% include "php/installed.jinja" %} diff --git a/php/openssl.sls b/php/openssl.sls new file mode 100644 index 00000000..ee1a66ad --- /dev/null +++ b/php/openssl.sls @@ -0,0 +1,2 @@ +{% set state = 'openssl' %} +{% include "php/installed.jinja" %} diff --git a/php/pdo.sls b/php/pdo.sls new file mode 100644 index 00000000..a93dadb0 --- /dev/null +++ b/php/pdo.sls @@ -0,0 +1,2 @@ +{% set state = 'pdo' %} +{% include "php/installed.jinja" %} diff --git a/php/pdo_mysql.sls b/php/pdo_mysql.sls new file mode 100644 index 00000000..f842b396 --- /dev/null +++ b/php/pdo_mysql.sls @@ -0,0 +1,2 @@ +{% set state = 'pdo_mysql' %} +{% include "php/installed.jinja" %} diff --git a/php/pear.sls b/php/pear.sls index 1a6d9768..e86171dd 100644 --- a/php/pear.sls +++ b/php/pear.sls @@ -1,9 +1,2 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-pear: - pkg.installed: - - name : {{ php.pear_pkg }} +{% set state = 'pear' %} +{% include "php/installed.jinja" %} diff --git a/php/pgsql.sls b/php/pgsql.sls index 70114eb7..47a2f832 100644 --- a/php/pgsql.sls +++ b/php/pgsql.sls @@ -1,9 +1,2 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-pgsql: - pkg.installed: - - name: {{ php.pgsql_pkg }} +{% set state = 'pgsql' %} +{% include "php/installed.jinja" %} diff --git a/php/phar.sls b/php/phar.sls new file mode 100644 index 00000000..2bba0040 --- /dev/null +++ b/php/phar.sls @@ -0,0 +1,2 @@ +{% set state = 'phar' %} +{% include "php/installed.jinja" %} diff --git a/php/posix.sls b/php/posix.sls new file mode 100644 index 00000000..1d1a3994 --- /dev/null +++ b/php/posix.sls @@ -0,0 +1,2 @@ +{% set state = 'posix' %} +{% include "php/installed.jinja" %} diff --git a/php/pspell.sls b/php/pspell.sls new file mode 100644 index 00000000..4155830b --- /dev/null +++ b/php/pspell.sls @@ -0,0 +1,2 @@ +{% set state = 'pspell' %} +{% include "php/installed.jinja" %} diff --git a/php/readline.sls b/php/readline.sls index 4fb8c788..41586207 100644 --- a/php/readline.sls +++ b/php/readline.sls @@ -1,10 +1,2 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-readline: - pkg: - - installed - - name: {{ php.readline_pkg }} +{% set state = 'readline' %} +{% include "php/installed.jinja" %} diff --git a/php/redis.sls b/php/redis.sls index b7a8f27c..7eb1c545 100644 --- a/php/redis.sls +++ b/php/redis.sls @@ -1,9 +1,2 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-redis: - pkg.installed: - - name : {{ php.redis_pkg }} +{% set state = 'redis' %} +{% include "php/installed.jinja" %} diff --git a/php/seclib.sls b/php/seclib.sls new file mode 100644 index 00000000..0baeec4f --- /dev/null +++ b/php/seclib.sls @@ -0,0 +1,2 @@ +{% set state = 'seclib' %} +{% include "php/installed.jinja" %} diff --git a/php/session.sls b/php/session.sls new file mode 100644 index 00000000..4edd21e7 --- /dev/null +++ b/php/session.sls @@ -0,0 +1,2 @@ +{% set state = 'session' %} +{% include "php/installed.jinja" %} diff --git a/php/simplexml.sls b/php/simplexml.sls new file mode 100644 index 00000000..048f3f3d --- /dev/null +++ b/php/simplexml.sls @@ -0,0 +1,2 @@ +{% set state = 'simplexml' %} +{% include "php/installed.jinja" %} diff --git a/php/snmp.sls b/php/snmp.sls new file mode 100644 index 00000000..2d5f4f28 --- /dev/null +++ b/php/snmp.sls @@ -0,0 +1,2 @@ +{% set state = 'snmp' %} +{% include "php/installed.jinja" %} diff --git a/php/soap.sls b/php/soap.sls index 89acf0d3..d991dd96 100644 --- a/php/soap.sls +++ b/php/soap.sls @@ -1,9 +1,2 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-soap: - pkg.installed: - - name : {{ php.soap_pkg }} +{% set state = 'soap' %} +{% include "php/installed.jinja" %} diff --git a/php/sqlite.sls b/php/sqlite.sls index 758c4688..644a9bbd 100644 --- a/php/sqlite.sls +++ b/php/sqlite.sls @@ -1,9 +1,2 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-sqlite: - pkg.installed: - - name: {{ php.sqlite_pkg }} +{% set state = 'sqlite' %} +{% include "php/installed.jinja" %} diff --git a/php/ssh2.sls b/php/ssh2.sls new file mode 100644 index 00000000..2af0de07 --- /dev/null +++ b/php/ssh2.sls @@ -0,0 +1,2 @@ +{% set state = 'ssh2' %} +{% include "php/installed.jinja" %} diff --git a/php/suhosin.sls b/php/suhosin.sls index a1682c30..f70220fe 100644 --- a/php/suhosin.sls +++ b/php/suhosin.sls @@ -1,43 +1,42 @@ -{%- from "php/map.jinja" import php with context %} +{% from "php/map.jinja" import php with context %} include: - - php.deprecated - php - php.dev -{%- set php_version = salt['pillar.get']('php:version', '7.0')|string %} +{% 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 %} +{% if salt['grains.get']('os') == "Ubuntu" %} + {% if php_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.suhosin5_ext %} - {%- set suhosin_name = 'suhosin' %} - {%- set suhosin_repo = php.suhosin5_repo %} - {%- set tmppath = '/tmp/suhosin5' %} -{%- endif %} + {% 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.build_pkgs }} + - pkgs: {{ php.lookup.pkgs.build_pkgs }} git: pkg.installed: [] @@ -62,29 +61,29 @@ install-suhosin: - shell: /bin/bash - runas: root - unless: - - test -e {{ php.ext_conf_path }}/{{ suhosin_name }}.ini + - 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.ext_conf_path }}/{{ suhosin_name }}.ini + - name: {{ php.lookup.pkgs.ext_conf_path }}/{{ suhosin_name }}.ini - contents: | extension={{ suhosin_ext }} suhosin.executor.include.whitelist=phar - require: - - pkg: {{ php.php_pkg }} + - pkg: php - cmd: install-suhosin - unless: - - test -e {{ php.ext_conf_path }}/{{ suhosin_name }}.ini + - test -e {{ php.lookup.pkgs.ext_conf_path }}/{{ suhosin_name }}.ini -{%- if salt['grains.get']('os_family') == "Debian" %} +{% if salt['grains.get']('os_family') == "Debian" %} php-suhosin-enable: cmd.run: - - name: {{ php.phpenmod_command }} {{ suhosin_name }} + - name: {{ php.lookup.pkgs.phpenmod_command }} {{ suhosin_name }} - require: - file: php-suhosin-conf -{%- endif %} +{% endif %} diff --git a/php/svn.sls b/php/svn.sls new file mode 100644 index 00000000..c1251f30 --- /dev/null +++ b/php/svn.sls @@ -0,0 +1,2 @@ +{% set state = 'svn' %} +{% include "php/installed.jinja" %} diff --git a/php/sybase.sls b/php/sybase.sls index a114b0b8..25fe2ef9 100644 --- a/php/sybase.sls +++ b/php/sybase.sls @@ -1,9 +1,2 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-sybase: - pkg.installed: - - name: {{ php.sybase_pkg }} +{% set state = 'sybase' %} +{% include "php/installed.jinja" %} diff --git a/php/tcpdf.sls b/php/tcpdf.sls new file mode 100644 index 00000000..63cd09b5 --- /dev/null +++ b/php/tcpdf.sls @@ -0,0 +1,2 @@ +{% set state = 'tcpdf' %} +{% include "php/installed.jinja" %} diff --git a/php/tidy.sls b/php/tidy.sls new file mode 100644 index 00000000..898d3ecc --- /dev/null +++ b/php/tidy.sls @@ -0,0 +1,2 @@ +{% set state = 'tidy' %} +{% include "php/installed.jinja" %} diff --git a/php/tokenizer.sls b/php/tokenizer.sls new file mode 100644 index 00000000..74857f39 --- /dev/null +++ b/php/tokenizer.sls @@ -0,0 +1,2 @@ +{% set state = 'tokenizer' %} +{% include "php/installed.jinja" %} diff --git a/php/uuid.sls b/php/uuid.sls new file mode 100644 index 00000000..d0720221 --- /dev/null +++ b/php/uuid.sls @@ -0,0 +1,2 @@ +{% set state = 'uuid' %} +{% include "php/installed.jinja" %} diff --git a/php/xcache/ini.sls b/php/xcache/ini.sls new file mode 100644 index 00000000..9ccfa2f1 --- /dev/null +++ b/php/xcache/ini.sls @@ -0,0 +1,15 @@ +# Manages the php cli main ini file +{% from "php/map.jinja" import php with context %} +{% from "php/ini.jinja" import php_ini %} + +{% set settings = php.xcache.ini.defaults %} +{% for key, value in php.xcache.ini.settings.items() %} + {% if settings[key] is defined %} + {% do settings[key].update(value) %} + {% else %} + {% do settings.update({key: value}) %} + {% endif %} +{% endfor %} + +php_xcache_ini: + {{ php_ini(php.lookup.xcache.ini, php.xcache.ini.opts, settings) }} diff --git a/php/xcache/init.sls b/php/xcache/init.sls new file mode 100644 index 00000000..1a3dbd1c --- /dev/null +++ b/php/xcache/init.sls @@ -0,0 +1,11 @@ +# Installs php-xcache and manages the associated xcache.ini + +include: + - php.xcache.install + - php.xcache.ini + +extend: + php_xcache_ini: + file: + - require: + - sls: php.xcache.install diff --git a/php/xcache/install.sls b/php/xcache/install.sls new file mode 100644 index 00000000..9694b77e --- /dev/null +++ b/php/xcache/install.sls @@ -0,0 +1,2 @@ +{% set state = 'xcache' %} +{% include "php/installed.jinja" %} diff --git a/php/xdebug.sls b/php/xdebug.sls new file mode 100644 index 00000000..cd7484a7 --- /dev/null +++ b/php/xdebug.sls @@ -0,0 +1,2 @@ +{% set state = 'xdebug' %} +{% include "php/installed.jinja" %} diff --git a/php/xml.sls b/php/xml.sls index 80ed33a7..7941c29c 100644 --- a/php/xml.sls +++ b/php/xml.sls @@ -1,9 +1,2 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-xml: - pkg.installed: - - name: {{ php.xml_pkg }} +{% set state = 'xml' %} +{% include "php/installed.jinja" %} diff --git a/php/xmlwriter.sls b/php/xmlwriter.sls new file mode 100644 index 00000000..76685d3a --- /dev/null +++ b/php/xmlwriter.sls @@ -0,0 +1,2 @@ +{% set state = 'xmlwriter' %} +{% include "php/installed.jinja" %} diff --git a/php/xsl.sls b/php/xsl.sls new file mode 100644 index 00000000..b29cd6fc --- /dev/null +++ b/php/xsl.sls @@ -0,0 +1,2 @@ +{% set state = 'xsl' %} +{% include "php/installed.jinja" %} diff --git a/php/zip.sls b/php/zip.sls index 49c0fd16..834e83f0 100644 --- a/php/zip.sls +++ b/php/zip.sls @@ -1,9 +1,2 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-zip: - pkg.installed: - - name: {{ php.zip_pkg }} +{% set state = 'zip' %} +{% include "php/installed.jinja" %} diff --git a/pillar.example b/pillar.example index f9a3c3ee..e7470dd8 100644 --- a/pillar.example +++ b/pillar.example @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # vim: ft=yaml --- -## php.ng pillar examples +## php pillar examples php: # Use the following values to mute deprecation warnings @@ -15,198 +15,197 @@ php: external_repo_name: 'ondrej/php' # Use Software Collections Repository offering PHP 5.4, 5.5, 5.6, 7.0 and 7.1 # https://www.softwarecollections.org/en/ for more information. - # SCL is only supported on RHEL and CentOS and only active when using php.ng + # SCL is only supported on RHEL and CentOS use_scl_repo: true # Which PHP version from the SCL repos to use scl_php_version: 71 # 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" - ng: - # set the version of php to be used - version: "7.3" - # can be a list of versions : - # version: - # - "7.3" - # - "7.2" - - # set the version for the Debian alternatives system, when using a list of versions, - # php:ng:version is used otherwise. - alternatives_version: "7.3" - - # this section contains mostly grain filtered data, while overrides - # are possible in the pillar for unique cases, if your OS is not - # represented, please consider adding it to the map.jinja for - # upstream inclusion - lookup: - enable_php_repo: centos-sclo-rh-testing - # package definitions, these can be strings, lists of strings, or - # lists of dictionaries - pkgs: - memcached: php5-memcached - # ensures both will be installed - curl: - - php-common - - curl - # a dictionary can be used in more complex cases where you want - # to pass forward special arguments to the pkg.installed call - # you MUST include the name argument for this to work - cli: - - - name: php-cli - fromrepo: my-specialrepo - - - name: php-common - skip_verify: true - - # php-fpm os-specific settings - fpm: - conf: /location/of/php-fpm/config.conf - ini: /location/of/php-fpm/php.ini - pools: /location/of/php-fpm/pool.d - service: name-of-php5-fpm-service - - # the default content of the php5-fpm main config file - defaults: - global: - pid: /var/run/php5-fpm.pid - - # php-cli os-specific settings + # set the version of php to be used + version: "7.3" + # can be a list of versions : + # version: + # - "7.3" + # - "7.2" + + # set the version for the Debian alternatives system, when using a list of versions, + # php:version is used otherwise. + alternatives_version: "7.3" + + # this section contains mostly grain filtered data, while overrides + # are possible in the pillar for unique cases, if your OS is not + # represented, please consider adding it to the map.jinja for + # upstream inclusion + lookup: + enable_php_repo: centos-sclo-rh-testing + # package definitions, these can be strings, lists of strings, or + # lists of dictionaries + pkgs: + memcached: php5-memcached + # ensures both will be installed + curl: + - php-common + - curl + # a dictionary can be used in more complex cases where you want + # to pass forward special arguments to the pkg.installed call + # you MUST include the name argument for this to work cli: - ini: /location/of/php-cli/php.ini - - # php-fpm settings + - + name: php-cli + fromrepo: my-specialrepo + - + name: php-common + skip_verify: true + + # php-fpm os-specific settings fpm: + conf: /location/of/php-fpm/config.conf + ini: /location/of/php-fpm/php.ini + pools: /location/of/php-fpm/pool.d + service: name-of-php5-fpm-service - # settings for the php-fpm service - service: - # if true, enables the php-fpm service, if false disables it - enabled: true - # additional arguments passed forward to - # service.enabled/disabled - opts: - reload: true - - # settings for the relevant php-fpm configuration files - config: - - # options to manage the php.ini file used by php-fpm - ini: - # arguments passed through to file.managed - opts: - recurse: true - # php.ini file contents that will be merged with the - # defaults in php.ng.ini.defaults. See php.ng.ini.defaults for - # syntax guidelines. - settings: - PHP: - engine: 'Off' - extension_dir: '/usr/lib/php/modules/' - extension: [pdo_mysql.so, iconv.so, openssl.so] - - # options to manage the php-fpm conf file - conf: - # arguments passed through to file.managed - opts: - recurse: true - # php-fpm conf file contents that will be merged with - # php.ng.lookup.fpm.defaults. See php.ng.ini.defaults for - # ini-style syntax guidelines. - settings: - global: - pid: /var/run/php-fpm/special-pid.file - - # settings for fpm-pools - pools: - # defaults will apply for each pools settings and can be overwritten - # by pool settings - defaults: - user: nginx - group: nginx - listen: /var/run/php-fpm-default.sock - - # name of the pool file to be managed, this will be appended - # to the path specified in php.ng.lookup.fpm.pools - 'mypool.conf': - # If true, the pool file will be managed, if false it will be - # absent - enabled: true - - # Overwrite the filename for ext_pillar that doesn't allow - # dots in fields names. - filname: my_other_name.conf - - # arguments passed forward to file.managed or file.absent - opts: - replace: false - - # pool file contents. See php.ng.ini.defaults for ini-style - # syntax guidelines. - settings: - myapp: - user: www-data - group: www-data - listen: /var/run/php5-fpm-myapp.sock - listen.owner: www-data - listen.group: www-data - listen.mode: 0660 - pm: dynamic - pm.max_children: 5 - pm.start_servers: 2 - pm.min_spare_servers: 1 - pm.max_spare_servers: 3 - 'php_admin_value[memory_limit]': 300M - - # php-cli settings + # the default content of the php5-fpm main config file + defaults: + global: + pid: /var/run/php5-fpm.pid + + # php-cli os-specific settings cli: - # settings to manage the cli's php.ini + ini: /location/of/php-cli/php.ini + + # php-fpm settings + fpm: + + # settings for the php-fpm service + service: + # if true, enables the php-fpm service, if false disables it + enabled: true + # additional arguments passed forward to + # service.enabled/disabled + opts: + reload: true + + # settings for the relevant php-fpm configuration files + config: + + # options to manage the php.ini file used by php-fpm ini: - # opts passed forward directly to file.managed + # arguments passed through to file.managed opts: - replace: false - # contents of the php.ini file that are merged with defaults - # from php.ng.ini.defaults. See php.ng.ini.defaults for ini-style - # syntax guidelines + recurse: true + # php.ini file contents that will be merged with the + # defaults in php.ini.defaults. See php.ini.defaults for + # syntax guidelines. settings: PHP: engine: 'Off' + extension_dir: '/usr/lib/php/modules/' + extension: [pdo_mysql.so, iconv.so, openssl.so] - # php-xcache settings - xcache: - ini: - opts: {} - # contents of the xcache.ini file that are merged with defaults - # from php.xcache.ini.defaults. See php.ng.ini.defaults for ini-style + # options to manage the php-fpm conf file + conf: + # arguments passed through to file.managed + opts: + recurse: true + # php-fpm conf file contents that will be merged with + # php.lookup.fpm.defaults. See php.ini.defaults for + # ini-style syntax guidelines. settings: - xcache: - xcache.size: 90M + global: + pid: /var/run/php-fpm/special-pid.file - # global php.ini settings - ini: - # Default php.ini contents. These follow a strict format. The top- - # level dict keys form ini group headings. Nested key/value - # pairs represent setting=value statements. If a value is a list, - # its contents will be joined by commas in final rendering. + # settings for fpm-pools + pools: + # defaults will apply for each pools settings and can be overwritten + # by pool settings defaults: + user: nginx + group: nginx + listen: /var/run/php-fpm-default.sock + + # name of the pool file to be managed, this will be appended + # to the path specified in php.lookup.fpm.pools + 'mypool.conf': + # If true, the pool file will be managed, if false it will be + # absent + enabled: true + + # Overwrite the filename for ext_pillar that doesn't allow + # dots in fields names. + filname: my_other_name.conf + + # arguments passed forward to file.managed or file.absent + opts: + replace: false + + # pool file contents. See php.ini.defaults for ini-style + # syntax guidelines. + settings: + myapp: + user: www-data + group: www-data + listen: /var/run/php5-fpm-myapp.sock + listen.owner: www-data + listen.group: www-data + listen.mode: 0660 + pm: dynamic + pm.max_children: 5 + pm.start_servers: 2 + pm.min_spare_servers: 1 + pm.max_spare_servers: 3 + 'php_admin_value[memory_limit]': 300M + + # php-cli settings + cli: + # settings to manage the cli's php.ini + ini: + # opts passed forward directly to file.managed + opts: + replace: false + # contents of the php.ini file that are merged with defaults + # from php.ini.defaults. See php.ini.defaults for ini-style + # syntax guidelines + settings: PHP: - engine: 'On' - output_buffering: 4096 - disable_functions: - - pcntl_alarm - - pcntl_fork - - pcntl_wait - 'CLI Server': - cli_server_color: 'On' - - # List of modules to install via php.ng.modules - modules: - # Calls `php.ng.` if available, or try to install the matching - # packages that can be set via from php:ng:lookup:pkgs - - cli - - fpm - - curl - - mysql - - # When using php.ng.apache2 on FreeBSD: - # Set this to false if you're not using apache-formula - use_apache_formula: true + engine: 'Off' + + # php-xcache settings + xcache: + ini: + opts: {} + # contents of the xcache.ini file that are merged with defaults + # from php.xcache.ini.defaults. See php.ini.defaults for ini-style + settings: + xcache: + xcache.size: 90M + + # global php.ini settings + ini: + # Default php.ini contents. These follow a strict format. The top- + # level dict keys form ini group headings. Nested key/value + # pairs represent setting=value statements. If a value is a list, + # its contents will be joined by commas in final rendering. + defaults: + PHP: + engine: 'On' + output_buffering: 4096 + disable_functions: + - pcntl_alarm + - pcntl_fork + - pcntl_wait + 'CLI Server': + cli_server_color: 'On' + + # List of modules to install via php.modules + modules: + # Calls `php.` if available, or try to install the matching + # packages that can be set via from php:lookup:pkgs + - cli + - fpm + - curl + - mysql + + # When using php.apache2 on FreeBSD: + # Set this to false if you're not using apache-formula + use_apache_formula: true diff --git a/pre-commit_semantic-release.sh b/pre-commit_semantic-release.sh index 54e1f333..5e0093c1 100755 --- a/pre-commit_semantic-release.sh +++ b/pre-commit_semantic-release.sh @@ -38,6 +38,4 @@ V_REPR=v${1} MAJOR=$(echo ${V_REPR} | cut -c-2) if [ ${MAJOR} = "v0" ]; then sed -i -e "s@^\(\s\+\`\).*\(\s\`_\.\)@\1${V_REPR}\2${V_REPR}\3@" docs/README.rst - sed -i -e "s@^\(\s\+# the final release tag before \`v1.0.0\`, which is expected to be \`\).*\(\`.\s\+#\)@\1${V_REPR}\2@" php/deprecated.sls - sed -i -e "s@^\(\s\+# the final release tag before \`v1.0.0\`, which is expected to be \`\).*\(\`.\s\+#\)@\1${V_REPR}\2@" php/ng/deprecated.sls fi diff --git a/release.config.js b/release.config.js index fc3862a8..afa0cb11 100644 --- a/release.config.js +++ b/release.config.js @@ -14,7 +14,7 @@ module.exports = { prepareCmd: 'sh ./pre-commit_semantic-release.sh ${nextRelease.version}', }], ['@semantic-release/git', { - assets: ['*.md', 'docs/*.rst', 'FORMULA', 'php/deprecated.sls', 'php/ng/deprecated.sls'], + assets: ['*.md', 'docs/*.rst', 'FORMULA'], }], '@semantic-release/github', ],