Moodle  2.2.1
http://www.collinsharper.com
Zend_Gdata_App Class Reference
Inheritance diagram for Zend_Gdata_App:

Public Member Functions

 __construct ($client=null, $applicationId= 'MyCompany-MyApp-1.0')
 registerPackage ($name)
 getFeed ($uri, $className='Zend_Gdata_App_Feed')
 getEntry ($uri, $className='Zend_Gdata_App_Entry')
 getHttpClient ()
 setHttpClient ($client, $applicationId= 'MyCompany-MyApp-1.0')
 setMajorProtocolVersion ($value)
 getMajorProtocolVersion ()
 setMinorProtocolVersion ($value)
 getMinorProtocolVersion ()
 prepareRequest ($method, $url=null, $headers=array(), $data=null, $contentTypeOverride=null)
 performHttpRequest ($method, $url, $headers=null, $body=null, $contentType=null, $remainingRedirects=null)
 importUrl ($url, $className='Zend_Gdata_App_Feed', $extraHeaders=array())
 get ($uri, $extraHeaders=array())
 post ($data, $uri=null, $remainingRedirects=null, $contentType=null, $extraHeaders=null)
 put ($data, $uri=null, $remainingRedirects=null, $contentType=null, $extraHeaders=null)
 delete ($data, $remainingRedirects=null)
 insertEntry ($data, $uri, $className='Zend_Gdata_App_Entry', $extraHeaders=array())
 updateEntry ($data, $uri=null, $className=null, $extraHeaders=array())
 __call ($method, $args)
 retrieveAllEntriesForFeed ($feed)
 enableRequestDebugLogging ($logfile)
 getNextFeed ($feed, $className=null)
 getPreviousFeed ($feed, $className=null)
 generateIfMatchHeaderData ($data, $allowWeek)
 usingObjectMapping ()
 useObjectMapping ($value)

Static Public Member Functions

static setStaticHttpClient (Zend_Http_Client $httpClient)
static getStaticHttpClient ()
static setHttpMethodOverride ($override=true)
static getHttpMethodOverride ()
static setGzipEnabled ($enabled=false)
static getGzipEnabled ()
static getVerboseExceptionMessages ()
static setVerboseExceptionMessages ($verbose)
static setMaxRedirects ($maxRedirects)
static getMaxRedirects ()
static import ($uri, $client=null, $className='Zend_Gdata_App_Feed')
static importString ($string, $className='Zend_Gdata_App_Feed', $majorProtocolVersion=null, $minorProtocolVersion=null)
static importFile ($filename, $className='Zend_Gdata_App_Feed', $useIncludePath=false)

Data Fields

const DEFAULT_MAJOR_PROTOCOL_VERSION = 1
const DEFAULT_MINOR_PROTOCOL_VERSION = null

Protected Attributes

 $_httpClient
 $_defaultPostUri = null
 $_registeredPackages
 $_majorProtocolVersion
 $_minorProtocolVersion
 $_useObjectMapping = true

Static Protected Attributes

static $_staticHttpClient = null
static $_httpMethodOverride = false
static $_gzipEnabled = false
static $_verboseExceptionMessages = true
static $_maxRedirects = 5

Detailed Description

Definition at line 55 of file App.php.


Constructor & Destructor Documentation

__construct ( client = null,
applicationId = 'MyCompany-MyApp-1.0' 
)

Create Gdata object

Parameters:
Zend_Http_Client$client
string$applicationId

Reimplemented in Zend_Gdata_Photos, Zend_Gdata_Spreadsheets, Zend_Gdata, Zend_Gdata_Gbase, Zend_Gdata_Docs, Zend_Gdata_Books, Zend_Gdata_Calendar, Zend_Gdata_Geo, Zend_Gdata_DublinCore, Zend_Gdata_Exif, and Zend_Gdata_Media.

Definition at line 171 of file App.php.

Here is the call graph for this function:


Member Function Documentation

__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

Parameters:
string$methodThe method name being called
array$argsThe arguments passed to the call
Exceptions:
Zend_Gdata_App_Exception

Reimplemented in Zend_Gdata_Gapps.

Definition at line 1017 of file App.php.

Here is the call graph for this function:

delete ( data,
remainingRedirects = null 
)

DELETE entry with client object

Parameters:
mixed$dataThe Zend_Gdata_App_Entry or URL to delete
Returns:
void
Exceptions:
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_App_InvalidArgumentException

Reimplemented in Zend_Gdata_Gapps.

Definition at line 923 of file App.php.

Here is the call graph for this function:

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.

Parameters:
$logfileThe logfile to use when logging the requests

