Support .user.ini in installto.sh

pull/5859/head
Aleksander Machniak 7 years ago
parent ca6f5ebd5b
commit 5ea0d5bfbb

@ -156,6 +156,8 @@ increase the allowed size of file attachments, for example:
php_value upload_max_filesize 5M
php_value post_max_size 6M
Note that some PHP environments (php-fpm) may use .user.ini instead of .htaccess.
SECURE YOUR INSTALLATION
========================

@ -52,6 +52,9 @@ if (strtolower($input) == 'y') {
if (file_exists("$target_dir/.htaccess")) {
$htaccess_copied = copy("$target_dir/.htaccess", "$target_dir/.htaccess.orig");
}
if (file_exists("$target_dir/.user.ini")) {
$user_ini_copied = copy("$target_dir/.user.ini", "$target_dir/.user.ini.orig");
}
$dirs = array('program','installer','bin','SQL','plugins','skins');
if (is_dir(INSTALL_PATH . 'vendor') && !is_file("$target_dir/composer.json")) {
@ -65,7 +68,7 @@ if (strtolower($input) == 'y') {
rcube::raise_error("Failed to execute command: $command", false, true);
}
}
foreach (array('index.php','.htaccess','config/defaults.inc.php','composer.json-dist','jsdeps.json','CHANGELOG','README.md','UPGRADING','LICENSE','INSTALL') as $file) {
foreach (array('index.php','.htaccess','.user.ini','config/defaults.inc.php','composer.json-dist','jsdeps.json','CHANGELOG','README.md','UPGRADING','LICENSE','INSTALL') as $file) {
$command = "rsync -a --out-format=%n " . INSTALL_PATH . "$file $target_dir/$file";
if (file_exists(INSTALL_PATH . $file) && (!system($command, $ret) || $ret > 0)) {
rcube::raise_error("Failed to execute command: $command", false, true);
@ -86,6 +89,16 @@ if (strtolower($input) == 'y') {
}
}
// Inform the user about .user.ini change
if (!empty($user_ini_copied)) {
if (file_get_contents("$target_dir/.user.ini") != file_get_contents("$target_dir/.user.ini.orig")) {
echo "\n!! Old .user.ini file saved as .user.ini.orig !!";
}
else {
@unlink("$target_dir/.user.ini.orig");
}
}
echo "\n\n";
if (is_dir("$target_dir/skins/default")) {

Loading…
Cancel
Save