Skip to content

Commit cfbbfc2

Browse files
authored
Merge pull request #4 from EdwinHoksberg/smallFixes
LGTM Thanks
2 parents ff1dc0d + e1067d8 commit cfbbfc2

File tree

3 files changed

+35
-24
lines changed

3 files changed

+35
-24
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Puppet module for phpbrew.
77

88
phpbrew::install{ '5.3.27':
99
$version = '',
10-
$build_prameters = undef,
10+
$build_parameters = undef,
1111
$php_inis = undef,
1212
$install_dir = '/opt/phpbrew',
1313
)
@@ -19,7 +19,7 @@ You can additional define the version (if the name should be different), the bui
1919

2020
phpbrew::install{ 'php-5.3.27':
2121
$version => '5.3.27',
22-
$build_prameters => '+mysql',
22+
$build_parameters => '+mysql',
2323
$php_inis => [
2424
'/etc/php5/mods-available/custom.ini'
2525
],
@@ -29,7 +29,7 @@ You can additional define the version (if the name should be different), the bui
2929
Default values:
3030

3131
$version = '',
32-
$build_prameters = undef
32+
$build_parameters = undef
3333
$php_inis = undef
3434
$install_dir = '/opt/phpbrew'
3535

@@ -75,4 +75,4 @@ Default values:
7575
## Copyright
7676

7777
Alexander Schneider - Jankowfsky AG
78-
www.jankowfsky.com
78+
www.jankowfsky.com

manifests/init.pp

+21-10
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,25 @@
1414
class phpbrew (
1515
$php_install_dir = '/opt/phpbrew'
1616
) {
17-
case $operatingsystem {
17+
case $::operatingsystem {
1818
centos, redhat: {
1919
fail('CentOS or RedHat are not supported yet')
2020
}
2121
debian, ubuntu: {
2222
exec { '/usr/bin/apt-get -y update': }
2323

24-
$dependencies = [ 'autoconf', 'automake', 'curl', 'build-essential', 'libxslt1-dev', 're2c', 'libxml2-dev', 'php5-cli', 'libmcrypt-dev', 'php5-dev' ]
24+
$dependencies = [
25+
'autoconf',
26+
'automake',
27+
'curl',
28+
'build-essential',
29+
'libxslt1-dev',
30+
're2c',
31+
'libxml2-dev',
32+
'php5-cli',
33+
'libmcrypt-dev',
34+
'php5-dev'
35+
]
2536

2637
each($dependencies) |$dependency| {
2738
if ! defined(Package[$dependency]) {
@@ -56,37 +67,37 @@
5667

5768
exec { 'init phpbrew':
5869
command => '/usr/bin/sudo /usr/bin/phpbrew init',
59-
creates => "/root/.phpbrew/bashrc",
70+
creates => '/root/.phpbrew/bashrc',
6071
subscribe => File['/usr/bin/phpbrew'],
6172
refreshonly => true,
6273
}
6374

6475
file { $php_install_dir:
65-
ensure => 'directory',
76+
ensure => 'directory',
6677
require => Exec['init phpbrew'],
6778
}
6879

6980
# Specify where versions of PHP will be installed.
70-
file { "/root/.phpbrew/init":
81+
file { '/root/.phpbrew/init':
7182
content => "export PHPBREW_ROOT=${php_install_dir}",
7283
require => Exec['init phpbrew']
7384
}
7485

7586
# Load phpbrew configuration by default.
7687
file_line { 'add phpbrew to bashrc':
77-
path => '/root/.bashrc',
78-
line => "source /root/.phpbrew/bashrc",
88+
path => '/root/.bashrc',
89+
line => 'source /root/.phpbrew/bashrc',
7990
require => Exec['init phpbrew'],
8091
}
8192

8293
exec { 'update basbrc':
83-
command => "/bin/bash"
94+
command => '/bin/bash'
8495
}
8596

86-
file { "/root/.phpbrew/install_extension.sh":
97+
file { '/root/.phpbrew/install_extension.sh':
8798
ensure => present,
8899
mode => 'a+x',
89-
source => "puppet:///modules/phpbrew/install_extension.sh",
100+
source => 'puppet:///modules/phpbrew/install_extension.sh',
90101
require => Exec['init phpbrew']
91102
}
92103
}

manifests/install.pp

+10-10
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#
1717
define phpbrew::install(
1818
$version = '',
19-
$build_prameters = undef,
19+
$build_parameters = undef,
2020
$php_inis = undef,
2121
$install_dir = '/opt/phpbrew',
2222
) {
@@ -28,29 +28,29 @@
2828
$php_version = $version
2929
}
3030

31-
if $build_prameters {
32-
$extra_params = $build_prameters
31+
if $build_parameters {
32+
$extra_params = $build_parameters
3333
} elsif versioncmp($php_version, '5.3') < 0 {
3434
$extra_params = ''
3535
} else {
3636
$extra_params = ''
3737
}
3838

3939
exec { "install php-${php_version}":
40-
command => "/usr/bin/sudo PHPBREW_ROOT=${install_dir} /usr/bin/phpbrew install --old php-${php_version} +default +intl ${extra_params}",
41-
creates => "${install_dir}/php/php-${php_version}/bin/php",
42-
timeout => 0,
40+
command => "/usr/bin/sudo PHPBREW_ROOT=${install_dir} /usr/bin/phpbrew install --old php-${php_version} +default +intl ${extra_params}",
41+
creates => "${install_dir}/php/php-${php_version}/bin/php",
42+
timeout => 0,
4343
}
4444

4545
file { "/usr/lib/cgi-bin/fcgiwrapper-${php_version}.sh":
46-
ensure => present,
47-
content => template("phpbrew/fcgiwrapper.sh.erb"),
46+
ensure => present,
47+
content => template('phpbrew/fcgiwrapper.sh.erb'),
4848
mode => 'a+x',
4949
require => Exec["install php-${php_version}"]
5050
}
5151

5252
file { "${install_dir}/php/php-${php_version}/lib/php/share":
53-
ensure => "directory",
53+
ensure => 'directory',
5454
require => Exec["install php-${php_version}"]
5555
}
5656

@@ -59,7 +59,7 @@
5959
"${install_dir}/php/php-${php_version}/var",
6060
"${install_dir}/php/php-${php_version}/var/db"
6161
]:
62-
ensure => "directory",
62+
ensure => 'directory',
6363
require => Exec["install php-${php_version}"]
6464
}
6565

0 commit comments

Comments
 (0)