From 44418c209428335e611bfb9384578fb18b88978d Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 19 Apr 2017 15:51:47 +0200 Subject: [locationinfo] CourseBackends: Lots of bug fixes, missing error checks, improvements: - Add more checks for returned data structures from backend, like keys in arrays - Better error messages if something goes wrong, not just "server sent wrong xml" - Make checkConnection() of davinci and hisinone not require a valid room id, which we don't have in general - hisinone: Parse data structure just once for every room - Request coalescing: Only try so if getRefreshTime() > getCacheTime() - Move toArray() to base class instead of having two copies - Sanitize variable naming conventions --- .../inc/coursebackend/coursebackend_dummy.inc.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php') diff --git a/modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php b/modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php index 484a5286..5bceac3e 100644 --- a/modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php +++ b/modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php @@ -1,6 +1,6 @@ pw = $x['password']; @@ -22,8 +22,7 @@ class Coursebackend_Dummy extends CourseBackend $this->error = false; return true; } else { - $this->errormsg = "USE mfg as password!"; - $this->error = true; + $this->error = "USE mfg as password!"; return false; } } @@ -37,8 +36,7 @@ class Coursebackend_Dummy extends CourseBackend $this->error = false; return true; } else { - $this->errormsg = "USE mfg as password!"; - $this->error = true; + $this->error = "USE mfg as password!"; return false; } } @@ -88,7 +86,7 @@ class Coursebackend_Dummy extends CourseBackend /** * Internal version of fetch, to be overridden by subclasses. * - * @param $roomIds array with local ID as key and serverID as value + * @param $roomIds array with local ID as key and serverId as value * @return array a recursive array that uses the roomID as key * and has the schedule array as value. A shedule array contains an array in this format: * ["start"=>'JJJJ-MM-DD HH:MM:SS',"end"=>'JJJJ-MM-DD HH:MM:SS',"title"=>string] -- cgit v1.2.3-55-g7522