Service/Nirvanix/Namespace/Imfs.php

Show: inherited
Table of Contents

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Service  
Subpackage
Nirvanix  
Version
$Id: Imfs.php 24593 2012-01-05 20:35:02Z matthew $  

\Zend_Service_Nirvanix_Namespace_Imfs

Package: Zend\Service\Nirvanix

Namespace proxy with additional convenience methods for the IMFS namespace.

This is a proxy class representing one namespace. It allows calls to the namespace to be made by PHP object calls rather than by having to construct HTTP client requests.

Parent(s)
\Zend_Service_Nirvanix_Namespace_Base
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

Propertyprotected$_defaults = array()
inherited

Defaults for POST parameters.

Inherited from: \Zend_Service_Nirvanix_Namespace_Base::$$_defaults

When a request to the service is to be made, the POST parameters are merged into these. This is a convenience feature so parameters that are repeatedly required like sessionToken do not need to be supplied again and again by the user.

Default valuearray()Details
Type
n/a
Inherited_from
\Zend_Service_Nirvanix_Namespace_Base::$$_defaults  
$_defaults

array

Propertyprotectedstring $_host = 'http://services.nirvanix.com'
inherited

Host to use for calls to this Nirvanix namespace.

Inherited from: \Zend_Service_Nirvanix_Namespace_Base::$$_host

It is possible that the user will wish to use different hosts for different namespaces.

Default value'http://services.nirvanix.com'Details
Type
string
Inherited_from
\Zend_Service_Nirvanix_Namespace_Base::$$_host  
Propertyprotected\Zend_Http_Client $_httpClient =
inherited

HTTP client instance that will be used to make calls to the Nirvanix web services.

Inherited from: \Zend_Service_Nirvanix_Namespace_Base::$$_httpClient
Propertyprotectedstring $_namespace = ''
inherited

Name of this namespace as used in the URL.

Inherited from: \Zend_Service_Nirvanix_Namespace_Base::$$_namespace
Default value''Details
Type
string
Inherited_from
\Zend_Service_Nirvanix_Namespace_Base::$$_namespace  

Methods

methodpublic__call(string $methodName, array $args) : \Zend_Service_Nirvanix_Response
inherited

When a method call is made against this proxy, convert it to an HTTP request to make against the Nirvanix REST service.

Inherited from: \Zend_Service_Nirvanix_Namespace_Base::__call()

$imfs->DeleteFiles(array('filePath' => 'foo'));

Assuming this object was proxying the IMFS namespace, the method call above would call the DeleteFiles command. The POST parameters would be filePath, merged with the $this->_defaults (containing the sessionToken).

Parameters
Name Type Description
$methodName string

Name of the command to call on this namespace.

$args array

Only the first is used and it must be an array. It contains the POST params.

Returns
Type Description
\Zend_Service_Nirvanix_Response
methodpublic__construct(array $options = array()) : void
inherited

Class constructor.

Inherited from: \Zend_Service_Nirvanix_Namespace_Base::__construct()
Parameters
Name Type Description
$options array

Options and dependency injection

methodprotected_makeUri(string $methodName) : string
inherited

Make a complete URI from an RPC method name.

Inherited from: \Zend_Service_Nirvanix_Namespace_Base::_makeUri()

All Nirvanix REST service URIs use the same format.

Parameters
Name Type Description
$methodName string

RPC method name

Returns
Type Description
string
methodprotected_wrapResponse(\Zend_Http_Response $httpResponse) : \Zend_Service_Nirvanix_Response
inherited

All Nirvanix REST service calls return an XML payload.

Inherited from: \Zend_Service_Nirvanix_Namespace_Base::_wrapResponse()

This method makes a Zend_Service_Nirvanix_Response from that XML payload.

Parameters
Name Type Description
$httpResponse \Zend_Http_Response

Raw response from Nirvanix

Returns
Type Description
\Zend_Service_Nirvanix_Response Wrapped response
methodpublicgetContents(string $filePath, integer $expiration = 3600) : string

Convenience function to get the contents of a file on the Nirvanix IMFS.

Analog to PHP's file_get_contents().

Parameters
Name Type Description
$filePath string

Remote path and filename

$expiration integer

Number of seconds that Nirvanix make the file available for download.

Returns
Type Description
string Contents of file
methodpublicgetHttpClient() : \Zend_Http_Client
inherited

Return the HTTP client used for this namespace.

Inherited from: \Zend_Service_Nirvanix_Namespace_Base::getHttpClient()

This is useful for inspecting the last request or directly interacting with the HTTP client.

Returns
Type Description
\Zend_Http_Client
methodpublicputContents(string $filePath, integer $data, string $mimeType = null) : \Zend_Service_Nirvanix_Response

Convenience function to put the contents of a string into the Nirvanix IMFS.

Analog to PHP's file_put_contents().

Parameters
Name Type Description
$filePath string

Remote path and filename

$data integer

Data to store in the file

$mimeType string

Mime type of data

Returns
Type Description
\Zend_Service_Nirvanix_Response
methodpublicunlink(string $filePath) : \Zend_Service_Nirvanix_Response

Convenience function to remove a file from the Nirvanix IMFS.

Analog to PHP's unlink().

Parameters
Name Type Description
$filePath string

Remove path and filename

Returns
Type Description
\Zend_Service_Nirvanix_Response
Documentation was generated by phpDocumentor 2.0.0a8.