split the webservices/functions.php into user / group / institution functions for better code separation

Bug #1393621 reported by Robert Lyon on 2014-11-18
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Low
Robert Lyon

Bug Description

Currently the classes mahara_user_external, mahara_group_external, and mahara_institution_external are all within the webservices/functions.php file.

I think as we add more functions to that file it will get quite large. So for easier editing will be worth breaking that up into a structure like:

webservices/functions/user.php - for user functions
webservices/functions/group.php - for group functions
webservices/functions/institution.php - for institution functions

this way if we want to add another set of functions say 'collection' it would be a matter of adding in
webservices/functions/collection.php

Aaron Wells (u-aaronw) wrote :

Good idea. We have too many giant files in Mahara already. :)

Changed in mahara:
status: New → Confirmed
Robert Lyon (robertl-9) on 2014-12-22
summary: split the webservices/functions.php into user / group / institution
- functions for better code seperation
+ functions for better code separation
Robert Lyon (robertl-9) wrote :

Ok, have gone almost with what I mentioned in original report except that the name of the file in the functions directory is based on the classname field in the external_functions table and therefore the class the file holds.

So we have:
webservices/functions/mahara_user_external.php - for user functions
webservices/functions/mahara_group_external.php - for group functions
webservices/functions/mahara_institution_exteranl.php - for institution functions

Changed in mahara:
status: Confirmed → In Progress
assignee: nobody → Robert Lyon (robertl-9)

Reviewed: https://reviews.mahara.org/4110
Committed: http://gitorious.org/mahara/mahara/commit/dbe457bae7b45f921d5ae0058e6abb71fee2eda3
Submitter: Aaron Wells (<email address hidden>)
Branch: master

commit dbe457bae7b45f921d5ae0058e6abb71fee2eda3
Author: Robert Lyon <email address hidden>
Date: Mon Dec 22 16:33:55 2014 +1300

Separation of the functions (Bug #1393621)

Allowing each of the 'classname' classes listed in external_functions
to be it's own function file to make it easier for developers.

Change-Id: I9c4e3dfc198abdf2c274c8a7d569fce5bf431471
Signed-off-by: Robert Lyon <email address hidden>

Robert Lyon (robertl-9) on 2015-03-08
Changed in mahara:
status: In Progress → Fix Committed
Robert Lyon (robertl-9) on 2015-04-17
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers