Projet

Général

Profil

Paste
Télécharger (2,25 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / uuid / uuid_services_example / uuid_services_example.services.inc @ e7101f36

1
<?php
2
/**
3
 * @file
4
 * uuid_services_example.services.inc
5
 */
6

    
7
/**
8
 * Implements hook_default_services_endpoint().
9
 */
10
function uuid_services_example_default_services_endpoint() {
11
  $export = array();
12

    
13
  $endpoint = new stdClass();
14
  $endpoint->disabled = FALSE; /* Edit this to true to make a default endpoint disabled initially */
15
  $endpoint->api_version = 3;
16
  $endpoint->name = 'uuid_services_example';
17
  $endpoint->server = 'rest_server';
18
  $endpoint->path = 'api';
19
  $endpoint->authentication = array(
20
    'services' => 'services',
21
  );
22
  $endpoint->server_settings = array(
23
    'formatters' => array(
24
      'json' => TRUE,
25
      'bencode' => FALSE,
26
      'jsonp' => FALSE,
27
      'php' => FALSE,
28
      'xml' => FALSE,
29
      'yaml' => FALSE,
30
    ),
31
    'parsers' => array(
32
      'application/json' => TRUE,
33
      'application/x-www-form-urlencoded' => TRUE,
34
      'multipart/form-data' => TRUE,
35
      'application/vnd.php.serialized' => FALSE,
36
      'application/x-yaml' => FALSE,
37
      'application/xml' => FALSE,
38
      'text/xml' => FALSE,
39
    ),
40
  );
41
  $endpoint->resources = array(
42
    'comment' => array(
43
      'operations' => array(
44
        'update' => array(
45
          'enabled' => '1',
46
        ),
47
      ),
48
    ),
49
    'file' => array(
50
      'operations' => array(
51
        'update' => array(
52
          'enabled' => '1',
53
        ),
54
      ),
55
    ),
56
    'node' => array(
57
      'operations' => array(
58
        'update' => array(
59
          'enabled' => '1',
60
        ),
61
      ),
62
    ),
63
    'taxonomy_term' => array(
64
      'operations' => array(
65
        'update' => array(
66
          'enabled' => '1',
67
        ),
68
      ),
69
    ),
70
    'user' => array(
71
      'operations' => array(
72
        'update' => array(
73
          'enabled' => '1',
74
        ),
75
      ),
76
      'actions' => array(
77
        'login' => array(
78
          'enabled' => '1',
79
          'settings' => array(
80
            'services' => array(
81
              'resource_api_version' => '1.0',
82
            ),
83
          ),
84
        ),
85
        'logout' => array(
86
          'enabled' => '1',
87
          'settings' => array(
88
            'services' => array(
89
              'resource_api_version' => '1.0',
90
            ),
91
          ),
92
        ),
93
      ),
94
    ),
95
  );
96
  $endpoint->debug = 1;
97
  $export['uuid_services_example'] = $endpoint;
98

    
99
  return $export;
100
}