From: Hypolite Petovan <mrpetovan@gmail.com>
Date: Thu, 12 Jul 2018 02:58:37 +0000 (-0400)
Subject: Move the addon-specific config in config/addon.ini.php
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=30019510759c06c5b1884ce4aa353ac50f26a180;p=friendica.git

Move the addon-specific config in config/addon.ini.php

- Add sample addon.ini.php file
- Add config/addon.ini.php file to git ignore
---

diff --git a/.gitignore b/.gitignore
index c1eb430b4b..114bb5dbb9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,6 +12,7 @@ robots.txt
 
 #ignore local config
 /config/local.ini.php
+/config/addon.ini.php
 
 #ignore documentation, it should be newly built
 /doc/html
diff --git a/config/addon-sample.ini.php b/config/addon-sample.ini.php
new file mode 100644
index 0000000000..7d8054cd2a
--- /dev/null
+++ b/config/addon-sample.ini.php
@@ -0,0 +1,10 @@
+<?php return <<<INI
+
+; Copy this configuration file to addon.ini.php and edit it if you want to configure addons, see below example for the twitter addon
+
+;[twitter]
+;consumerkey = localhost
+;consumersecret = mysqlusername
+
+INI;
+// Keep this line
\ No newline at end of file
diff --git a/src/App.php b/src/App.php
index 8bde1afc43..e495f48dd4 100644
--- a/src/App.php
+++ b/src/App.php
@@ -403,9 +403,9 @@ class App
 		// 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');
 		}
 	}