Class Zend_Gdata_App

Description

Provides Atom Publishing Protocol (APP) functionality. This class and all other components of Zend_Gdata_App are designed to work independently from other Zend_Gdata components in order to interact with generic APP services.

  • copyright: Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
  • license: New BSD License

Located in /Gdata/App.php (line 52)


	
			
Direct descendents
Class Description
 class Zend_Gdata Provides functionality to interact with Google data APIs Subclasses exist to implement service-specific features
Variable Summary
Method Summary
 static boolean getGzipEnabled ()
 static boolean getHttpMethodOverride ()
 static int getMaxRedirects ()
 static boolean getVerboseExceptionMessages ()
 static Zend_Gdata_App_Feed import (string $uri, [Zend_Http_Client $client = null], [string $className = 'Zend_Gdata_App_Feed'])
 static Zend_Gdata_Feed importFile (string $filename, [string $className = 'Zend_Gdata_App_Feed'], [string $useIncludePath = false])
 static Zend_Gdata_App_Feed importString (string $string, [string $className = 'Zend_Gdata_App_Feed'])
 static void setGzipEnabled ([boolean $enabled = false])
 static void setHttpMethodOverride ([boolean $override = true])
 static void setMaxRedirects (int $maxRedirects)
 static void setStaticHttpClient ( $httpClient)
 static void setVerboseExceptionMessages (boolean $verbose)
 Zend_Gdata_App __construct ([Zend_Http_Client $client = null], [string $applicationId = 'MyCompany-MyApp-1.0'])
 void delete (mixed $data, [ $remainingRedirects = null])
 void enableRequestDebugLogging ($logfile $logfile)
 Zend_Http_Response get (string $uri)
 Zend_Gdata_App_Entry getEntry (string $uri, [string $className = 'Zend_Gdata_App_Entry'])
 Zend_Gdata_App_Feed getFeed (string $uri, [string $className = 'Zend_Gdata_App_Feed'])
 Zend_Gdata_App_Feed importUrl (string $url, [string $className = 'Zend_Gdata_App_Feed'])
 Zend_Gdata_App_Entry insertEntry (mixed $data, string $uri, [string $className = 'Zend_Gdata_App_Entry'])
 Zend_Http_Response performHttpRequest (string $method, string $url, [array $headers = null], [string $body = null], [string $contentType = null], [int $remainingRedirects = null])
 Zend_Http_Response post (mixed $data, [string $uri = null], [ $remainingRedirects = null], [string $contentType = null], [ $extraHeaders = null], array $headers, array $extraHaders)
 array prepareRequest (string $method, [string $url = null], [array $headers = array()], [mixed $data = null], [string $contentTypeOverride = null])
 Zend_Http_Response put (mixed $data, [string $uri = null], [ $remainingRedirects = null], [string $contentType = null], [ $extraHeaders = null], array $headers, array $extraHaders)
 void registerPackage (string $name)
 mixed retrieveAllEntriesForFeed ($feed $feed)
 Zend_Gdata_App setHttpClient (Zend_Http_Client $client, [ $applicationId = 'MyCompany-MyApp-1.0'])
 Zend_Gdata_App_Entry updateEntry (mixed $data, [ $uri = null], [ $className = null])
 void __call (string $method, array $args)
Variables
static boolean $_gzipEnabled = false (line 81)

Enable gzipped responses?

  • access: protected
static boolean $_httpMethodOverride = false (line 74)

Override HTTP PUT and DELETE request methods?

  • access: protected
static int $_maxRedirects = 5 (line 112)

Maximum number of redirects to follow during HTTP operations

  • access: protected
static Zend_Http_Client $_staticHttpClient = null (line 67)

Client object used to communicate in static context

  • access: protected

Redefined in descendants as:
static boolean $_verboseExceptionMessages = true (line 89)

Use verbose exception messages. In the case of HTTP errors, use the body of the HTTP response in the exception message.

  • access: protected
string $_defaultPostUri = null (line 96)

Default URI to which to POST.

  • access: protected

Redefined in descendants as:
Zend_Http_Client $_httpClient (line 60)

Client object used to communicate

  • access: protected

Redefined in descendants as:
array $_registeredPackages = array(
'Zend_Gdata_App_Extension',
'Zend_Gdata_App')
(line 103)

Packages to search for classes when using magic __call method, in order.

  • access: protected

Redefined in descendants as:
Methods
static getGzipEnabled (line 285)

Get the HTTP override state

  • access: public
