You are here

function hosting_example_hosting_service in Hosting 6.2

Same name and namespace in other branches
  1. 7.4 example/example_service/hosting_example.module \hosting_example_hosting_service()
  2. 7.3 example/example_service/hosting_example.module \hosting_example_hosting_service()

Expose a service implementation to the service API.

Return a service implementation, such as the "apache" implementation of the "http" service.

An implementation class should go in {module name}.service.inc and be must be named hostingService_{service type}_{type}, which should be a subclass of hostingService_{service type} or hostingService.

You will then need to either extend the existing {module name}.service.inc file, or create a new file, containing the implementation of your service.

Return value

An associative array with the service implementation as key, and the service type implemented as value.

See also

hosting_server_services()

Related topics

File

example/hosting_example.module, line 74
Example of the Hosting Services API.

Code

function hosting_example_hosting_service() {
  return array(
    'basic' => 'example',
  );

  // Service implementation => service type.
}