docs.roxen.comBack to normal mode
DocsRoxenWebServer 5.2System Developer Manual PikeThe Roxen Module API
Copyright © 2015, Roxen Internet Software
Suggestions, comments & compliments
manuals@roxen.com

Provider Modules

Provider modules are modules that provide services to other modules. The module type constant is MODULE_PROVIDER.

string|array(string) query_provides()

returns the name of the service or services this module provides, either as a string or as an array of strings.

Methods available to other modules are:

RoxenModule conf->get_provider( string service )

Returns the provider module that handles the service 'service', or one with highest priority if there are several. conf is the configuration object for the virtual server (id->configuration() fetches the current request's configuration). Any public function (or data element) can be reached via the returned module object.

array(RoxenModule) conf->get_providers( string service )

Returns all provider modules that handle the service 'service' 'conf' is the configuration object for the virtual server.

void map_providers( string service, string fun, mixed ... args )

Calls the method named fun in all modules providing the service service. The method will be called with args as arguments.

mixed call_provider( string service, string fun, mixed ... args )

Calls the method named 'fun' in modules providing the service service with the arguments args. Modules will get called until one module returns a non-zero value. That return value, or zero if all modules returned zero, will be returned.