Skip to content

Commit 15b0dab

Browse files
committed
Code cleanup
1 parent d7a5096 commit 15b0dab

File tree

2 files changed

+9
-19
lines changed

2 files changed

+9
-19
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ All notable changes to this project will be documented in this file, in reverse
1010

1111
### Changed
1212

13-
- Hide server info.
13+
- Nothing
1414

1515
### Deprecated
1616

src/Handler.pm

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ use strict;
2727
use warnings;
2828
use File::Spec;
2929
use File::Temp;
30-
use iMSCP::Boolean;
3130
use iMSCP::Crypt qw/ decryptRijndaelCBC encryptRijndaelCBC randomStr /;
3231
use iMSCP::Cwd '$CWD';
3332
use iMSCP::Database;
@@ -148,8 +147,6 @@ sub uninstall
148147

149148
local $@;
150149
eval {
151-
local $self->{'dbh'}->{'RaiseError'} = TRUE;
152-
153150
$self->{'dbh'}->do(
154151
"DROP DATABASE IF EXISTS `@{ [ $::imscpConfig{'DATABASE_NAME'} . '_pma' ] }`"
155152
);
@@ -201,19 +198,19 @@ sub afterFrontEndBuildConfFile
201198
{
202199
my ( $tplContent, $tplName ) = @_;
203200

204-
return 0 unless grep (
205-
$_ eq $tplName, '00_master.nginx', '00_master_ssl.nginx'
206-
);
201+
return 0 unless grep ( $_ eq $tplName, qw/
202+
00_master.nginx 00_master_ssl.nginx
203+
/ );
207204

208205
${ $tplContent } = replaceBloc(
209206
"# SECTION custom BEGIN.\n",
210207
"# SECTION custom END.\n",
211208
" # SECTION custom BEGIN.\n"
212209
. getBloc(
213-
"# SECTION custom BEGIN.\n",
214-
"# SECTION custom END.\n",
215-
${ $tplContent }
216-
)
210+
"# SECTION custom BEGIN.\n",
211+
"# SECTION custom END.\n",
212+
${ $tplContent }
213+
)
217214
. " include imscp_pma.conf;\n"
218215
. " # SECTION custom END.\n",
219216
${ $tplContent }
@@ -260,8 +257,6 @@ sub _buildConfigFiles
260257
local $@;
261258
my $rs = eval {
262259
# Main configuration file
263-
local $self->{'dbh'}->{'RaiseError'} = TRUE;
264-
265260
my %config = @{ $self->{'dbh'}->selectcol_arrayref(
266261
"SELECT `name`, `value` FROM `config` WHERE `name` LIKE 'PMA_%'",
267262
{ Columns => [ 1, 2 ] }
@@ -408,10 +403,7 @@ sub _setupDatabase
408403
my $database = ::setupGetQuestion( 'DATABASE_NAME' ) . '_pma';
409404

410405
local $@;
411-
eval {
412-
local $self->{'dbh'}->{'RaiseError'} = TRUE;
413-
$self->{'dbh'}->do( "DROP DATABASE IF EXISTS `$database`" );
414-
};
406+
eval { $self->{'dbh'}->do( "DROP DATABASE IF EXISTS `$database`" ); };
415407
if ( $@ ) {
416408
error( $@ );
417409
return 1;
@@ -471,8 +463,6 @@ sub _setupSqlUser
471463
$self->{'_pma_control_user_passwd'}
472464
);
473465

474-
local $self->{'dbh'}->{'RaiseError'} = TRUE;
475-
476466
$self->{'dbh'}->do(
477467
'GRANT USAGE ON `mysql`.* TO ?@?',
478468
undef,

0 commit comments

Comments
 (0)