Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.

Commit

Permalink
Merge pull request #28 from eebs/mongo
Browse files Browse the repository at this point in the history
Added mongo extension
  • Loading branch information
mattheath committed Feb 25, 2014
2 parents 2514020 + de7ac96 commit b592ef9
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions manifests/extension/mongo.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Installs the mongo extension for a specific version of php.
#
# Usage:
#
# php::extension::mongo { 'mongo for 5.4.10':
# php => '5.4.10',
# version => '1.4.5'
# }
#
define php::extension::mongo(
$php,
$version = '1.4.5'
) {
require php::config
# Require php version eg. php::5_4_10
# This will compile, install and set up config dirs if not present
require join(['php', join(split($php, '[.]'), '_')], '::')

$extension = 'mongo'
$package_name = "mongo-${version}"
$url = "http://pecl.php.net/get/mongo-${version}.tgz"

# Final module install path
$module_path = "${php::config::root}/versions/${php}/modules/${extension}.so"

php_extension { $name:
extension => $extension,
version => $version,
package_name => $package_name,
package_url => $url,
homebrew_path => $boxen::config::homebrewdir,
phpenv_root => $php::config::root,
php_version => $php,
cache_dir => $php::config::extensioncachedir,
}

# Add config file once extension is installed

file { "${php::config::configdir}/${php}/conf.d/${extension}.ini":
content => template("php/extensions/generic.ini.erb"),
require => Php_extension[$name],
}

}

0 comments on commit b592ef9

Please sign in to comment.