[dev] API Interface Rewrite
Michael M Slusarz
slusarz at horde.org
Mon Aug 3 18:11:18 UTC 2009
Quoting Chuck Hagenbuch <chuck at horde.org>:
> Quoting Michael M Slusarz <slusarz at horde.org>:
>
>> Log:
>> Better job of determining mobile support. At least it doesn't require
>> hardcoded support of a non-longer existing app.
>>
>> Probably would be best to do to API files what we just did to hooks files -
>> put all the code into a single class. Then we are not polluting the
>> namespace with a bunch of functions, we don't have to use hackish API
>> function names, and we can easily do something like set a class member
>> variable to true to indicate of an application has mobile support.
>
> I agree. I've got some ideas on this also, but given my level of
> work buried lately, and that I'll be on vacation next week, I'll
> look at what folks come up with and go from there.
My initial thought (pseudocode version) is this:
// Rename files to lib/Api.php so they are autoloadable.
class App_Api
{
// Does this application support a mobile view?
public $mobileview = [boolean];
// The version of the application (gets rid of version.php files)
public $version = [string];
// The existing services array
protected $_services = array();
public function [API name - no more '_app_' prefix] ()
{
}
...
// Prefs UI stuff: Do we want to move code from lib/prefs.php
file into the API file?
}
michael
--
___________________________________
Michael Slusarz [slusarz at horde.org]
More information about the dev
mailing list