Skip to content

Commit 69d6864

Browse files
committed
Changes for the extension class
- Phpbrew uses 'stable' as the default version for extensions, we should use it here too. - We can't assume httpd/apache is installed on the system, so we start with an undefined service to reload which will do nothing. To reload a service your should pass it explicitly. - Cleanup if statement
1 parent 3280692 commit 69d6864

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

manifests/extension.pp

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717
define phpbrew::extension(
1818
$extension = undef,
1919
$php_version = undef,
20-
$version = undef,
20+
$version = 'stable',
2121
$install_dir = '/opt/phpbrew',
22+
$reload_service = undef,
2223
) {
2324
if ! $extension {
2425
$extension_name = $title
@@ -27,14 +28,14 @@
2728
}
2829

2930
if ! $php_version {
30-
warning('No php version for extension given. Install aborted.')
31-
} else {
32-
exec { "phpbrew_extension_${extension_name}-${php_version}-${version}":
33-
command => "/root/.phpbrew/install_extension.sh ${php_version} ${extension_name} ${version}",
34-
timeout => 0,
35-
user => 'root',
36-
creates => "${install_dir}/php/php-${php_version}/var/db/${extension_name}.ini",
37-
notify => Service['httpd']
38-
}
31+
fail('No php version for extension given. Install aborted.')
32+
}
33+
34+
exec { "phpbrew_extension_${extension_name}-${php_version}-${version}":
35+
command => "/root/.phpbrew/install_extension.sh ${php_version} ${extension_name} ${version}",
36+
timeout => 0,
37+
user => 'root',
38+
creates => "${install_dir}/php/php-${php_version}/var/db/${extension_name}.ini",
39+
notify => Service[$reload_service]
3940
}
40-
}
41+
}

0 commit comments

Comments
 (0)