source: sipes/modules_contrib/services/services.servers.api.php @ 3514c84

stableversion-3.0
Last change on this file since 3514c84 was 3959b2a, checked in by planificacion <planificacion@…>, 8 años ago

Se agregaron los modulos para permitir el despliegue de servicios web (SOAP)

  • Propiedad mode establecida a 100644
File size: 1.4 KB
Línea 
1<?php
2
3/**
4 * @file
5 * Hooks provided by Services for the definition of servers.
6 */
7
8/**
9 * @addtogroup hooks
10 * @{
11 */
12
13/**
14 * Identifies a server implementation to Services.
15 *
16 * @return
17 *   An associative array with the following keys.
18 *
19 *   - name: The display name of this server.
20 *       - settings: an assoc array containing settings information per endpoint that this server is enabled.
21 */
22function hook_server_info() {
23  return array(
24    'name' => 'REST',
25    'path' => 'rest',
26    'settings' => array(
27      'file' => array('inc', 'rest_server'),
28      'form' => '_rest_server_settings',
29      'submit' => '_rest_server_settings_submit',
30    ),
31  );
32}
33
34/**
35 * Acts on requests to the server defined in hook_server_info().
36 *
37 * This is the main entry point to your server implementation.
38 * Need to get some more description about the best way to implement
39 * servers.
40 */
41function hook_server() {
42  $endpoint_path = services_get_server_info('endpoint_path', 'services/rest');
43  $canonical_path = trim(drupal_substr($_GET['q'], drupal_strlen($endpoint_path)), '/');
44  $canonical_path = explode('/', $_GET['q']);
45  $endpoint_path_count = count(explode('/', $endpoint_path));
46  for ($x = 0; $x < $endpoint_path_count; $x++) {
47    array_shift($canonical_path);
48  }
49  $canonical_path = implode('/', $canonical_path);
50  if (empty($canonical_path)) {
51    return '';
52  }
53  //Handle server based on $canonical_path
54}
Nota: Vea TracBrowser para ayuda de uso del navegador del repositorio.