static boolean getGzipEnabled ()
static getHttpMethodOverride (line 257)

Get the HTTP override state

  • access: public
static boolean getHttpMethodOverride ()
static getMaxRedirects (line 332)

Get the maximum number of redirects to follow during HTTP operations

  • return: Maximum number of redirects to follow
  • access: public
static int getMaxRedirects ()
static getStaticHttpClient (line 219)

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

  • access: public
static Zend_Http_Client getStaticHttpClient ()
static getVerboseExceptionMessages (line 298)

Get whether to use verbose exception messages

In the case of HTTP errors, use the body of the HTTP response in the exception message.

  • access: public
static boolean getVerboseExceptionMessages ()
static import (line 517)

Imports a feed located at $uri.

  • throws: Zend_Gdata_App_Exception
  • access: public
static Zend_Gdata_App_Feed import (string $uri, [Zend_Http_Client $client = null], [string $className = 'Zend_Gdata_App_Feed'])
  • string $uri
  • Zend_Http_Client $client: The client used for communication
  • string $className: The class which is used as the return type

Redefined in descendants as:
static importFile (line 587)

Imports a feed from a file located at $filename.

  • throws: Zend_Gdata_App_Exception
  • access: public
static Zend_Gdata_Feed importFile (string $filename, [string $className = 'Zend_Gdata_App_Feed'], [string $useIncludePath = false])
  • string $filename
  • string $className: The class which is used as the return type
  • string $useIncludePath: Whether the include_path should be searched
static importString (line 560)

Imports a feed represented by $string.

  • throws: Zend_Gdata_App_Exception
  • access: public
static Zend_Gdata_App_Feed importString (string $string, [string $className = 'Zend_Gdata_App_Feed'])
  • string $string
  • string $className: The class which is used as the return type
static setGzipEnabled (line 268)

Toggle requesting gzip encoded responses

  • access: public
static void setGzipEnabled ([boolean $enabled = false])
  • boolean $enabled: Whether or not to enable gzipped responses
static setHttpMethodOverride (line 247)

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.

  • access: public
static void setHttpMethodOverride ([boolean $override = true])
  • boolean $override: Whether to override PUT and DELETE with POST.
static setMaxRedirects (line 322)

Set the maximum number of redirects to follow during HTTP operations

  • access: public
static void setMaxRedirects (int $maxRedirects)
  • int $maxRedirects: Maximum number of redirects to follow
static setStaticHttpClient (line 208)

Set the static HTTP client instance

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

  • access: public
static void setStaticHttpClient ( $httpClient)
static setVerboseExceptionMessages (line 311)

Set whether to use verbose exception messages

In the case of HTTP errors, use the body of the HTTP response in the exception message.

  • access: public
static void setVerboseExceptionMessages (boolean $verbose)
  • boolean $verbose: Whether to use verbose exception messages
Constructor __construct (line 120)

Create Gdata object

  • access: public
Zend_Gdata_App __construct ([Zend_Http_Client $client = null], [string $applicationId = 'MyCompany-MyApp-1.0'])

Redefined in descendants as:
delete (line 669)

DELETE entry with client object

  • throws: Zend_Gdata_App_Exception
  • throws: Zend_Gdata_App_HttpException
  • throws: Zend_Gdata_App_InvalidArgumentException
  • access: public
void delete (mixed $data, [ $remainingRedirects = null])
  • mixed $data: The Zend_Gdata_App_Entry or URL to delete
  • $remainingRedirects

Redefined in descendants as:
  • Zend_Gdata_Gapps::delete() : DELETE entry with client object This method overrides the default behavior of Zend_Gdata_App, providing support for Zend_Gdata_Gapps_ServiceException.
enableRequestDebugLogging (line 797)

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.

  • access: public
void enableRequestDebugLogging ($logfile $logfile)
  • $logfile $logfile: The logfile to use when logging the requests
get (line 607)

GET a uri using client object

  • throws: Zend_Gdata_App_HttpException
  • access: public
Zend_Http_Response get (string $uri)
  • string $uri

Redefined in descendants as:
getEntry (line 157)

Retreive entry object

  • access: public
Zend_Gdata_App_Entry getEntry (string $uri, [string $className = 'Zend_Gdata_App_Entry'])
  • string $uri
  • string $className: The class which is used as the return type

Redefined in descendants as:
getFeed (line 145)

Retreive feed object

  • access: public
Zend_Gdata_App_Feed getFeed (string $uri, [string $className = 'Zend_Gdata_App_Feed'])
  • string $uri: The uri from which to retrieve the feed
  • string $className: The class which is used as the return type

