Example #1
0
 public function __construct($endpoint_name)
 {
     module_load_include('inc', 'services', 'services.runtime');
     $this->endpoint_name = $endpoint_name;
     $endpoint = services_endpoint_load($this->endpoint_name);
     $server = $endpoint->server;
     services_set_server_info_from_array(array('module' => $server, 'endpoint' => $this->endpoint_name, 'endpoint_path' => $endpoint->path, 'debug' => $endpoint->debug, 'settings' => $endpoint->server_settings));
     $this->server = new \RESTServer();
 }
Example #2
0
 /**
  * Default constructor.
  *
  * @param string $endpoint_name
  *   Name of the endpoint. This is the path for the server, for e.g. "rest".
  */
 public function __construct($endpoint_name)
 {
     module_load_include('inc', 'services', 'includes/services.runtime');
     $this->endpoint_name = $endpoint_name;
     $endpoint = services_endpoint_load($this->endpoint_name);
     $server = $endpoint->server;
     services_set_server_info_from_array(array('module' => $server, 'endpoint' => $this->endpoint_name, 'endpoint_path' => $endpoint->path, 'debug' => $endpoint->debug, 'settings' => $endpoint->server_settings));
     $this->endpoint_path = services_get_server_info('endpoint_path', 'services/rest');
     $services_rest_server_factory = variable_get('services_rest_server_factory_class', 'ServicesRESTServerFactory');
     $this->rest_server_factory = new $services_rest_server_factory(array('endpoint_path' => $this->endpoint_path));
 }