Skip to content

Commit ce8f38a

Browse files
committed
Fixed: Listener sample for overriding of default config.php configuration file.
Fixed: Useless import of the `File::Temp` package (package handler). CS fixes
1 parent 497add3 commit ce8f38a

File tree

3 files changed

+38
-9
lines changed

3 files changed

+38
-9
lines changed

CHANGELOG.md

+26
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,32 @@
22

33
All notable changes to this project will be documented in this file, in reverse chronological order by release.
44

5+
## 1.0.1 - TBD
6+
7+
Initial release.
8+
9+
### Added
10+
11+
- Nothing.
12+
13+
### Changed
14+
15+
- Apply patches before build of configuration files.
16+
17+
### Deprecated
18+
19+
- Nothing.
20+
21+
### Removed
22+
23+
- Nothing.
24+
25+
### Fixed
26+
27+
- Listener sample for overriding of default `config.php` configuration file.
28+
- Useless import of the `File::Temp` package (package handler).
29+
- CS fixes
30+
531
## 1.0.0 - 20190403
632

733
Initial release.

src/Handler.pm

+6-7
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ package Package::WebFtpClients::MonstaFTP::Handler;
2626
use strict;
2727
use warnings;
2828
use File::Spec;
29-
use File::Temp;
3029
use iMSCP::Boolean;
3130
use iMSCP::Cwd '$CWD';
3231
use iMSCP::Debug 'error';
@@ -77,9 +76,9 @@ sub install
7776

7877
local $CWD = $::imscpConfig{'GUI_ROOT_DIR'};
7978

80-
my $rs = $self->_buildConfigFiles();
79+
my $rs = $self->_applyPatches();
80+
$rs ||= $self->_buildConfigFiles();
8181
$rs ||= $self->_buildHttpdConfigFile();
82-
$rs ||= $self->_applyPatches();
8382
}
8483

8584
=item postinstall( )
@@ -107,7 +106,7 @@ sub postinstall
107106
"$CWD/public/tools/monstaftp"
108107
) ) {
109108
error( sprintf(
110-
"Couldn't create symlink for MonstaFTP Web-based FTP client"
109+
"Couldn't create symlink for the MonstaFTP Web-based FTP client"
111110
));
112111
return 1;
113112
}
@@ -208,7 +207,7 @@ sub _init
208207

209208
=item _buildConfigFiles( )
210209
211-
Build PhpMyadminConfiguration files
210+
Build MonstaFTP configuration files
212211
213212
Return int 0 on success, other on failure
214213
@@ -291,11 +290,11 @@ sub _buildConfigFiles
291290
->pretty( TRUE )
292291
->encode( $data )
293292
);
294-
$rs = $file->save();
293+
$file->save();
295294
};
296295
if ( $@ ) {
297296
error( $@ );
298-
return 1;
297+
$rs = 1;
299298
}
300299

301300
$rs;

src/config.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
*
99
* Perl code:
1010
*
11+
* Package Listener::MonstaFTP::CustomConfigFile;
12+
*
13+
* use strict;
14+
* use warnings;
1115
* use iMSCP::EventManager;
1216
* use iMSCP::File;
1317
*
@@ -20,9 +24,9 @@
2024
*
2125
* # Load custom MonstaFTP configuration file into the $cfgTplContent
2226
* # variable.
23-
* return 1 unless defined ${ $cfgTplContent } = iMSCP::File->new(
27+
* return 1 unless defined( ${ $cfgTplContent } = iMSCP::File->new(
2428
* filename => 'path/to/your/monstaftp/conf/file'
25-
* )->get();
29+
* )->get() );
2630
*
2731
* 0;
2832
* });

0 commit comments

Comments
 (0)