Hmmm... I'm not sure if I understood you right - is it possible to add an additional configuration file via preload.php, or is it only possible to set the location of the standard configuration to another directory?
I've tried it, but I had no success. It seems that there can only 3 configuration files defined; default, local and protected. For the usual DokuWiki-user this is enough, but I want to make it possible for the users of my firefighter-wiki that they can use local.php, which isn't overwritten by my standard values when I release an update.
If I set another location for the configuration file, the error persists that in the configuration manager the standard options of the plugins are shown, but the hardcoded values in dokuwiki.php are used. So the behaviour doesn't change if I put my additional values in conf/dokuwiki.php or in another file which I define in inc/preload.php
If found that the values of the config files are read into DokuWiki in the file inc/confutils.php. Since I change some files in every DokuWiki-release before I provide this to my users, it wouldn't be a problem to hack the code at this point every time. But I haven't got it to work. I changed
function retrieveConfig($type,$fn,$params=null,$combine='array_merge') {
global $config_cascade;
if(!is_array($params)) $params = array();
$combined = array();
if (!is_array($config_cascade[$type])) trigger_error('Missing config cascade for "'.$type.'"',E_USER_WARNING);
foreach (array('default','local','protected') as $config_group) {
if (empty($config_cascade[$type][$config_group])) continue;
foreach ($config_cascade[$type][$config_group] as $file) {
if (file_exists($file)) {
$config = call_user_func_array($fn,array_merge(array($file),$params));
$combined = $combine($combined, $config);
}
}
}
return $combined;
}
/**
* Include the requested configuration information
*
* @author Chris Smith <chris@jalakai.co.uk>
*
* @param string $type the configuration settings to be read, must correspond to a key/array in $config_cascade
* @return array list of files, default before local before protected
*/
function getConfigFiles($type) {
global $config_cascade;
$files = array();
if (!is_array($config_cascade[$type])) trigger_error('Missing config cascade for "'.$type.'"',E_USER_WARNING);
foreach (array('default','local','protected') as $config_group) {
if (empty($config_cascade[$type][$config_group])) continue;
$files = array_merge($files, $config_cascade[$type][$config_group]);
}
return $files;
}
to
function retrieveConfig($type,$fn,$params=null,$combine='array_merge') {
global $config_cascade;
if(!is_array($params)) $params = array();
$combined = array();
if (!is_array($config_cascade[$type])) trigger_error('Missing config cascade for "'.$type.'"',E_USER_WARNING);
foreach (array('default','einsatzleiterwiki','local','protected') as $config_group) {
if (empty($config_cascade[$type][$config_group])) continue;
foreach ($config_cascade[$type][$config_group] as $file) {
if (file_exists($file)) {
$config = call_user_func_array($fn,array_merge(array($file),$params));
$combined = $combine($combined, $config);
}
}
}
return $combined;
}
/**
* Include the requested configuration information
*
* @author Chris Smith <chris@jalakai.co.uk>
*
* @param string $type the configuration settings to be read, must correspond to a key/array in $config_cascade
* @return array list of files, default before local before protected
*/
function getConfigFiles($type) {
global $config_cascade;
$files = array();
if (!is_array($config_cascade[$type])) trigger_error('Missing config cascade for "'.$type.'"',E_USER_WARNING);
foreach (array('default','einsatzleiterwiki','local','protected') as $config_group) {
if (empty($config_cascade[$type][$config_group])) continue;
$files = array_merge($files, $config_cascade[$type][$config_group]);
}
return $files;
}
and inc/config_cascade.php to
$config_cascade = array_merge(
array(
'main' => array(
'default' => array(DOKU_CONF . 'dokuwiki.php'),
'einsatzleiterwiki' => array(DOKU_CONF . 'einsatzleiterwiki.php'),
'local' => array(DOKU_CONF . 'local.php'),
'protected' => array(DOKU_CONF . 'local.protected.php'),
),
Then I placed the file with my changed options into conf/einsatzleiterwiki.php:
// angepasste Standard-Einstellungen für Einsatzleiterwiki - allgemein
$conf['title'] = 'Einsatzleiterwiki';
$conf['lang'] = 'de';
$conf['tagline'] = 'Das elektronische Einsatzleiterhandbuch';
$conf['sidebar'] = 'wiki:navigation';
$conf['license'] = 'cc-by-sa';
$conf['recent_days'] = 0;
$conf['dformat'] = '%d.%m.%Y %H:%M';
$conf['tocminheads'] = 15;
$conf['useheading'] = 1;
$conf['useacl'] = 1;
$conf['superuser'] = '@admin';
$conf['target']['interwiki'] = '_blank';
$conf['target']['extern'] = '_blank';
$conf['target']['media'] = '_blank';
$conf['rss_type'] = 'rss2';
$conf['updatecheck'] = 0;
// angepasste Standard-Einstellungen für Einsatzleiterwiki - Plugins
//inclform
$conf['plugin']['inclform']['formdir'] = 'data/media/berechnungen';
//indextitleonly
$conf['plugin']['indextitleonly']['namespace'] = 'cbrn:ericards:';
//ckgedit
$conf['plugin']['ckgedit']['create_folder'] = 'y';
$conf['plugin']['ckgedit']['scayt_lang'] = 'German/de_DE';
$conf['plugin']['ckgedit']['font_options'] = 1;
//namespacemessage
$conf['plugin']['namespacemessage']['not_in_namespaces'] = 'lokal';
$conf['plugin']['namespacemessage']['message'] = '<div class="wrap_round wrap_info plugin_wrap" style="width: 100%;"><p>Die Inhalte dieser Seite sind Bestandteil des Einsatzleiterwiki-Projekts. Sie wurden nicht speziell für Ihre Feuerwehr ausgearbeitet, möglicherweise existieren abweichende Regelungen.</p></div>';
//nsiconinsearch
$conf['plugin']['nsiconinsearch']['in_namespaces'] = 'lokal';
But it didn't work. Where is my error? Which point I have missed?
Maybe all of this isn't needed, because the main error is that in the configuration manager the standard options of the plugins are shown, but the hardcoded values in dokuwiki.php are used. If this would be changed to the old behaviour (that I can put standard options for plugins in dokuwiki.php and they appear in the configuration manager), everything would be fine and all the other content of this thread is irrelevant. 🙂
i will do some research on what happened here, why the extension manager doesn‘t display correct any more.