My favorites | Sign in
Project Logo
                
Search
for
Updated Oct 30, 2007 by fredbird.org
Labels: Phase-Design, Deprecated
Services  
Services description and usage

Description

Services are named object instances used to provide kit-level functionalities. They are retrieved by their name through the Kit instance.

Details

They are declared within the Kit meta-data file, and load their own configuration file when built. This config file has to be named {service_name}.service.ini, at the root of the kit.

Any Service class have to inherit wakService class.

A Kit may only provide a config file for a service, the service class definition file being provided by another kit. If so, don't forget to list this dependancy for the kit !

Usage

Let's have a packaged application named myapp, which depends on another kit named tools. This second kits provide some generic libraries, and an access control service class named aclservice.

Let's see the tools wak.ini :

[load_files]
0 = "aclservice.class.php"

And the myapp wak.ini :

[load_kits]
0 = "tools"

[services]
acl = "aclservice"

As myapp provides a service named acl, it also include conf file named acl.Service.ini :

; here is the conf file for an aclservice instance
[some_url]
user = "allow"
default = "deny"

Now, you can get acl service from myapp kit, which will get its class (aclservice) from tools and its conf from myapp :

$mykit=webappkit::getkit('myapp');
$acl=$mykit->getservice('acl');
$acl->doControlStuff();

Sign in to add a comment
Hosted by Google Code