Skip to content

Commit 0cfd6a5

Browse files
authored
Merge pull request #567 from coreyralph/zend-ext-enable
Fix enabling of zend extensions
2 parents 80e9279 + ab23f26 commit 0cfd6a5

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

manifests/extension/config.pp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,19 +112,21 @@
112112

113113
if $facts['os']['family'] == 'Debian' and $ext_tool_enabled {
114114
$cmd = "${ext_tool_enable} -s ${sapi} ${so_name}"
115+
$execname = "ext_tool_enable_${so_name}"
115116

116117
$_sapi = $sapi? {
117118
'ALL' => 'cli',
118119
default => $sapi,
119120
}
120-
if has_key($final_settings, 'extension') and $final_settings[extension] {
121-
exec { $cmd:
121+
if has_key($final_settings, $extension_key) and $final_settings[$extension_key] {
122+
exec { $execname:
123+
command => $cmd,
122124
onlyif => "${ext_tool_query} -s ${_sapi} -m ${so_name} | /bin/grep 'No module matches ${so_name}'",
123125
require => ::Php::Config[$title],
124126
}
125127

126128
if $php::fpm {
127-
Package[$php::fpm::package] ~> Exec[$cmd]
129+
Package[$php::fpm::package] ~> Exec[$execname]
128130
}
129131
}
130132
}

spec/defines/extension_spec.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,21 @@
189189
it { is_expected.to contain_php__config('xdebug').with_config('zend_extension' => '/usr/lib/php5/20100525/xdebug.so') }
190190
end
191191

192+
if facts[:os]['family'] == 'Debian'
193+
context 'on Debian family' do
194+
context 'zend extensions call ext_tool_enable' do
195+
let(:title) { 'xdebug' }
196+
let(:params) do
197+
{
198+
zend: true
199+
}
200+
end
201+
202+
it { is_expected.to contain_exec('ext_tool_enable_xdebug') }
203+
end
204+
end
205+
end
206+
192207
case facts[:os]['name']
193208
when 'Debian'
194209
context 'on Debian' do

0 commit comments

Comments
 (0)