Definition at line 1098 of file App.php.

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.

Parameters:
boolean$allowWeakIf false, then if a weak Etag is detected, then return null rather than the Etag.
Returns:
string|null $data

Definition at line 1169 of file App.php.

Here is the caller graph for this function:

get ( uri,
extraHeaders = array() 
)

GET a URI using client object.

Parameters:
string$uriGET URI
array$extraHeadersExtra headers to add to the request, as an array of string-based key/value pairs.
Exceptions:
Zend_Gdata_App_HttpException
Returns:
Zend_Http_Response

Reimplemented in Zend_Gdata_Gapps.

Definition at line 856 of file App.php.

Here is the call graph for this function:

getEntry ( uri,
className = 'Zend_Gdata_App_Entry' 
)

Retrieve entry as string or object

Parameters:
string$uri
string$classNameThe class which is used as the return type
Returns:
string|Zend_Gdata_App_Entry Returns string only if the object mapping has been disabled explicitly by passing false to the useObjectMapping() function.

Reimplemented in Zend_Gdata.

Definition at line 218 of file App.php.

Here is the call graph for this function:

getFeed ( uri,
className = 'Zend_Gdata_App_Feed' 
)

Retrieve feed as string or object

Parameters:
string$uriThe uri from which to retrieve the feed
string$classNameThe class which is used as the return type
Returns:
string|Zend_Gdata_App_Feed Returns string only if the object mapping has been disabled explicitly by passing false to the useObjectMapping() function.

Reimplemented in Zend_Gdata.

Definition at line 203 of file App.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static getGzipEnabled ( ) [static]

Get the HTTP override state

Returns:
boolean

Definition at line 348 of file App.php.

Here is the caller graph for this function:

Get the Zend_Http_Client object used for communication

Returns:
Zend_Http_Client

Definition at line 228 of file App.php.

Here is the caller graph for this function:

static getHttpMethodOverride ( ) [static]

Get the HTTP override state

Returns:
boolean

Definition at line 320 of file App.php.

Here is the caller graph for this function:

Get the major protocol version that is in use.

See also:
_majorProtocolVersion
Returns:
int The major protocol version in use.

Definition at line 424 of file App.php.

Here is the caller graph for this function:

static getMaxRedirects ( ) [static]

Get the maximum number of redirects to follow during HTTP operations

Returns:
int Maximum number of redirects to follow

Definition at line 395 of file App.php.

Here is the caller graph for this function:

Get the minor protocol version that is in use.

See also:
_minorProtocolVersion
Returns:
(int|NULL) The major protocol version in use, or NULL if no minor version is specified.

Definition at line 455 of file App.php.

Here is the caller graph for this function:

getNextFeed ( feed,
className = null 
)

Retrieve next set of results based on a given feed.

Parameters:
Zend_Gdata_App_Feed$feedThe 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.
Returns:
Zend_Gdata_App_Feed|null Returns a Zend_Gdata_App_Feed or null if no next set of results exists.

Definition at line 1118 of file App.php.

Here is the call graph for this function:

getPreviousFeed ( feed,
className = null 
)

Retrieve previous set of results based on a given feed.

Parameters:
Zend_Gdata_App_Feed$feedThe 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.
Returns:
Zend_Gdata_App_Feed|null Returns a Zend_Gdata_App_Feed or null if no previous set of results exists.

Definition at line 1145 of file App.php.

Here is the call graph for this function:

static getStaticHttpClient ( ) [static]

Gets the HTTP client object. If none is set, a new Zend_Http_Client will be used.

Returns:
Zend_Http_Client

Definition at line 282 of file App.php.

