Hi,
I've a problem with loading the plugin local config file.
My config (config.inc.php) in the root dir of my plugin:
<?php // enable / disable yubikey authentication $rcmail_config['yubikey'] = TRUE; // yubikey API key & ID needed to access the web service API // can be had at: https://api.yubico.com/get-api-key/ $rcmail_config['yubikey_api_id'] = ''; $rcmail_config['yubikey_api_key'] = ''; ?>
When I'm calling $this->load_config('config.inc.php') or $this-
load_config(), the function always returns false and I found the
following error message in the error log ...
[01-Jun-2009 11:26:44 +0200] PHP Error: Failed to load config from / Users/oliver/Sites/trunk/roundcubemail/plugins//yubikey_auth/ config.inc.php (GET /~oliver/trunk/roundcubemail/? _task=settings&_action=keep- alive&_t=1243848404670&_remote=1&_=1243848404671&_unlock=0)
I first tought that the double slash in the path was wrong and so I
changed the code in rcube_plugin.php to ....
//$this->home = $api->dir . DIRECTORY_SEPARATOR . $this->ID; $this->home = $api->dir . $this->ID;
... but now I'm getting the same error message with the correct path ...
Error message: [01-Jun-2009 11:35:55 +0200] PHP Error: Failed to load config from / Users/oliver/Sites/trunk/roundcubemail/plugins/yubikey_auth/ config.inc.php (GET /~oliver/trunk/roundcubemail/? _task=settings&_action=logout)
Does anybody has some idea about this issue?
Regards, Oliver _______________________________________________ List info: http://lists.roundcube.net/dev/
Oliver Martin wrote:
When I'm calling $this->load_config('config.inc.php') or $this-
load_config(), the function always returns false and I found the
following error message in the error log ...
Does anybody has some idea about this issue?
When you call load_config, the rcube_config::load_from_file() is called:
public function load_from_file($fpath) { if (is_file($fpath)) { @include($fpath); if (is_array($rcmail_config)) { $this->prop = array_merge($this->prop, $rcmail_config); return true; } }
return false;
}
So, remove '@' sign. BTW, we should check with is_readable() here.