Details
-
Type: Improvement
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Won't Fix
-
Affects Version/s: 4.3.0
-
Fix Version/s: Unscheduled
-
Component/s: CiviCRM API
-
Labels:
-
Documentation Required?:None
-
Funding Source:Needs Funding
Description
The class civicrm_api3 has some issues..
It does too many things at once:
- Local vs remote
- Different behavior depending on internal values: lastResult, currentEntity, etc.
- __get() and __call() have to distinguish different states.
So... I made a new one
https://github.com/donquixote/CiviRemotePHP
- responsibilities split into different classes
- separate classes for remote and local
- completely standalone, to guarantee that it works on a random php project with no other CiviCRM components installed.
- nice way to access values and attributes of the result.
Something in this direction can go into core. Xavier says he likes it
Up to discuss:
- behavior in case of error: throw exceptions? dedicated exceptions?
- namespaces and PSR-0 in CiviCRM core? Should we start a lib/CiviCRM/ folder for namespaced classes, next to CRM/ ? (to be discussed in another issue)