Services_OpenStreetMap
[ class tree: Services_OpenStreetMap ] [ index: Services_OpenStreetMap ] [ all elements ]

Class: Services_OpenStreetMap_Transport_HTTP

Source Location: /Services_OpenStreetMap-1.0.0RC2/Services/OpenStreetMap/Transport/HTTP.php

Class Overview


Services_OpenStreetMap_Transport


Author(s):

Variables

Methods


Child classes:

Services_OpenStreetMap_Transport_HTTPCached
Services_OpenStreetMap_Transport_HTTPCached

Inherited Variables

Inherited Methods


Class Details

[line 49]
Services_OpenStreetMap_Transport


[ Top ]


Class Variables

$config =  null

[line 83]

Config object, contains setting on how to interact with API Endpoint
  • Access: protected



[ Top ]

$log =  null

[line 90]

Log object
  • Access: protected

Type:   Log


[ Top ]

$request =  null

[line 76]

The HTTP_Request2 instance.

Customise this for proxy settings etc with the getRequest/setRequest methods if necessary.

  • See: Services_OpenStreetMap::getRequest
  • See: Services_OpenStreetMap::setRequest
  • Access: protected

Type:   HTTP_Request2


[ Top ]



Method Detail

__construct (Constructor)   [line 57]

Services_OpenStreetMap_Transport_HTTP __construct( )

Constructor
  • Access: public

Overridden in child classes as:

Services_OpenStreetMap_Transport_HTTPCached::__construct()
Constructor, setting file Cache object.

[ Top ]

addPostParameters   [line 444]

void addPostParameters( array $post_data, HTTP_Request2 $request)

Add post parameters to request object
  • Access: public

Parameters:

array   $post_data   —  Associative key/val array of post parameters
HTTP_Request2   $request   —  Request

[ Top ]

getConfig   [line 364]

Services_OpenStreetMap_Config getConfig( )

Get current Config object
  • Access: public

[ Top ]

getObject   [line 248]

Services_OpenStreetMap_Object|null getObject( string $type, string $id, [string $version = null], [string $append = null])

Get object of specified type and id.

Returns false if the object is not found

  • Throws: Services_OpenStreetMap_Exception
  • Throws: HTTP_Request2_LogicException
  • Access: public

Parameters:

string   $type   —  object type
string   $id   —  id of object to retrieve
string   $version   —  version of object, optional
string   $append   —  portion to append to request URL, optional

[ Top ]

getObjects   [line 303]

Services_OpenStreetMap_Objects|false getObjects( string $type, array $ids)

Get objects of specified type.
  • Throws: HTTP_Request2_LogicException
  • Throws: Services_OpenStreetMap_Exception
  • Access: public

Parameters:

string   $type   —  object type
array   $ids   —  ids of objects to retrieve

[ Top ]

getRequest   [line 200]

HTTP_Request2 getRequest( )

Get HTTP_Request2 instance.
  • Access: public

[ Top ]

getResponse   [line 110]

HTTP_Request2_Response getResponse( string $url, [string $method = HTTP_Request2::METHOD_GET], [string $user = null], [string $password = null], [string $body = null], [array $post_data = null], [array $headers = null])

Send request to OSM server and return the response.
  • Throws: Services_OpenStreetMap_Exception If something unexpected has happened while conversing with the server.
  • Throws: HTTP_Request2_LogicException
  • Access: public

Overridden in child classes as:

Services_OpenStreetMap_Transport_HTTPCached::getResponse()
Send request to OSM server and return the response.

Parameters:

string   $url   —  URL
string   $method   —  GET (default)/POST/PUT
string   $user   —  user (optional for read-only actions)
string   $password   —  password (optional for read-only actions)
string   $body   —  body (optional)
array   $post_data   —  (optional)
array   $headers   —  (optional)

[ Top ]

searchObjects   [line 379]

Services_OpenStreetMap_Objects|null searchObjects( string $type, array $criteria)

Search objects of specified type for certain criteria.
  • Throws: Services_OpenStreetMap_Exception
  • Throws: HTTP_Request2_LogicException
  • Access: public

Parameters:

string   $type   —  object type (e.g. changeset)
array   $criteria   —  array of criterion objects.

[ Top ]

setConfig   [line 353]

Services_OpenStreetMap_Transport setConfig( Services_OpenStreetMap_Config $config)

Set Config object
  • Access: public

Parameters:

Services_OpenStreetMap_Config   $config   —  Config settings.

[ Top ]

setHeaders   [line 427]

void setHeaders( array $headers, HTTP_Request2 $request)

Add headers to request
  • Throws: HTTP_Request2_LogicException
  • Access: public

Parameters:

array   $headers   —  Associative key/val array of headers
HTTP_Request2   $request   —  Request

[ Top ]

setLog   [line 228]

Services_OpenStreetMap_Transport_HTTP setLog( Log $log)

Set Log object.
  • Access: public

Parameters:

Log   $log   —  Log object

[ Top ]

setRequest   [line 215]

Services_OpenStreetMap_Transport_HTTP setRequest( HTTP_Request2 $request)

Set the HTTP_Request2 instance and return the Services_OpenStreetMap instance.

Use this to inject a specific HTTP_Request2 instance.

  • Access: public

Parameters:

HTTP_Request2   $request   —  The HTTP_Request2 instance to set.

[ Top ]


Documentation generated on Tue, 28 May 2019 19:19:07 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.