Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nuxwin committed May 12, 2019
1 parent d7a5096 commit 15b0dab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ All notable changes to this project will be documented in this file, in reverse

### Changed

- Hide server info.
- Nothing

### Deprecated

Expand Down
26 changes: 8 additions & 18 deletions src/Handler.pm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ use strict;
use warnings;
use File::Spec;
use File::Temp;
use iMSCP::Boolean;
use iMSCP::Crypt qw/ decryptRijndaelCBC encryptRijndaelCBC randomStr /;
use iMSCP::Cwd '$CWD';
use iMSCP::Database;
Expand Down Expand Up @@ -148,8 +147,6 @@ sub uninstall

local $@;
eval {
local $self->{'dbh'}->{'RaiseError'} = TRUE;

$self->{'dbh'}->do(
"DROP DATABASE IF EXISTS `@{ [ $::imscpConfig{'DATABASE_NAME'} . '_pma' ] }`"
);
Expand Down Expand Up @@ -201,19 +198,19 @@ sub afterFrontEndBuildConfFile
{
my ( $tplContent, $tplName ) = @_;

return 0 unless grep (
$_ eq $tplName, '00_master.nginx', '00_master_ssl.nginx'
);
return 0 unless grep ( $_ eq $tplName, qw/
00_master.nginx 00_master_ssl.nginx
/ );

${ $tplContent } = replaceBloc(
"# SECTION custom BEGIN.\n",
"# SECTION custom END.\n",
" # SECTION custom BEGIN.\n"
. getBloc(
"# SECTION custom BEGIN.\n",
"# SECTION custom END.\n",
${ $tplContent }
)
"# SECTION custom BEGIN.\n",
"# SECTION custom END.\n",
${ $tplContent }
)
. " include imscp_pma.conf;\n"
. " # SECTION custom END.\n",
${ $tplContent }
Expand Down Expand Up @@ -260,8 +257,6 @@ sub _buildConfigFiles
local $@;
my $rs = eval {
# Main configuration file
local $self->{'dbh'}->{'RaiseError'} = TRUE;

my %config = @{ $self->{'dbh'}->selectcol_arrayref(
"SELECT `name`, `value` FROM `config` WHERE `name` LIKE 'PMA_%'",
{ Columns => [ 1, 2 ] }
Expand Down Expand Up @@ -408,10 +403,7 @@ sub _setupDatabase
my $database = ::setupGetQuestion( 'DATABASE_NAME' ) . '_pma';

local $@;
eval {
local $self->{'dbh'}->{'RaiseError'} = TRUE;
$self->{'dbh'}->do( "DROP DATABASE IF EXISTS `$database`" );
};
eval { $self->{'dbh'}->do( "DROP DATABASE IF EXISTS `$database`" ); };
if ( $@ ) {
error( $@ );
return 1;
Expand Down Expand Up @@ -471,8 +463,6 @@ sub _setupSqlUser
$self->{'_pma_control_user_passwd'}
);

local $self->{'dbh'}->{'RaiseError'} = TRUE;

$self->{'dbh'}->do(
'GRANT USAGE ON `mysql`.* TO ?@?',
undef,
Expand Down

0 comments on commit 15b0dab

Please sign in to comment.