throw new Exception('Error parsing config file ' . $filepath);
}
- foreach($config as $category => $values) {
- foreach($values as $key => $value) {
+ foreach ($config as $category => $values) {
+ foreach ($values as $key => $value) {
$this->setConfigValue($category, $key, $value);
}
}
// Loads addons default config
Core\Addon::callHooks('load_config');
- // Load the local config file again in case there are overwritten addon config
- if (file_exists($this->basepath . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'local.ini.php')) {
- $this->loadConfigFile($this->basepath . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'local.ini.php');
+ // Load the local addon config file to overwritten default addon config values
+ if (file_exists($this->basepath . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'addon.ini.php')) {
+ $this->loadConfigFile($this->basepath . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'addon.ini.php');
}
}
*
* To get /path/to/friendica we perform dirname() for as many levels as there are slashes in the QUERY_STRING
*/
- if (!empty($_SERVER['SCRIPT_URL']) && !empty($_SERVER['QUERY_STRING'])) {
- $path = trim(dirname($_SERVER['SCRIPT_URL'], substr_count(trim($_SERVER['QUERY_STRING'], '/'), '/') + 1), '/');
+ if (!empty($_SERVER['SCRIPT_URL'])) {
+ // Module
+ if (!empty($_SERVER['QUERY_STRING'])) {
+ $path = trim(dirname($_SERVER['SCRIPT_URL'], substr_count(trim($_SERVER['QUERY_STRING'], '/'), '/') + 1), '/');
+ } else {
+ // Root page
+ $path = trim($_SERVER['SCRIPT_URL'], '/');
+ }
if ($path && $path != $this->urlpath) {
$this->urlpath = $path;
// Use environment variables for mysql if they are set beforehand
if (!empty(getenv('MYSQL_HOST'))
&& (!empty(getenv('MYSQL_USERNAME')) || !empty(getenv('MYSQL_USER')))
- && !getenv('MYSQL_PASSWORD') === false
+ && getenv('MYSQL_PASSWORD') !== false
&& !empty(getenv('MYSQL_DATABASE')))
{
$db_host = getenv('MYSQL_HOST');