Gergő Tisza has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403843 )

Change subject: Add php::pecl role
......................................................................

Add php::pecl role

Change-Id: I747bf802a2b7a9071cffebb691acd3ac634c85f0
---
A puppet/modules/php/manifests/pecl.pp
1 file changed, 51 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/43/403843/1

diff --git a/puppet/modules/php/manifests/pecl.pp 
b/puppet/modules/php/manifests/pecl.pp
new file mode 100644
index 0000000..2702a00
--- /dev/null
+++ b/puppet/modules/php/manifests/pecl.pp
@@ -0,0 +1,51 @@
+# == Define: php::pecl
+#
+# Installs or uninstalls a PECL PHP module.
+#
+# === Parameters
+#
+# [*package*]
+#   The name of the package to install. Defaults to the title. Can
+#   include a version number (e.g. it could be 'stats' or 'stats-1.0.5').
+#
+# [*ensure*]
+#   The intended state ('present' or 'absent').
+#
+# === Examples
+#
+# Install the apcu module:
+#
+#   php::pecl { 'apcu':
+#   }
+#
+define php::pecl(
+    $package = $title,
+    $ensure  = 'present',
+) {
+    include ::php
+    validate_ensure($ensure)
+
+    package { 'php-pear':
+        ensure  => present,
+        require => Package['php5'],
+    }
+
+    if ( $ensure == 'present' ) {
+        exec { "install ${package} PECL package":
+            command => "pecl install ${package}",
+            unless  => "pecl info ${package}",
+            require => Package['php-pear'],
+        }
+        php::ini { "pecl-${package}":
+            settings => {
+                extension => "${package}.so",
+            },
+        }
+    } else {
+        exec { "uninstall ${package} PECL package":
+            command => "pecl uninstall ${package}",
+            unless  => "pecl info ${pckage}",
+            require => Package['php-pear'],
+        }
+    }
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/403843
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I747bf802a2b7a9071cffebb691acd3ac634c85f0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: GergÅ‘ Tisza <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to