Redefined in descendants as:
getHttpClient (line 167)

Get the Zend_Http_Client object used for communication

  • access: public
Zend_Http_Client getHttpClient ()
importUrl (line 539)

Imports the specified URL (non-statically).

  • throws: Zend_Gdata_App_Exception
  • access: public
Zend_Gdata_App_Feed importUrl (string $url, [string $className = 'Zend_Gdata_App_Feed'])
  • string $url: The URL to import
  • string $className: The class which is used as the return type
insertEntry (line 688)

Inserts an entry to a given URI and returns the response as a fully formed Entry.

  • return: The entry returned by the service after insertion.
  • access: public
Zend_Gdata_App_Entry insertEntry (mixed $data, string $uri, [string $className = 'Zend_Gdata_App_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.
performHttpRequest (line 436)

Performs a HTTP request using the specified method

  • return: The response object
  • access: public
Zend_Http_Response performHttpRequest (string $method, string $url, [array $headers = null], [string $body = null], [string $contentType = null], [int $remainingRedirects = null])
  • 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

Redefined in descendants as:
post (line 626)

POST data with client object

  • throws: Zend_Gdata_App_Exception
  • throws: Zend_Gdata_App_HttpException
  • throws: Zend_Gdata_App_InvalidArgumentException
  • access: public
Zend_Http_Response post (mixed $data, [string $uri = null], [ $remainingRedirects = null], [string $contentType = null], [ $extraHeaders = null], array $headers, array $extraHaders)
  • 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 $extraHaders: Extra headers to add to the request
  • $remainingRedirects
  • $extraHeaders

Redefined in descendants as:
prepareRequest (line 360)

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

  • return: An associative array containing the determined 'method', 'url', 'data', 'headers', 'contentType'
  • access: public
array prepareRequest (string $method, [string $url = null], [array $headers = array()], [mixed $data = null], [string $contentTypeOverride = null])
  • 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 (line 650)

PUT data with client object

  • throws: Zend_Gdata_App_Exception
  • throws: Zend_Gdata_App_HttpException
  • throws: Zend_Gdata_App_InvalidArgumentException
  • access: public
Zend_Http_Response put (mixed $data, [string $uri = null], [ $remainingRedirects = null], [string $contentType = null], [ $extraHeaders = null], array $headers, array $extraHaders)
  • 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 $extraHaders: Extra headers to add to the request
  • $remainingRedirects
  • $extraHeaders

Redefined in descendants as:
  • Zend_Gdata_Gapps::put() : PUT data with client object This method overrides the default behavior of Zend_Gdata_App, providing support for Zend_Gdata_Gapps_ServiceException.
registerPackage (line 133)

Adds a Zend Framework package to the $_registeredPackages array.

This array is searched when using the magic __call method below to instantiante new objects.

  • access: public
void registerPackage (string $name)
  • string $name: The name of the package (eg Zend_Gdata_App)
retrieveAllEntriesForFeed (line 769)

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.

  • return: A new feed of the same type as the one originally passed in, containing all relevent entries.
  • access: public
mixed retrieveAllEntriesForFeed ($feed $feed)
  • $feed $feed: The feed to iterate through.
setHttpClient (line 179)

Set the Zend_Http_Client object used for communication

  • return: Provides a fluent interface
  • throws: Zend_Gdata_App_HttpException
  • access: public
Zend_Gdata_App setHttpClient (Zend_Http_Client $client, [ $applicationId = 'MyCompany-MyApp-1.0'])

Redefined in descendants as:
updateEntry (line 704)

Update an entry

  • return: The entry returned from the server
  • throws: Zend_Gdata_App_Exception
  • access: public
Zend_Gdata_App_Entry updateEntry (mixed $data, [ $uri = null], [ $className = null])
  • mixed $data: Zend_Gdata_App_Entry or XML (w/ID and link rel='edit')
  • $uri
  • $className
__call (line 731)

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

  • throws: Zend_Gdata_App_Exception
  • access: public
void __call (string $method, array $args)
  • string $method: The method name being called
  • array $args: The arguments passed to the call

Redefined in descendants as:
  • Zend_Gdata_Gapps::__call() : Provides a magic factory method to instantiate new objects with shorter syntax than would otherwise be required by the Zend Framework naming conventions. For more information, see Zend_Gdata_App::__call().

Documentation generated on Mon, 15 Sep 2008 00:11:34 +0400 by phpDocumentor 1.4.2