You are here

public function RESTServer::getCanonicalPath in Services 7.3

Canonical path is the url of the request without path of endpoint.

For example endpoint has path 'rest'. Canonical of request to url 'rest/node/1.php' will be 'node/1.php'.

Return value

string

1 call to RESTServer::getCanonicalPath()
RESTServer::getCanonicalPathArray in servers/rest_server/includes/RESTServer.inc
Explode canonical path to parts by '/'.

File

servers/rest_server/includes/RESTServer.inc, line 133
Class for handling REST calls.

Class

RESTServer
@file Class for handling REST calls.

Code

public function getCanonicalPath() {

  // Use drupal_static so we can clear this static cache during unit testing.
  // @see MockServicesRESTServerFactory constructor.
  $canonical_path =& drupal_static('RESTServerGetCanonicalPath');
  if (empty($canonical_path)) {
    $canonical_path = $this->context
      ->getCanonicalPath();
    $canonical_path = $this->negotiator
      ->getParsedCanonicalPath($canonical_path);
  }
  return $canonical_path;
}