static getVerboseExceptionMessages ( ) [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.

Returns:
boolean

Definition at line 361 of file App.php.

static import ( uri,
client = null,
className = 'Zend_Gdata_App_Feed' 
) [static]

Imports a feed located at $uri.

Parameters:
string$uri
Zend_Http_Client$clientThe client used for communication
string$classNameThe class which is used as the return type
Exceptions:
Zend_Gdata_App_Exception
Returns:
string|Zend_Gdata_App_Feed Returns string only if the object mapping has been disabled explicitly by passing false to the useObjectMapping() function.

Reimplemented in Zend_Gdata_Gapps, and Zend_Gdata.

Definition at line 719 of file App.php.

Here is the call graph for this function:

static importFile ( filename,
className = 'Zend_Gdata_App_Feed',
useIncludePath = false 
) [static]

Imports a feed from a file located at $filename.

Parameters:
string$filename
string$classNameThe class which is used as the return type
string$useIncludePathWhether the include_path should be searched
Exceptions:
Zend_Gdata_App_Exception
Returns:
Zend_Gdata_App_Feed

Definition at line 833 of file App.php.

Here is the call graph for this function:

static importString ( string,
className = 'Zend_Gdata_App_Feed',
majorProtocolVersion = null,
minorProtocolVersion = null 
) [static]

Imports a feed represented by $string.

Parameters:
string$string
string$classNameThe 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.
Exceptions:
Zend_Gdata_App_Exception
Returns:
Zend_Gdata_App_Feed

Definition at line 799 of file App.php.

Here is the caller graph for this function:

importUrl ( url,
className = 'Zend_Gdata_App_Feed',
extraHeaders = array() 
)

Imports the specified URL (non-statically).

Parameters:
string$urlThe URL to import
string$classNameThe class which is used as the return type
array$extraHeadersExtra headers to add to the request, as an array of string-based key/value pairs.
Exceptions:
Zend_Gdata_App_Exception
Returns:
string|Zend_Gdata_App_Feed Returns string only if the object mapping has been disabled explicitly by passing false to the useObjectMapping() function.

Definition at line 751 of file App.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
mixed$dataThe Zend_Gdata_App_Entry or XML to post
string$uriPOST URI
string$classNameThe class of entry to be returned.
array$extraHeadersExtra headers to add to the request, as an array of string-based key/value pairs.
Returns:
Zend_Gdata_App_Entry The entry returned by the service after insertion.

Definition at line 953 of file App.php.

Here is the call graph for this function:

Here is the caller graph for this function:

performHttpRequest ( method,
url,
headers = null,
body = null,
contentType = null,
remainingRedirects = null 
)

Performs a HTTP request using the specified method

Parameters:
string$methodThe HTTP method for the request - 'GET', 'POST', 'PUT', 'DELETE'
string$urlThe URL to which this request is being performed
array$headersAn associative array of HTTP headers for this request
string$bodyThe body of the HTTP request
string$contentTypeThe value for the content type of the request body
int$remainingRedirectsNumber of redirects to follow if request s results in one
Returns:
Zend_Http_Response The response object

Reimplemented in Zend_Gdata.

Definition at line 589 of file App.php.

Here is the call graph for this function:

Here is the caller graph for this function:

post ( data,
uri = null,
remainingRedirects = null,
contentType = null,
extraHeaders = null 
)

POST data with client object

Parameters:
mixed$dataThe Zend_Gdata_App_Entry or XML to post
string$uriPOST URI
array$headersAdditional HTTP headers to insert.
string$contentTypeContent-type of the data
array$extraHeadersExtra headers to add to the request, as an array of string-based key/value pairs.
Returns:
Zend_Http_Response
Exceptions:
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_App_InvalidArgumentException

Reimplemented in Zend_Gdata_Gapps.

Definition at line 878 of file App.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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()

Parameters:
string$methodThe HTTP method for the request - 'GET', 'POST', 'PUT', 'DELETE'
string$urlThe URL to which this request is being performed, or null if found in $data
array$headersAn associative array of HTTP headers for this request
mixed$dataThe Zend_Gdata_App_Entry or XML for the body of the request
string$contentTypeOverrideThe override value for the content type of the request body
Returns:
array An associative array containing the determined 'method', 'url', 'data', 'headers', 'contentType'

Definition at line 483 of file App.php.

Here is the call graph for this function:

Here is the caller graph for this function:

put ( data,
uri = null,
remainingRedirects = null,
contentType = null,
extraHeaders = null 
)

PUT data with client object

Parameters:
mixed$dataThe Zend_Gdata_App_Entry or XML to post
string$uriPUT URI
array$headersAdditional HTTP headers to insert.
string$contentTypeContent-type of the data
array$extraHeadersExtra headers to add to the request, as an array of string-based key/value pairs.
Returns:
Zend_Http_Response
Exceptions:
Zend_Gdata_App_Exception
Zend_Gdata_App_HttpException
Zend_Gdata_App_InvalidArgumentException

Reimplemented in Zend_Gdata_Gapps.

Definition at line 903 of file App.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
string$nameThe name of the package (eg Zend_Gdata_App)
Returns:
void

Definition at line 188 of file App.php.

Here is the caller graph for this function:

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.

Parameters:
$feedThe feed to iterate through.
Returns:
mixed A new feed of the same type as the one originally passed in, containing all relevent entries.

Definition at line 1070 of file App.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static setGzipEnabled ( enabled = false) [static]

Toggle requesting gzip encoded responses

Parameters:
boolean$enabledWhether or not to enable gzipped responses
Returns:
void

Definition at line 331 of file App.php.

setHttpClient ( client,
applicationId = 'MyCompany-MyApp-1.0' 
)

Set the Zend_Http_Client object used for communication

Parameters:
Zend_Http_Client$clientThe client to use for communication
Exceptions:
Zend_Gdata_App_HttpException
Returns:
Zend_Gdata_App Provides a fluent interface

Definition at line 240 of file App.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static setHttpMethodOverride ( override = true) [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.

Parameters:
boolean$overrideWhether to override PUT and DELETE with POST.
Returns:
void

Definition at line 310 of file App.php.

Set the major protocol version that should be used. Values < 1 will cause a Zend_Gdata_App_InvalidArgumentException to be thrown.

See also:
_majorProtocolVersion
Parameters:
int$valueThe major protocol version to use.
Exceptions:
Zend_Gdata_App_InvalidArgumentException

Definition at line 408 of file App.php.

Here is the caller graph for this function:

static setMaxRedirects ( maxRedirects) [static]

Set the maximum number of redirects to follow during HTTP operations

Parameters:
int$maxRedirectsMaximum number of redirects to follow
Returns:
void

Definition at line 385 of file App.php.

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.

See also:
_minorProtocolVersion
Parameters:
(int|NULL)$value The minor protocol version to use.
Exceptions:
Zend_Gdata_App_InvalidArgumentException

Definition at line 438 of file App.php.

Here is the caller graph for this function:

static setStaticHttpClient ( Zend_Http_Client httpClient) [static]

Set the static HTTP client instance

Sets the static HTTP client object to use for retrieving the feed.

Parameters:
Zend_Http_Client$httpClient
Returns:
void

Definition at line 271 of file App.php.

Here is the caller graph for this function:

static setVerboseExceptionMessages ( verbose) [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.

Parameters:
boolean$verboseWhether to use verbose exception messages

Definition at line 374 of file App.php.

updateEntry ( data,
uri = null,
className = null,
extraHeaders = array() 
)

Update an entry

Parameters:
mixed$dataZend_Gdata_App_Entry or XML (w/ID and link rel='edit')
string|nullThe URI to send requests to, or null if $data contains the URI.
string|nullThe name of the class that should be deserialized from the server response. If null, then 'Zend_Gdata_App_Entry' will be used.
array$extraHeadersExtra headers to add to the request, as an array of string-based key/value pairs.
Returns:
Zend_Gdata_App_Entry The entry returned from the server
Exceptions:
Zend_Gdata_App_Exception

Definition at line 983 of file App.php.

Here is the call graph for this function:

Here is the caller graph for this function:

useObjectMapping ( value)

Enable/disable the use of XML to object mapping.

Parameters:
boolean$valuePass in true to use the XML to object mapping. Pass in false or null to disable it.
Returns:
void

Definition at line 1202 of file App.php.

Determine whether service object is using XML to object mapping.

Returns:
boolean True if service object is using XML to object mapping, false otherwise.

Definition at line 1190 of file App.php.


Field Documentation

$_defaultPostUri = null [protected]

Reimplemented in Zend_Gdata_Gbase, Zend_Gdata_Docs, Zend_Gdata_Calendar, and Zend_Gdata.

Definition at line 111 of file App.php.

$_gzipEnabled = false [static, protected]

Definition at line 96 of file App.php.

$_httpClient [protected]

Reimplemented in Zend_Gdata.

Definition at line 75 of file App.php.

$_httpMethodOverride = false [static, protected]

Definition at line 89 of file App.php.

$_majorProtocolVersion [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.

See also:
setMajorProtocolVersion()
getMajorProtocolVersion()

Definition at line 140 of file App.php.

$_maxRedirects = 5 [static, protected]

Definition at line 127 of file App.php.

$_minorProtocolVersion [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.

See also:
setMinorProtocolVersion()
getMinorProtocolVersion()

Definition at line 156 of file App.php.

$_registeredPackages [protected]
Initial value:
 array(
            'Zend_Gdata_App_Extension',
            'Zend_Gdata_App')

Reimplemented in Zend_Gdata.

Definition at line 118 of file App.php.

$_staticHttpClient = null [static, protected]

Reimplemented in Zend_Gdata.

Definition at line 82 of file App.php.

$_useObjectMapping = true [protected]

Definition at line 163 of file App.php.

$_verboseExceptionMessages = true [static, protected]

Definition at line 104 of file App.php.

Default major protocol version.

See also:
_majorProtocolVersion

Definition at line 62 of file App.php.

Default minor protocol version.

See also:
_minorProtocolVersion

Definition at line 68 of file App.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations