docs.roxen.comView this page in a printer friendly mode
DocsRoxenWebServer 3.4System Developer ManualThe Roxen Module API
Copyright  2006, Roxen Internet Software
Suggestions, comments & compliments

Introduction to Roxen Modules
The Module Type Calling Sequence
Constants Common to All Modules
Callback Methods Common to All Modules
API Methods Common to All Modules
Module Variables
Tag Modules
Location (Filesystem) Modules
File Extension Modules
Filter Modules
Authentication Modules
Logger Modules
First Modules
Last Modules
Provider Modules
Content Type Modules
Directory Listing Modules

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.