1
votes

I am trying to read/write my configuration in the DokuWiki.

The problem that occurs is when I am trying to call $this->getConf('url'); I always get the response from the conf/default.php file.

This is how my files look like:

admin.php

$url = $this->getConf('url');

conf/default.php

$conf['url'] = 'https://www.example.com';

conf/metadata.php

$meta['url'] = array('string', 'url' => 'https://correct-url.com');

And the value of $url always is:

https://www.example.com

I am not sure what I do wrong.

Thanks!

1

1 Answers

1
votes

You may have some misunderstanding to DokuWiki's config system.

The config, which is editable by users, will be saved at /conf/local.php (not inside plugins!). The plugin can only provide a default value at default.php, while the metadata.php is to define how the value is shown on the frontend settings manager.

In your case, the correct URL will be shown, if the DokuWiki global config file (/conf/local.php for example) includes $conf["your_plugin_name"]["url"] = "https://correct-url.com";.

For more: https://www.dokuwiki.org/devel:configuration