You are here

function services_server in Services 6

Same name and namespace in other branches
  1. 5 services.module \services_server()
  2. 6.2 services.module \services_server()
  3. 7 services.module \services_server()

Callback for server endpoint

1 string reference to 'services_server'
services_menu in ./services.module
Implementation of hook_menu().

File

./services.module, line 166
@author Services Dev Team

Code

function services_server($server_path = NULL) {

  // Find which module the server is part of
  foreach (module_implements('server_info') as $module) {
    $info = module_invoke($module, 'server_info');
    if ($info['#path'] == $server_path) {

      // call the server
      services_set_server_info($module);
      print module_invoke($module, 'server');

      // Do not let this output
      module_invoke_all('exit');
      exit;
    }
  }

  // return 404 if the service doesn't exist
  drupal_not_found();
}