########################################################################################## GPXIN-17: Expose a method to enable 'experimental' features ########################################################################################## Issue Type: New Feature ----------------------------------------------------------------------------------------- Issue Information ==================== Priority: Major Status: Closed Resolution: Done (2015-01-13 10:49:07) Project: PHP GPXIngest (GPXIN) Reported By: btasker Assigned To: btasker Affected Versions: - 1.02 Targeted for fix in version: - 1.02 Time Estimate: 0 minutes Time Logged: 0 minutes ----------------------------------------------------------------------------------------- Issue Description ================== There may be future features which are considered experimental (or simply, not commonly required and computationally expensive). An example of the latter would be distance calculations (GPXIN-6). So that the functionality can be implemented without requiring the overhead where it is not needed, create and expose a method whereby certain off-by-default features can be enabled. ----------------------------------------------------------------------------------------- Issue Relations ================ - blocks GPXIN-6: Distance calculations ----------------------------------------------------------------------------------------- Activity ========== ----------------------------------------------------------------------------------------- 2015-01-13 10:45:29 btasker ----------------------------------------------------------------------------------------- When adding a new 'experimental' feature, a unique name for it needs to be added to the array _experimentalFeatures_ Have created three new public methods; -- BEGIN SNIPPET -- public function enableExperimental($type) public function disableExperimental($type) public function listExperimental() -- END SNIPPET -- The method _listExperimental_ returns a key->value array indicating the internal names of any relevant features and whether the feature has been enabled or not (via _enableExperimental_). It is the internal name which must be passed to the other two methods. Have also added a protected method for use when deciding whether to execute experimental functionality -- BEGIN SNIPPET -- protected function expisenabled($type) -- END SNIPPET -- ----------------------------------------------------------------------------------------- 2015-01-13 10:46:01 btasker ----------------------------------------------------------------------------------------- Goes without saying - anything added as experimental must still be syntactically correct! ----------------------------------------------------------------------------------------- 2015-01-13 10:49:08 ----------------------------------------------------------------------------------------- btasker changed status from 'Open' to 'Resolved' ----------------------------------------------------------------------------------------- 2015-01-13 10:49:08 ----------------------------------------------------------------------------------------- btasker added 'Done' to resolution ----------------------------------------------------------------------------------------- 2015-01-13 10:49:10 git ----------------------------------------------------------------------------------------- -- BEGIN QUOTE -- Repo: PHP-GPX-Ingest Commit: 2675822364e525cb637cbf6ea9bcf52154e6a7cd Author: Ben Tasker