Zend Framework
1.12
|
Public Member Functions | |
__construct ($client=null, $applicationId= 'MyCompany-MyApp-1.0') | |
Create Gdata object. | |
registerPackage ($name) | |
Adds a Zend Framework package to the $_registeredPackages array. | |
getFeed ($uri, $className='Zend_Gdata_App_Feed') | |
Retrieve feed as string or object. | |
getEntry ($uri, $className='Zend_Gdata_App_Entry') | |
Retrieve entry as string or object. | |
getHttpClient () | |
Get the Zend_Http_Client object used for communication. | |
setHttpClient ($client, $applicationId= 'MyCompany-MyApp-1.0') | |
Set the Zend_Http_Client object used for communication. | |
setMajorProtocolVersion ($value) | |
Set the major protocol version that should be used. | |
getMajorProtocolVersion () | |
Get the major protocol version that is in use. | |
setMinorProtocolVersion ($value) | |
Set the minor protocol version that should be used. | |
getMinorProtocolVersion () | |
Get the minor protocol version that is in use. | |
prepareRequest ($method, $url=null, $headers=array(), $data=null, $contentTypeOverride=null) | |
Provides pre-processing for HTTP requests to APP services. | |
performHttpRequest ($method, $url, $headers=null, $body=null, $contentType=null, $remainingRedirects=null) | |
Performs a HTTP request using the specified method. | |
importUrl ($url, $className='Zend_Gdata_App_Feed', $extraHeaders=array()) | |
Imports the specified URL (non-statically). | |
get ($uri, $extraHeaders=array()) | |
GET a URI using client object. | |
post ($data, $uri=null, $remainingRedirects=null, $contentType=null, $extraHeaders=null) | |
POST data with client object. | |
put ($data, $uri=null, $remainingRedirects=null, $contentType=null, $extraHeaders=null) | |
PUT data with client object. | |
delete ($data, $remainingRedirects=null) | |
DELETE entry with client object. | |
insertEntry ($data, $uri, $className='Zend_Gdata_App_Entry', $extraHeaders=array()) | |
Inserts an entry to a given URI and returns the response as a fully formed Entry. | |
updateEntry ($data, $uri=null, $className=null, $extraHeaders=array()) | |
Update an entry. | |
__call ($method, $args) | |
Provides a magic factory method to instantiate new objects with shorter syntax than would otherwise be required by the Zend Framework naming conventions. | |
retrieveAllEntriesForFeed ($feed) | |
Retrieve all entries for a feed, iterating through pages as necessary. | |
enableRequestDebugLogging ($logfile) | |
This method enables logging of requests by changing the Zend_Http_Client_Adapter used for performing the requests. | |
getNextFeed ($feed, $className=null) | |
Retrieve next set of results based on a given feed. | |
getPreviousFeed ($feed, $className=null) | |
Retrieve previous set of results based on a given feed. | |
generateIfMatchHeaderData ($data, $allowWeek) | |
Returns the data for an If-Match header based on the current Etag property. | |
usingObjectMapping () | |
Determine whether service object is using XML to object mapping. | |
useObjectMapping ($value) | |
Enable/disable the use of XML to object mapping. | |
Static Public Member Functions | |
static | setStaticHttpClient (Zend_Http_Client $httpClient) |
Set the static HTTP client instance. | |
static | getStaticHttpClient () |
Gets the HTTP client object. | |
static | setHttpMethodOverride ($override=true) |
Toggle using POST instead of PUT and DELETE HTTP methods. | |
static | getHttpMethodOverride () |
Get the HTTP override state. | |
static | setGzipEnabled ($enabled=false) |
Toggle requesting gzip encoded responses. | |
static | getGzipEnabled () |
Get the HTTP override state. | |
static | getVerboseExceptionMessages () |
Get whether to use verbose exception messages. | |
static | setVerboseExceptionMessages ($verbose) |
Set whether to use verbose exception messages. | |
static | setMaxRedirects ($maxRedirects) |
Set the maximum number of redirects to follow during HTTP operations. | |
static | getMaxRedirects () |
Get the maximum number of redirects to follow during HTTP operations. | |
static | import ($uri, $client=null, $className='Zend_Gdata_App_Feed', $useObjectMapping=true) |
Imports a feed located at $uri. | |
static | importString ($string, $className='Zend_Gdata_App_Feed', $majorProtocolVersion=null, $minorProtocolVersion=null) |
Imports a feed represented by $string. | |
static | importFile ($filename, $className='Zend_Gdata_App_Feed', $useIncludePath=false) |
Imports a feed from a file located at $filename. | |
Public Attributes | |
const | DEFAULT_MAJOR_PROTOCOL_VERSION = 1 |
Default major protocol version. | |
const | DEFAULT_MINOR_PROTOCOL_VERSION = null |
Default minor protocol version. | |
Protected Attributes | |
$_httpClient | |
$_defaultPostUri = null | |
$_registeredPackages | |
$_majorProtocolVersion | |
Indicates the major protocol version that should be used. | |
$_minorProtocolVersion | |
Indicates the minor protocol version that should be used. | |
$_useObjectMapping = true | |
Static Protected Attributes | |
static | $_staticHttpClient = null |
static | $_httpMethodOverride = false |
static | $_gzipEnabled = false |
static | $_verboseExceptionMessages = true |
static | $_maxRedirects = 5 |
__construct | ( | $client = null , |
|
$applicationId = 'MyCompany-MyApp-1.0' |
|||
) |
Create Gdata object.
Zend_Http_Client | $client | |
string | $applicationId |
__call | ( | $method, | |
$args | |||
) |
Provides a magic factory method to instantiate new objects with shorter syntax than would otherwise be required by the Zend Framework naming conventions.
For instance, to construct a new Zend_Gdata_Calendar_Extension_Color, a developer simply needs to do $gCal->newColor(). For this magic constructor, packages are searched in the same order as which they appear in the $_registeredPackages array
string | $method | The method name being called |
array | $args | The arguments passed to the call |
Zend_Gdata_App_Exception |
delete | ( | $data, | |
$remainingRedirects = null |
|||
) |
DELETE entry with client object.
mixed | $data | The Zend_Gdata_App_Entry or URL to delete |
enableRequestDebugLogging | ( | $logfile | ) |
This method enables logging of requests by changing the Zend_Http_Client_Adapter used for performing the requests.
NOTE: This will not work if you have customized the adapter already to use a proxy server or other interface.
string | $logfile | The logfile to use when logging the requests |
generateIfMatchHeaderData | ( | $data, | |
$allowWeek | |||
) |
Returns the data for an If-Match header based on the current Etag property.
If Etags are not supported by the server or cannot be extracted from the data, then null will be returned.
boolean | $allowWeak | If false, then if a weak Etag is detected, then return null rather than the Etag. |
get | ( | $uri, | |
$extraHeaders = array() |
|||
) |
GET a URI using client object.
string | $uri | GET URI |
array | $extraHeaders | Extra headers to add to the request, as an array of string-based key/value pairs. |
Zend_Gdata_App_HttpException |
getEntry | ( | $uri, | |
$className = 'Zend_Gdata_App_Entry' |
|||
) |
Retrieve entry as string or object.
string | $uri | |
string | $className | The class which is used as the return type |
getFeed | ( | $uri, | |
$className = 'Zend_Gdata_App_Feed' |
|||
) |
Retrieve feed as string or object.
string | $uri | The uri from which to retrieve the feed |
string | $className | The class which is used as the return type |
|
static |
Get the HTTP override state.
getHttpClient | ( | ) |
Get the Zend_Http_Client object used for communication.
|
static |
Get the HTTP override state.
getMajorProtocolVersion | ( | ) |
Get the major protocol version that is in use.
|
static |
Get the maximum number of redirects to follow during HTTP operations.
getMinorProtocolVersion | ( | ) |
Get the minor protocol version that is in use.
getNextFeed | ( | $feed, | |
$className = null |
|||
) |
Retrieve next set of results based on a given feed.
Zend_Gdata_App_Feed | $feed | The feed from which to retreive the next set of results. |
string | $className | (optional) The class of feed to be returned. If null, the next feed (if found) will be the same class as the feed that was given as the first argument. |
getPreviousFeed | ( | $feed, | |
$className = null |
|||
) |
Retrieve previous set of results based on a given feed.
Zend_Gdata_App_Feed | $feed | The feed from which to retreive the previous set of results. |
string | $className | (optional) The class of feed to be returned. If null, the previous feed (if found) will be the same class as the feed that was given as the first argument. |
|
static |
Gets the HTTP client object.
If none is set, a new Zend_Http_Client will be used.
|
static |
Get whether to use verbose exception messages.
In the case of HTTP errors, use the body of the HTTP response in the exception message.
|
static |
Imports a feed located at $uri.
string | $uri | |
Zend_Http_Client | $client | The client used for communication |
string | $className | The class which is used as the return type |
bool | $useObjectMapping | Enable/disable the use of XML to object mapping. |
Zend_Gdata_App_Exception |
|
static |
Imports a feed from a file located at $filename.
string | $filename | |
string | $className | The class which is used as the return type |
string | $useIncludePath | Whether the include_path should be searched |
Zend_Gdata_App_Exception |
|
static |
Imports a feed represented by $string.
string | $string | |
string | $className | The class which is used as the return type |
integer | $majorProcolVersion | (optional) The major protocol version of the data model object that is to be created. |
integer | $minorProcolVersion | (optional) The minor protocol version of the data model object that is to be created. |
Zend_Gdata_App_Exception |
importUrl | ( | $url, | |
$className = 'Zend_Gdata_App_Feed' , |
|||
$extraHeaders = array() |
|||
) |
Imports the specified URL (non-statically).
string | $url | The URL to import |
string | $className | The class which is used as the return type |
array | $extraHeaders | Extra headers to add to the request, as an array of string-based key/value pairs. |
Zend_Gdata_App_Exception |
insertEntry | ( | $data, | |
$uri, | |||
$className = 'Zend_Gdata_App_Entry' , |
|||
$extraHeaders = array() |
|||
) |
Inserts an entry to a given URI and returns the response as a fully formed Entry.
mixed | $data | The Zend_Gdata_App_Entry or XML to post |
string | $uri | POST URI |
string | $className | The class of entry to be returned. |
array | $extraHeaders | Extra headers to add to the request, as an array of string-based key/value pairs. |
performHttpRequest | ( | $method, | |
$url, | |||
$headers = null , |
|||
$body = null , |
|||
$contentType = null , |
|||
$remainingRedirects = null |
|||
) |
Performs a HTTP request using the specified method.
string | $method | The HTTP method for the request - 'GET', 'POST', 'PUT', 'DELETE' |
string | $url | The URL to which this request is being performed |
array | $headers | An associative array of HTTP headers for this request |
string | $body | The body of the HTTP request |
string | $contentType | The value for the content type of the request body |
int | $remainingRedirects | Number of redirects to follow if request s results in one |
post | ( | $data, | |
$uri = null , |
|||
$remainingRedirects = null , |
|||
$contentType = null , |
|||
$extraHeaders = null |
|||
) |
POST data with client object.
mixed | $data | The Zend_Gdata_App_Entry or XML to post |
string | $uri | POST URI |
array | $headers | Additional HTTP headers to insert. |
string | $contentType | Content-type of the data |
array | $extraHeaders | Extra headers to add to the request, as an array of string-based key/value pairs. |
prepareRequest | ( | $method, | |
$url = null , |
|||
$headers = array() , |
|||
$data = null , |
|||
$contentTypeOverride = null |
|||
) |
Provides pre-processing for HTTP requests to APP services.
1. Checks the $data element and, if it's an entry, extracts the XML, multipart data, edit link (PUT,DELETE), etc. 2. If $data is a string, sets the default content-type header as 'application/atom+xml' if it's not already been set. 3. Adds a x-http-method override header and changes the HTTP method to 'POST' if necessary as per getHttpMethodOverride()
string | $method | The HTTP method for the request - 'GET', 'POST', 'PUT', 'DELETE' |
string | $url | The URL to which this request is being performed, or null if found in $data |
array | $headers | An associative array of HTTP headers for this request |
mixed | $data | The Zend_Gdata_App_Entry or XML for the body of the request |
string | $contentTypeOverride | The override value for the content type of the request body |
put | ( | $data, | |
$uri = null , |
|||
$remainingRedirects = null , |
|||
$contentType = null , |
|||
$extraHeaders = null |
|||
) |
PUT data with client object.
mixed | $data | The Zend_Gdata_App_Entry or XML to post |
string | $uri | PUT URI |
array | $headers | Additional HTTP headers to insert. |
string | $contentType | Content-type of the data |
array | $extraHeaders | Extra headers to add to the request, as an array of string-based key/value pairs. |
registerPackage | ( | $name | ) |
Adds a Zend Framework package to the $_registeredPackages array.
This array is searched when using the magic __call method below to instantiante new objects.
string | $name | The name of the package (eg Zend_Gdata_App) |
retrieveAllEntriesForFeed | ( | $feed | ) |
Retrieve all entries for a feed, iterating through pages as necessary.
Be aware that calling this function on a large dataset will take a significant amount of time to complete. In some cases this may cause execution to timeout without proper precautions in place.
object | $feed | The feed to iterate through. |
|
static |
Toggle requesting gzip encoded responses.
boolean | $enabled | Whether or not to enable gzipped responses |
setHttpClient | ( | $client, | |
$applicationId = 'MyCompany-MyApp-1.0' |
|||
) |
Set the Zend_Http_Client object used for communication.
Zend_Http_Client | $client | The client to use for communication |
Zend_Gdata_App_HttpException |
|
static |
Toggle using POST instead of PUT and DELETE HTTP methods.
Some feed implementations do not accept PUT and DELETE HTTP methods, or they can't be used because of proxies or other measures. This allows turning on using POST where PUT and DELETE would normally be used; in addition, an X-Method-Override header will be sent with a value of PUT or DELETE as appropriate.
boolean | $override | Whether to override PUT and DELETE with POST. |
setMajorProtocolVersion | ( | $value | ) |
Set the major protocol version that should be used.
Values < 1 will cause a Zend_Gdata_App_InvalidArgumentException to be thrown.
int | $value | The major protocol version to use. |
Zend_Gdata_App_InvalidArgumentException |
|
static |
Set the maximum number of redirects to follow during HTTP operations.
int | $maxRedirects | Maximum number of redirects to follow |
setMinorProtocolVersion | ( | $value | ) |
Set the minor protocol version that should be used.
If set to NULL, no minor protocol version will be sent to the server. Values < 0 will cause a Zend_Gdata_App_InvalidArgumentException to be thrown.
(int|NULL) | $value The minor protocol version to use. |
Zend_Gdata_App_InvalidArgumentException |
|
static |
Set the static HTTP client instance.
Sets the static HTTP client object to use for retrieving the feed.
Zend_Http_Client | $httpClient |
|
static |
Set whether to use verbose exception messages.
In the case of HTTP errors, use the body of the HTTP response in the exception message.
boolean | $verbose | Whether to use verbose exception messages |
updateEntry | ( | $data, | |
$uri = null , |
|||
$className = null , |
|||
$extraHeaders = array() |
|||
) |
Update an entry.
mixed | $data | Zend_Gdata_App_Entry or XML (w/ID and link rel='edit') |
string|null | The URI to send requests to, or null if $data contains the URI. | |
string|null | The name of the class that should be deserialized from the server response. If null, then 'Zend_Gdata_App_Entry' will be used. | |
array | $extraHeaders | Extra headers to add to the request, as an array of string-based key/value pairs. |
Zend_Gdata_App_Exception |
useObjectMapping | ( | $value | ) |
Enable/disable the use of XML to object mapping.
boolean | $value | Pass in true to use the XML to object mapping. Pass in false or null to disable it. |
usingObjectMapping | ( | ) |
Determine whether service object is using XML to object mapping.
|
protected |
|
staticprotected |
|
protected |
|
staticprotected |
|
protected |
Indicates the major protocol version that should be used.
At present, recognized values are either 1 or 2. However, any integer value >= 1 is considered valid.
Under most circumtances, this will be automatically set by Zend_Gdata_App subclasses.
|
staticprotected |
|
protected |
Indicates the minor protocol version that should be used.
Can be set to either an integer >= 0, or NULL if no minor version should be sent to the server.
At present, this field is not used by any Google services, but may be used in the future.
Under most circumtances, this will be automatically set by Zend_Gdata_App subclasses.
|
protected |
|
staticprotected |
|
protected |
|
staticprotected |
const DEFAULT_MAJOR_PROTOCOL_VERSION = 1 |
Default major protocol version.
const DEFAULT_MINOR_PROTOCOL_VERSION = null |
Default minor protocol version.