From ebd7e2a475e3430d19dd25ce6f5bb3e222867d4b Mon Sep 17 00:00:00 2001 From: Daniel Oetken Date: Thu, 22 Oct 2015 17:20:28 +0200 Subject: [PATCH 1/4] Add xcache support to php ng formula --- README.rst | 6 ++++++ php/ng/map.jinja | 3 +++ php/ng/xcache.sls | 2 ++ 3 files changed, 11 insertions(+) create mode 100644 php/ng/xcache.sls diff --git a/README.rst b/README.rst index d764a13..d2a10d6 100644 --- a/README.rst +++ b/README.rst @@ -395,6 +395,12 @@ Installs the php-sqlite package, Installs the php-suhosin package. +``php.ng.xcache`` +--------------- + +Installs the php-xcache package. +Disabled on opensuse need server:php:extensions repo + ``php.ng.xml`` -------------- diff --git a/php/ng/map.jinja b/php/ng/map.jinja index 0ae6188..a7c1f6b 100644 --- a/php/ng/map.jinja +++ b/php/ng/map.jinja @@ -26,6 +26,7 @@ 'pspell': 'php5-pspell', 'soap': 'php-soap', 'sqlite': 'php5-sqlite', + 'xcache': 'php5-xcache', 'xdebug': 'php5-xdebug', 'xsl': 'php5-xsl', 'xml': 'php5', @@ -103,6 +104,7 @@ 'pear': 'php-pear', 'soap': 'php-soap', 'sqlite': 'php5-sqlite', + 'xcache': 'php-xcache', 'xml': 'php-xml', 'redis': 'php-redis', 'imagick': 'php-imagick', @@ -185,6 +187,7 @@ 'memcached': 'php-memcached', 'pear': 'php-pear', 'sqlite': 'php-sqlite', + 'xcache': 'php-xcache', 'pgsql': 'php-pgsql', 'ldap': 'php-ldap', }, diff --git a/php/ng/xcache.sls b/php/ng/xcache.sls new file mode 100644 index 0000000..82a7eb4 --- /dev/null +++ b/php/ng/xcache.sls @@ -0,0 +1,2 @@ +{% set state = 'xcache' %} +{% include "php/ng/installed.jinja" %} From 1fdf1723af0af1f6af60bec90951a863009525d4 Mon Sep 17 00:00:00 2001 From: Daniel Oetken Date: Thu, 22 Oct 2015 18:44:42 +0200 Subject: [PATCH 2/4] made sure every sls in php ng is mentioned in the README and sorted alphabetically --- README.rst | 86 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 60 insertions(+), 26 deletions(-) diff --git a/README.rst b/README.rst index d2a10d6..603a634 100644 --- a/README.rst +++ b/README.rst @@ -75,7 +75,6 @@ Installs the php-gd package. Installs the php-intl package. - ``php.imagick`` --------------- @@ -107,7 +106,6 @@ Installs the php-mbstring package. Installs the php-mcrypt package. - ``php.memcache`` ---------------- @@ -196,6 +194,21 @@ Installs the php package. Installs the php-adodb package. +``php.ng.apache2`` +---------------- + +Meta-state that combines `php.ng.apache2.install`_ and `php.ng.apache2.ini`_. + +``php.ng.apache2.ini`` +-------------- + +Manages the apache2 php.ini file + +``php.ng.apache2.install`` +-------------- + +Installs the apache2 and libapache2-mod-php5 package. Debian Only. + ``php.ng.apc`` -------------- @@ -219,16 +232,16 @@ Disabled on opensuse only php5-fastcgi available. Meta-state that combines `php.ng.cli.install`_ and `php.ng.cli.ini`_. -``php.ng.cli.install`` ----------------------- - -Installs the php-cli package. - ``php.ng.cli.ini`` ------------------ Manages the php-cli ini file. +``php.ng.cli.install`` +---------------------- + +Installs the php-cli package. + ``php.ng.curl`` --------------- @@ -246,30 +259,41 @@ Meta-state that combines all php.ng.fpm states. Manages the (non-pool) php-fpm config files. - ``php.ng.fpm.install`` ---------------------- Installs the php-fpm package. - ``php.ng.fpm.pools`` -------------------- Meta-state that combines `php.ng.fpm.service`_ and `php.ng.fpm.pools_config`_ - ``php.ng.fpm.pools_config`` --------------------------- Manages php-fpm pool config files. - ``php.ng.fpm.service`` ---------------------- Manages the php-fpm service. +``php.ng.gd`` +------------- + +Installs the php-gd package. + +``php.ng.geoip`` +---------------------- + +Installs the php-geoip package. + +``php.ng.gmp`` +---------- + +Installs the php-gmp package. Debian Only. + ``php.ng.hhvm`` --------------- @@ -295,12 +319,6 @@ Configures the hhvm repo for debian/ubuntu Manages the php-hhvm service. -``php.ng.gd`` -------------- - -Installs the php-gd package. - - ``php.ng.imagick`` ------------------ @@ -337,21 +355,18 @@ Installs the php-mbstring package. Installs the php-mcrypt package. - ``php.ng.memcache`` ------------------- Installs the php-memcache package. Disabled on opensuse need server:php:extensions repo - ``php.ng.memcached`` -------------------- Installs the php-memcached package. Disabled on opensuse need server:php:extensions repo - ``php.ng.mysql`` ---------------- @@ -363,23 +378,32 @@ Installs the php-mysql package. Installs the php-mysqlnd package. Disabled on opensuse no package. +``php.ng.oauth`` +--------------- + +Installs the php-oauth package. + ``php.ng.pear`` --------------- Installs the php-pear package. +``php.ng.pgsql`` +---------------- + +Installs the php-pgsql package. + +``php.ng.pspell`` +---------------- + +Installs the php-pspell package. + ``php.ng.redis`` --------------- Installs the php-redis package. Disabled on opensuse need server:php:extensions repo - -``php.ng.pgsql`` ----------------- - -Installs the php-pgsql package. - ``php.ng.soap`` --------------- @@ -401,7 +425,17 @@ Installs the php-suhosin package. Installs the php-xcache package. Disabled on opensuse need server:php:extensions repo +``php.ng.xdebug`` +-------------- + +Installs the php-xdebug package. + ``php.ng.xml`` -------------- Installs the php-xml package. + +``php.ng.xsl`` +-------------- + +Installs the php-xsl package. From 861ddd2db4b060fd9ad785d0e22cbc1a89fca0fd Mon Sep 17 00:00:00 2001 From: Daniel Oetken Date: Fri, 23 Oct 2015 23:35:05 +0200 Subject: [PATCH 3/4] manage xcache.ini in pillar --- README.rst | 10 +++++ php/ng/map.jinja | 54 +++++++++++++++++++++++ php/ng/xcache/ini.sls | 15 +++++++ php/ng/xcache/init.sls | 11 +++++ php/ng/{xcache.sls => xcache/install.sls} | 0 5 files changed, 90 insertions(+) create mode 100644 php/ng/xcache/ini.sls create mode 100644 php/ng/xcache/init.sls rename php/ng/{xcache.sls => xcache/install.sls} (100%) diff --git a/README.rst b/README.rst index 603a634..b9dbb1c 100644 --- a/README.rst +++ b/README.rst @@ -422,6 +422,16 @@ Installs the php-suhosin package. ``php.ng.xcache`` --------------- +Meta-state that combines `php.ng.xcache.install`_ and `php.ng.xcache.ini`_. + +``php.ng.xcache.ini`` +--------------- + +Manages the php-xcache ini file + +``php.ng.xcache.install`` +--------------- + Installs the php-xcache package. Disabled on opensuse need server:php:extensions repo diff --git a/php/ng/map.jinja b/php/ng/map.jinja index a7c1f6b..7598d3f 100644 --- a/php/ng/map.jinja +++ b/php/ng/map.jinja @@ -82,6 +82,10 @@ 'apache2': { 'ini': '/etc/php5/apache2/php.ini', }, + 'xcache': { + 'ini': '/etc/php5/mods-available/xcache.ini', + 'defaults': {}, + }, }, 'RedHat': { 'pkgs': { @@ -131,6 +135,9 @@ 'cli': { 'ini': '/etc/php.ini', }, + 'xcache': { + 'ini': '/etc/php.d/xcache.ini', + }, }, 'Suse': { 'pkgs': { @@ -207,6 +214,9 @@ 'cli': { 'ini': '/etc/php.ini', }, + 'xcache': { + 'ini': '/etc/php/conf.d/xcache.ini', + }, }, }), 'fpm': { @@ -254,6 +264,50 @@ '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': { diff --git a/php/ng/xcache/ini.sls b/php/ng/xcache/ini.sls new file mode 100644 index 0000000..efed11d --- /dev/null +++ b/php/ng/xcache/ini.sls @@ -0,0 +1,15 @@ +# Manages the php cli main ini file +{% from 'php/ng/map.jinja' import php with context %} +{% from "php/ng/ini.jinja" import php_ini %} + +{% set settings = php.xcache.ini.defaults %} +{% for key, value in php.xcache.ini.settings.iteritems() %} + {% 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/ng/xcache/init.sls b/php/ng/xcache/init.sls new file mode 100644 index 0000000..fb6e07f --- /dev/null +++ b/php/ng/xcache/init.sls @@ -0,0 +1,11 @@ +# Installs php-xcache and manages the associated xcache.ini + +include: + - php.ng.xcache.install + - php.ng.xcache.ini + +extend: + php_xcache_ini: + file: + - require: + - sls: php.ng.xcache.install diff --git a/php/ng/xcache.sls b/php/ng/xcache/install.sls similarity index 100% rename from php/ng/xcache.sls rename to php/ng/xcache/install.sls From 767d94c40d693dfd86ffc88b402bc6678bcebbb3 Mon Sep 17 00:00:00 2001 From: Daniel Oetken Date: Sat, 24 Oct 2015 00:34:18 +0200 Subject: [PATCH 4/4] pillar example for xcache.ini --- pillar.example | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pillar.example b/pillar.example index 1f83b68..2616a57 100644 --- a/pillar.example +++ b/pillar.example @@ -134,6 +134,16 @@ php: PHP: 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.ng.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-