Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config value to allow to extend .user.ini on update #471

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -1074,6 +1074,19 @@ public function finalize(): void {
throw new \Exception('Could not rmdir .step');
}

/* Check if there is the need to extend .user.ini */
$user_ini_additional_lines = $this->getConfigOption('user_ini_additional_lines');
if ($user_ini_additional_lines) {
$this->silentLog('[info] Extend .user.ini');
if (is_array($user_ini_additional_lines)) {
$user_ini_additional_lines = implode(PHP_EOL, $user_ini_additional_lines);
}
$result = file_put_contents($this->baseDir . '/../.user.ini', PHP_EOL . '; Additional settings from config.php:' . PHP_EOL . $user_ini_additional_lines . PHP_EOL, FILE_APPEND | FILE_LOCK);
if ($result === false) {
throw new \Exception('Could not append to .user.ini');
}
}

if (function_exists('opcache_reset')) {
$this->silentLog('[info] call opcache_reset()');
opcache_reset();
Expand Down