From e75e4d8dcebf406a91d316cb5100c39bcc5b9eca Mon Sep 17 00:00:00 2001
From: mattpiwik <matthieu.aubry@gmail.com>
Date: Fri, 25 May 2012 22:33:50 +0000
Subject: [PATCH] Fixes #3136 will be used in the upcoming SDK

git-svn-id: http://dev.piwik.org/svn/trunk@6319 59fd770c-687e-43c8-a1e3-f5a4ff64c105
---
 config/global.ini.php | 10 ++++++++++
 plugins/API/API.php   |  9 +++++++++
 2 files changed, 19 insertions(+)

diff --git a/config/global.ini.php b/config/global.ini.php
index c6eb61c22c..b68a1a1637 100644
--- a/config/global.ini.php
+++ b/config/global.ini.php
@@ -507,3 +507,13 @@ PluginsInstalled[] = Installation
 Plugins_Tracker[] = Provider
 Plugins_Tracker[] = Goals
 Plugins_Tracker[] = DoNotTrack
+
+[APISettings]
+; Any key/value pair can be added in this section, they will be available via the REST call
+; index.php?module=API&method=API.getSettings 
+; This can be used to expose values from Piwik, to control for example a Mobile app tracking
+SDK_batch_size = 10
+SDK_interval_value = 30
+
+; NOTE: do not directly in this file! See notice at the top
+ 
\ No newline at end of file
diff --git a/plugins/API/API.php b/plugins/API/API.php
index 84fcec2936..69673ee3f0 100644
--- a/plugins/API/API.php
+++ b/plugins/API/API.php
@@ -104,6 +104,15 @@ class Piwik_API_API
 		return Piwik_Version::VERSION;
 	}
 	
+	/**
+	 * Returns the section [APISettings] if defined in config.ini.php
+	 * @return array
+	 */
+	public function getSettings()
+	{
+		return Piwik_Config::getInstance()->APISettings;
+	}
+	
 	/**
 	 * Derive the unit name from a column name
 	 * @param $column
-- 
GitLab