Skip to content
This repository has been archived by the owner on May 16, 2018. It is now read-only.

Commit

Permalink
Fixes DocBlocks in Zend_Service_Rackspace_Files
Browse files Browse the repository at this point in the history
Closes #22
  • Loading branch information
froschdesign committed Jan 6, 2015
1 parent 90f4f15 commit c11f8e1
Showing 1 changed file with 92 additions and 56 deletions.
148 changes: 92 additions & 56 deletions library/Zend/Service/Rackspace/Files.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@
require_once 'Zend/Service/Rackspace/Files/Container.php';
require_once 'Zend/Service/Rackspace/Files/Object.php';

/**
* Zend_Service_Rackspace_Files
*
* @category Zend
* @package Zend_Service
* @subpackage Rackspace
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Service_Rackspace_Files extends Zend_Service_Rackspace_Abstract
{
const ERROR_CONTAINER_NOT_EMPTY = 'The container is not empty, I cannot delete it.';
Expand Down Expand Up @@ -70,7 +79,7 @@ class Zend_Service_Rackspace_Files extends Zend_Service_Rackspace_Abstract
/**
* Return the total count of containers
*
* @return integer
* @return int
*/
public function getCountContainers()
{
Expand All @@ -80,7 +89,7 @@ public function getCountContainers()
/**
* Return the size in bytes of all the containers
*
* @return integer
* @return int
*/
public function getSizeContainers()
{
Expand All @@ -90,7 +99,7 @@ public function getSizeContainers()
/**
* Return the count of objects contained in all the containers
*
* @return integer
* @return int
*/
public function getCountObjects()
{
Expand All @@ -100,8 +109,8 @@ public function getCountObjects()
/**
* Get all the containers
*
* @param array $options
* @return Zend_Service_Rackspace_Files_ContainerList|boolean
* @param array $options
* @return Zend_Service_Rackspace_Files_ContainerList|bool
*/
public function getContainers($options=array())
{
Expand All @@ -115,7 +124,7 @@ public function getContainers($options=array())
* Get all the CDN containers
*
* @param array $options
* @return array|boolean
* @return array|bool
*/
public function getCdnContainers($options=array())
{
Expand All @@ -132,7 +141,7 @@ public function getCdnContainers($options=array())
* - size in bytes of all the containers
* - total objects in all the containers
*
* @return array|boolean
* @return array|bool
*/
public function getInfoAccount()
{
Expand All @@ -147,12 +156,16 @@ public function getInfoAccount()
}
return false;
}

/**
* Get all the objects of a container
*
* @param string $container
* @param array $options
* @return Zend_Service_Rackspace_Files_ObjectList|boolean
* Returns a maximum of 10,000 object names.
*
* @param string $container
* @param array $options
* @return bool|Zend_Service_Rackspace_Files_ObjectList
* @throws Zend_Service_Rackspace_Exception
*/
public function getObjects($container,$options=array())
{
Expand All @@ -166,12 +179,14 @@ public function getObjects($container,$options=array())
}
return false;
}

/**
* Create a container
*
* @param string $container
* @param array $metadata
* @return Zend_Service_Rackspace_Files_Container|boolean
* @param string $container
* @param array $metadata
* @return bool|Zend_Service_Rackspace_Files_Container
* @throws Zend_Service_Rackspace_Exception
*/
public function createContainer($container,$metadata=array())
{
Expand Down Expand Up @@ -203,11 +218,13 @@ public function createContainer($container,$metadata=array())
$this->errorCode= $status;
return false;
}

/**
* Delete a container (only if it's empty)
*
* @param sting $container
* @return boolean
* @param string $container
* @return bool
* @throws Zend_Service_Rackspace_Exception
*/
public function deleteContainer($container)
{
Expand All @@ -233,11 +250,13 @@ public function deleteContainer($container)
$this->errorCode= $status;
return false;
}

/**
* Get the metadata of a container
*
* @param string $container
* @return array|boolean
* @param string $container
* @return array|bool
* @throws Zend_Service_Rackspace_Exception
*/
public function getMetadataContainer($container)
{
Expand Down Expand Up @@ -279,8 +298,8 @@ public function getMetadataContainer($container)
/**
* Get a container
*
* @param string $container
* @return Container|boolean
* @param string $container
* @return Zend_Service_Rackspace_Files_Container|bool
*/
public function getContainer($container) {
$result= $this->getMetadataContainer($container);
Expand All @@ -289,13 +308,15 @@ public function getContainer($container) {
}
return false;
}

/**
* Get an object in a container
*
* @param string $container
* @param string $object
* @param array $headers
* @return Zend_Service_Rackspace_Files_Object|boolean
* @param string $container
* @param string $object
* @param array $headers
* @return bool|Zend_Service_Rackspace_Files_Object
* @throws Zend_Service_Rackspace_Exception
*/
public function getObject($container,$object,$headers=array())
{
Expand Down Expand Up @@ -331,16 +352,17 @@ public function getObject($container,$object,$headers=array())
$this->errorCode= $status;
return false;
}

/**
* Store a file in a container
*
* @param string $container
* @param string $object
* @param string $content
* @param array $metadata
* @param string $content_type
*
* @return boolean
* @param string $container
* @param string $object
* @param string $content
* @param array $metadata
* @param string $content_type
* @return bool
* @throws Zend_Service_Rackspace_Exception
*/
public function storeObject($container,$object,$content,$metadata=array(),$content_type=null) {
if (empty($container)) {
Expand Down Expand Up @@ -383,12 +405,14 @@ public function storeObject($container,$object,$content,$metadata=array(),$conte
$this->errorCode= $status;
return false;
}

/**
* Delete an object in a container
*
* @param string $container
* @param string $object
* @return boolean
* @param string $container
* @param string $object
* @return bool
* @throws Zend_Service_Rackspace_Exception
*/
public function deleteObject($container,$object) {
if (empty($container)) {
Expand All @@ -414,16 +438,18 @@ public function deleteObject($container,$object) {
$this->errorCode= $status;
return false;
}

/**
* Copy an object from a container to another
*
* @param string $container_source
* @param string $obj_source
* @param string $container_dest
* @param string $obj_dest
* @param array $metadata
* @param string $content_type
* @return boolean
* @param string $container_source
* @param string $obj_source
* @param string $container_dest
* @param string $obj_dest
* @param array $metadata
* @param string $content_type
* @return bool
* @throws Zend_Service_Rackspace_Exception
*/
public function copyObject($container_source,$obj_source,$container_dest,$obj_dest,$metadata=array(),$content_type=null) {
if (empty($container_source)) {
Expand Down Expand Up @@ -466,12 +492,14 @@ public function copyObject($container_source,$obj_source,$container_dest,$obj_de
$this->errorCode= $status;
return false;
}

/**
* Get the metadata of an object
*
* @param string $container
* @param string $object
* @return array|boolean
* @param string $container
* @param string $object
* @return array|bool
* @throws Zend_Service_Rackspace_Exception
*/
public function getMetadataObject($container,$object) {
if (empty($container)) {
Expand Down Expand Up @@ -516,14 +544,16 @@ public function getMetadataObject($container,$object) {
$this->errorCode= $status;
return false;
}

/**
* Set the metadata of a object in a container
* The old metadata values are replaced with the new one
*
* @param string $container
* @param string $object
* @param array $metadata
* @return boolean
*
* @param string $container
* @param string $object
* @param array $metadata
* @return bool
* @throws Zend_Service_Rackspace_Exception
*/
public function setMetadataObject($container,$object,$metadata)
{
Expand Down Expand Up @@ -558,12 +588,14 @@ public function setMetadataObject($container,$object,$metadata)
$this->errorCode= $status;
return false;
}

/**
* Enable the CDN for a container
*
* @param string $container
* @param integer $ttl
* @return array|boolean
* @param int $ttl
* @return array|bool
* @throws Zend_Service_Rackspace_Exception
*/
public function enableCdnContainer ($container,$ttl=self::CDN_TTL_MIN) {
if (empty($container)) {
Expand Down Expand Up @@ -597,14 +629,16 @@ public function enableCdnContainer ($container,$ttl=self::CDN_TTL_MIN) {
$this->errorCode= $status;
return false;
}

/**
* Update the attribute of a CDN container
*
* @param string $container
* @param integer $ttl
* @param boolean $cdn_enabled
* @param boolean $log
* @return boolean
* @param int $ttl
* @param bool $cdn_enabled
* @param bool $log
* @return bool
* @throws Zend_Service_Rackspace_Exception
*/
public function updateCdnContainer($container,$ttl=null,$cdn_enabled=null,$log=null)
{
Expand Down Expand Up @@ -655,11 +689,13 @@ public function updateCdnContainer($container,$ttl=null,$cdn_enabled=null,$log=n
$this->errorCode= $status;
return false;
}

/**
* Get the information of a Cdn container
*
* @param string $container
* @return array|boolean
* @param string $container
* @return array|bool
* @throws Zend_Service_Rackspace_Exception
*/
public function getInfoCdnContainer($container) {
if (empty($container)) {
Expand Down

0 comments on commit c11f8e1

Please sign in to comment.