-
Notifications
You must be signed in to change notification settings - Fork 29
Add runkit #64
base: master
Are you sure you want to change the base?
Add runkit #64
Changes from 9 commits
e16b408
a9bc444
a903ff9
ff38eaf
d10aaa1
65be642
30a8d80
5b02ed1
0876dc4
eeb73b0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Installs a php extension for a specific version of php. | ||
# | ||
# Usage: | ||
# | ||
# php::extension::runkit { 'runkit for 5.4.10': | ||
# php => '5.4.10', | ||
# version => '1.0.3' | ||
# } | ||
# | ||
define php::extension::runkit( | ||
$php, | ||
$version = '1.0.3' | ||
) { | ||
include boxen::config | ||
|
||
require php::config | ||
# Require php version eg. php::5_4_10 | ||
# This will compile, install and set up config dirs if not present | ||
php_require($php) | ||
|
||
$extension = 'runkit' | ||
|
||
# Final module install path | ||
$module_path = "${php::config::root}/versions/${php}/modules/${extension}.so" | ||
|
||
# Clone the source respository | ||
repository { "${php::config::extensioncachedir}/runkit": | ||
source => 'namesco/runkit' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not a fan of using non-canonical source. Can you get the upstream tagged by the original author? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The "canonical" source for runkit is... complicated. The PECL extension hasn't had a release for 8 years: https://pecl.php.net/package/runkit Basically it's a mess, I can request any of these upstreams to create a tag, but none are the canonical source. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think even getting those to make a tag would be better than forking and tagging your own. I don't know. It makes me wonder if this is really appropriate for inclusion in the first place if it is that poorly supported. |
||
} | ||
|
||
|
||
# Additional options | ||
$configure_params = '' | ||
|
||
php_extension { $name: | ||
provider => 'git', | ||
|
||
extension => $extension, | ||
version => $version, | ||
|
||
homebrew_path => $boxen::config::homebrewdir, | ||
phpenv_root => $php::config::root, | ||
php_version => $php, | ||
|
||
cache_dir => $php::config::extensioncachedir, | ||
require => Repository["${php::config::extensioncachedir}/runkit"], | ||
|
||
configure_params => $configure_params, | ||
} | ||
|
||
# Add config file once extension is installed | ||
|
||
file { "${php::config::configdir}/${php}/conf.d/${extension}.ini": | ||
content => template('php/extensions/runkit.ini.erb'), | ||
require => Php_extension[$name], | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
require 'spec_helper' | ||
|
||
describe "php::extension::runkit" do | ||
let(:facts) { default_test_facts } | ||
let(:title) { "runkit for 5.4.17" } | ||
let(:params) do | ||
{ | ||
:php => "5.4.17", | ||
:version => "1.0.3" | ||
} | ||
end | ||
|
||
it do | ||
should contain_class("php::config") | ||
should contain_php__version("5.4.17") | ||
|
||
should contain_repository("/test/boxen/data/php/cache/extensions/runkit").with({ | ||
:source => "namesco/runkit" | ||
}) | ||
|
||
should contain_php_extension("runkit for 5.4.17").with({ | ||
:provider => "git", | ||
:extension => "runkit", | ||
:version => "1.0.3", | ||
:homebrew_path => "/test/boxen/homebrew", | ||
:phpenv_root => "/test/boxen/phpenv", | ||
:php_version => "5.4.17", | ||
:cache_dir => "/test/boxen/data/php/cache/extensions", | ||
:require => "Repository[/test/boxen/data/php/cache/extensions/runkit]", | ||
}) | ||
|
||
should contain_file("/test/boxen/config/php/5.4.17/conf.d/runkit.ini").with({ | ||
:content => File.read("spec/fixtures/runkit.ini"), | ||
:require => "Php_extension[runkit for 5.4.17]" | ||
}) | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
extension=/test/boxen/phpenv/versions/5.4.17/modules/runkit.so | ||
|
||
runkit.internal_override=1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
extension=<%= @module_path %> | ||
|
||
runkit.internal_override=1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
zend_extension=<%= @module_path %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New syntax here please.