Move the addon-specific config in config/addon.ini.php
authorHypolite Petovan <mrpetovan@gmail.com>
Thu, 12 Jul 2018 02:58:37 +0000 (22:58 -0400)
committerHypolite Petovan <mrpetovan@gmail.com>
Mon, 16 Jul 2018 23:38:18 +0000 (19:38 -0400)
- Add sample addon.ini.php file
- Add config/addon.ini.php file to git ignore

.gitignore
config/addon-sample.ini.php [new file with mode: 0644]
src/App.php

index c1eb430..114bb5d 100644 (file)
@@ -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 (file)
index 0000000..7d8054c
--- /dev/null
@@ -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
index 8bde1af..e495f48 100644 (file)
@@ -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');
                }
        }