Skip to content

Commit

Permalink
refactor($this->wiki->configFile): use when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
J9rem committed Sep 15, 2023
1 parent d0df6cb commit 8f3e6ea
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion handlers/UpdateHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ private function updateDefaultCommentsAcls(): string
$output = "ℹ️ Resetting comment acls<br />";

// default acls in wakka.config.php
$config = $this->getService(ConfigurationService::class)->getConfiguration('wakka.config.php');
$config = $this->getService(ConfigurationService::class)->getConfiguration($this->wiki->configFile);
$config->load();

$baseKey = 'default_comment_acl';
Expand Down
2 changes: 1 addition & 1 deletion handlers/page/dbutf8.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
$output .= "<h3>Complete ALL</h3>";

// ajout du charset utf8mb4 dans wakka.config.php
$config = $this->services->get(ConfigurationService::class)->getConfiguration('wakka.config.php');
$config = $this->services->get(ConfigurationService::class)->getConfiguration($this->wiki->configFile);
$config->load();
$config->db_charset = 'utf8mb4';
$config->write();
Expand Down
6 changes: 3 additions & 3 deletions includes/services/ArchiveService.php
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ private function writeOutput(&$output, string $text, bool $newline = true, strin
private function getWakkaConfigSanitized(array $foldersToInclude, array $foldersToExclude, ?array $hideConfigValuesParams = null): string
{
// get wakka.config.php content
$config = $this->configurationService->getConfiguration('wakka.config.php');
$config = $this->configurationService->getConfiguration($this->wiki->configFile);
$config->load();
if (!isset($config[self::PARAMS_KEY_IN_WAKKA]) ||
!is_array($config[self::PARAMS_KEY_IN_WAKKA])) {
Expand Down Expand Up @@ -950,14 +950,14 @@ private function setDefaultValuesRecursive(array $defaultValues, $values)

protected function setWikiStatus()
{
$config = $this->configurationService->getConfiguration('wakka.config.php');
$config = $this->configurationService->getConfiguration($this->wiki->configFile);
$config->load();
$config['wiki_status'] = 'archiving';
$this->configurationService->write($config);
}
protected function unsetWikiStatus()
{
$config = $this->configurationService->getConfiguration('wakka.config.php');
$config = $this->configurationService->getConfiguration($this->wiki->configFile);
$config->load();
unset($config['wiki_status']);
$this->configurationService->write($config);
Expand Down
4 changes: 2 additions & 2 deletions tools/templates/actions/SetWikiDefaultThemeAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function run()
'message' => _t('ERROR_NO_ACCESS'). " setwikidefaulttheme"
]);
}
if (!is_writable('wakka.config.php')) {
if (!is_writable($this->wiki->configFile)) {
return $this->render('@templates/alert-message.twig',[
'type' => 'danger',
'message' => _t('ERROR_NO_ACCESS'). " setwikidefaulttheme, "._t('FILE_WRITE_PROTECTED')
Expand All @@ -32,7 +32,7 @@ public function run()
$this->themeManager = $this->getService(ThemeManager::class);

$themes = $this->getTemplatesList();
$config = $this->getService(ConfigurationService::class)->getConfiguration('wakka.config.php');
$config = $this->getService(ConfigurationService::class)->getConfiguration($this->wiki->configFile);
$config->load();

if (isset($_POST['action']) and $_POST['action'] === 'setTemplate') {
Expand Down

0 comments on commit 8f3e6ea

Please sign in to comment.