Preset Service Endpoint

For example you have an exported service endpoint like this:

<?php
$endpoint
= new stdClass;
$endpoint->disabled = FALSE; /* Edit this to true to make a default endpoint disabled initially */
$endpoint->api_version = 3;
$endpoint->name = 'test';
$endpoint->server = 'rest_server';
$endpoint->path = 'test';
$endpoint->authentication = array();
$endpoint->server_settings = array();
$endpoint->resources = array(
 
'node' => array(
   
'operations' => array(
     
'retrieve' => array(
       
'enabled' => 1,
      ),
     
'create' => array(
       
'enabled' => 1,
      ),
     
'update' => array(
       
'enabled' => 1,
      ),
     
'delete' => array(
       
'enabled' => 1,
      ),
     
'index' => array(
       
'enabled' => 1,
      ),
    ),
   
'relationships' => array(
     
'files' => array(
       
'enabled' => 1,
      ),
     
'comments' => array(
       
'enabled' => 1,
      ),
    ),
  ),
);
$endpoint->debug = 0;
?>

and you want to put that exported service endpoint to a certain module (for example mymodule) so that when that module is installed in a different site, that exported service endpoint is already available on the Service page (in drupal 6 it is at admin/build/services/list).

To do that, in your mymodule.module, put the following hook:

<?php
/**

Subscribe with RSS Subscribe to RSS - Preset Service Endpoint