ucloud storage php doc
 All Data Structures Namespaces Files Functions Variables
Public Member Functions | Data Fields
CF_Container Class Reference

Public Member Functions

 __construct (&$cfs_auth, &$cfs_http, $name, $count=0, $bytes=0)
 
 __toString ()
 
 create_object ($obj_name=NULL)
 
 get_object ($obj_name=NULL)
 
 list_objects ($limit=0, $marker=NULL, $prefix=NULL, $path=NULL)
 
 get_objects ($limit=0, $marker=NULL, $prefix=NULL, $path=NULL, $delimiter=NULL)
 
 copy_object_to ($obj, $container_target, $dest_obj_name=NULL, $metadata=NULL, $headers=NULL)
 
 copy_object_from ($obj, $container_source, $dest_obj_name=NULL, $metadata=NULL, $headers=NULL)
 
 move_object_to ($obj, $container_target, $dest_obj_name=NULL, $metadata=NULL, $headers=NULL)
 
 move_object_from ($obj, $container_source, $dest_obj_name=NULL, $metadata=NULL, $headers=NULL)
 
 delete_object ($obj, $container=NULL)
 
 enableStaticWebsiteConfig ($index=NULL, $error=NULL, $listings=NULL, $css=NULL)
 
 disableStaticWebsiteConfig ()
 
 enableContainerLogging ()
 
 disableContainerLogging ()
 
 make_public ()
 
 make_private ()
 
 addUpdate_container_user_metadata ($key, $value)
 
 delete_container_user_metadata ($key)
 
 create_paths ($path_name)
 

Data Fields

 $cfs_auth
 
 $cfs_http
 
 $name
 
 $object_count
 
 $bytes_used
 
 $metadata
 

Detailed Description

Definition at line 835 of file cloudfiles-kt.php.

Constructor & Destructor Documentation

__construct ( $cfs_auth,
$cfs_http,
  $name,
  $count = 0,
  $bytes = 0 
)

Class constructor

Constructor for Container

Parameters
obj$cfs_authCF_Authentication instance
obj$cfs_httpHTTP connection manager
string$namename of Container
int$countnumber of Objects stored in this Container
int$bytesnumber of bytes stored in this Container
Exceptions
SyntaxExceptioninvalid Container name

Definition at line 856 of file cloudfiles-kt.php.

Member Function Documentation

__toString ( )

String representation of Container

Pretty print the Container instance.

Returns
string Container details

Definition at line 882 of file cloudfiles-kt.php.

addUpdate_container_user_metadata (   $key,
  $value 
)

ÇØ´ç ÄÁÅ×À̳ʿ¡ »ç¿ëÀÚ Á¤ÀÇ metadata¸¦ Ãß°¡/°»½ÅÇÑ´Ù. »ç¿ëÀÚ metadata´Â ¸¶Áö¸· ÀúÀå°ªÀÌ À¯ÁöµÈ´Ù. Áï, ƯÁ¤ key¿¡ ´ëÇÑ metadata¸¦ °»½ÅÇÒ °æ¿ì ±âÁ¸ °ªÀº ¿äûµÈ °ªÀ¸·Î ´ëüµÇ°í ÀÌÀü °ªÀº »èÁ¦µÈ´Ù.

Example: ... authentication code excluded (see previous examples) ...

$conn = new CF_Connection($auth);

$test_container = $conn->get_container("test");

Config specific container

$test_container->addUpdate_container_user_metadata($key, $value);

Parameters
key$key»ç¿ëÀÚ metadata¿¡ ´ëÇÑ key
value$value»ç¿ëÀÚ metadata¿¡ ´ëÇÑ value
Returns
boolean True if successfully removed

Definition at line 1563 of file cloudfiles-kt.php.

copy_object_from (   $obj,
  $container_source,
  $dest_obj_name = NULL,
  $metadata = NULL,
  $headers = NULL 
)

Copy a remote storage Object from a source Container

Given an Object instance or name and a source Container instance or name, copy copies the remote Object and all associated metadata.

Example: ... authentication code excluded (see previous examples) ...

$conn = new CF_Connection($auth);

$images = $conn->get_container("my photos");

Copy specific object

$images->copy_object_from("disco_dancing.jpg","container_source");

Parameters
obj$objname or instance of Object to copy
obj$container_sourcename or instance of source Container
string$dest_obj_namename of target object (optional - uses source name if omitted)
array$metadatametadata array for new object (optional)
array$headersheader fields array for the new object (optional)
Returns
boolean true if successfully copied
Exceptions
SyntaxExceptioninvalid Object/Container name
NoSuchObjectExceptionremote Object does not exist
InvalidResponseExceptionunexpected response

Definition at line 1172 of file cloudfiles-kt.php.

copy_object_to (   $obj,
  $container_target,
  $dest_obj_name = NULL,
  $metadata = NULL,
  $headers = NULL 
)

Copy a remote storage Object to a target Container

Given an Object instance or name and a target Container instance or name, copy copies the remote Object and all associated metadata.

Example: ... authentication code excluded (see previous examples) ...

$conn = new CF_Connection($auth);

$images = $conn->get_container("my photos");

Copy specific object

$images->copy_object_to("disco_dancing.jpg","container_target");

Parameters
obj$objname or instance of Object to copy
obj$container_targetname or instance of target Container
string$dest_obj_namename of target object (optional - uses source name if omitted)
array$metadatametadata array for new object (optional)
array$headersheader fields array for the new object (optional)
Returns
boolean true if successfully copied
Exceptions
SyntaxExceptioninvalid Object/Container name
NoSuchObjectExceptionremote Object does not exist
InvalidResponseExceptionunexpected response

Definition at line 1098 of file cloudfiles-kt.php.

create_object (   $obj_name = NULL)

Create a new remote storage Object

Return a new Object instance. If the remote storage Object exists, the instance's attributes are populated.

Example: ... authentication code excluded (see previous examples) ...

$conn = new CF_Connection($auth);

$public_container = $conn->get_container("public");

This creates a local instance of a storage object but only creates it in the storage system when the object's write() method is called.

$pic = $public_container->create_object("baby.jpg");

Parameters
string$obj_namename of storage Object
Returns
obj CF_Object instance

Definition at line 912 of file cloudfiles-kt.php.

create_paths (   $path_name)

Helper function to create "path" elements for a given Object name

Given an Object whose name contains '/' path separators, this function will create the "directory marker" Objects of one byte with the Content-Type of "application/directory".

It assumes the last element of the full path is the "real" Object and does NOT create a remote storage Object for that last element.

Definition at line 1617 of file cloudfiles-kt.php.

delete_container_user_metadata (   $key)

ÇØ´ç ÄÁÅ×À̳ÊÀÇ »ç¿ëÀÚ Á¤ÀÇ metadata¸¦ »èÁ¦ÇÑ´Ù. ÁöÁ¤µÈ ƯÁ¤ key¿¡ ´ëÇÑ metadata¸¦ »èÁ¦ÇÑ´Ù.

Example: ... authentication code excluded (see previous examples) ...

$conn = new CF_Connection($auth);

$test_container = $conn->get_container("test");

Config specific container

$test_container->delete_container_user_metadata($key);

Parameters
key$key»ç¿ëÀÚ metadata¿¡ ´ëÇÑ key
Returns
boolean True if successfully removed

Definition at line 1596 of file cloudfiles-kt.php.

delete_object (   $obj,
  $container = NULL 
)

Delete a remote storage Object

Given an Object instance or name, permanently remove the remote Object and all associated metadata.

Example: ... authentication code excluded (see previous examples) ...

$conn = new CF_Connection($auth);

$images = $conn->get_container("my photos");

Delete specific object

$images->delete_object("disco_dancing.jpg");

Parameters
obj$objname or instance of Object to delete
obj$containername or instance of Container in which the object resides (optional)
Returns
boolean True if successfully removed
Exceptions
SyntaxExceptioninvalid Object name
NoSuchObjectExceptionremote Object does not exist
InvalidResponseExceptionunexpected response

Definition at line 1324 of file cloudfiles-kt.php.

disableContainerLogging ( )

ÇØ´ç ÄÁÅ×À̳ʿ¡ ´ëÇÑ ·Î±ë ¼³Á¤À» ÇØÁ¦ÇÑ´Ù.

Example: ... authentication code excluded (see previous examples) ...

$conn = new CF_Connection($auth);

$test_container = $conn->get_container("test");

Config specific container

$test_container->disableContainerLogging();

Returns
boolean True if successfully removed

Definition at line 1485 of file cloudfiles-kt.php.

disableStaticWebsiteConfig ( )

ÇØ´ç ÄÁÅ×À̳ÊÀÇ static website ¼³Á¤À» Ãë¼ÒÇÑ´Ù.

Example: ... authentication code excluded (see previous examples) ...

$conn = new CF_Connection($auth);

$test_container = $conn->get_container("test");

Config specific container

$test_container->disableStaticWebsiteConfig();

Returns
boolean True if successfully removed

Definition at line 1431 of file cloudfiles-kt.php.

enableContainerLogging ( )

ÇØ´ç ÄÁÅ×À̳ʸ¦ ´ëÇÑ Á¢±ÙÁ¤º¸¸¦ ·Î±×ÆÄÀÏ·Î ÀúÀåÇÑ´Ù. ¼­ºñ½º ÀÌ¿ë¹æ¹ýÀº °¡À̵带 ÂüÁ¶ÇÑ´Ù. https://ucloudbiz.olleh.com/manual/ucloud_storage_log_save_service_user_guide.pdf

Example: ... authentication code excluded (see previous examples) ...

$conn = new CF_Connection($auth);

$test_container = $conn->get_container("test");

Config specific container

$test_container->enableContainerLogging();

Returns
boolean True if successfully removed

Definition at line 1461 of file cloudfiles-kt.php.

enableStaticWebsiteConfig (   $index = NULL,
  $error = NULL,
  $listings = NULL,
  $css = NULL 
)

ÇØ´ç ÄÁÅ×À̳ʸ¦ static website·Î ¼³Á¤ÇÑ´Ù. ¼­ºñ½º ÀÌ¿ë¹æ¹ýÀº °¡À̵带 ÂüÁ¶ÇÑ´Ù. https://ucloudbiz.olleh.com/manual/ucloud_storage_Static_Web_service_user_guide.pdf

Example: ... authentication code excluded (see previous examples) ...

$conn = new CF_Connection($auth);

$test_container = $conn->get_container("test");

Config specific container

$test_container->enableStaticWebsiteConfig("index.html","error.hmtl", "true", "test.css");

Parameters
index$indexstatic website¿¡ ´ëÇÑ index ÆÄÀÏ ÁöÁ¤(ÀÓÀÇÁöÁ¤ °¡´É)
error$errorstatic website¿¡ ´ëÇÑ ¿¡·¯ ÆÄÀÏ suffix(ÀÓÀÇÁöÁ¤ °¡´É)
listing$listingindex ÆÄÀÏ ¹Ì ¼³Á¤½Ã object¸¦ ¸®½ºÆ®·Î º¸¿© ÁÙ °ÍÀÎÁö ¼³Á¤
css$cssstyle sheet ÆÄÀÏ ÁöÁ¤
Returns
boolean True if successfully removed

Definition at line 1395 of file cloudfiles-kt.php.

get_object (   $obj_name = NULL)

Return an Object instance for the remote storage Object

Given a name, return a Object instance representing the remote storage object.

Example: ... authentication code excluded (see previous examples) ...

$conn = new CF_Connection($auth);

$public_container = $conn->get_container("public");

This call only fetches header information and not the content of the storage object. Use the Object's read() or stream() methods to obtain the object's data.

$pic = $public_container->get_object("baby.jpg");

Parameters
string$obj_namename of storage Object
Returns
obj CF_Object instance

Definition at line 941 of file cloudfiles-kt.php.

get_objects (   $limit = 0,
  $marker = NULL,
  $prefix = NULL,
  $path = NULL,
  $delimiter = NULL 
)

Return an array of Objects

Return an array of Object instances in this Container.

Example: ... authentication code excluded (see previous examples) ...

$images = $conn->get_container("my photos");

Grab the list of all storage objects

$all_objects = $images->get_objects();

Grab subsets of all storage objects

$first_ten = $images->get_objects(10);

Note the use of the previous result's last object name being used as the 'marker' parameter to fetch the next 10 objects

$next_ten = $images->list_objects(10, $first_ten[count($first_ten)-1]);

Grab images starting with "birthday_party" and default limit/marker to match all photos with that prefix

$prefixed = $images->get_objects(0, NULL, "birthday");

Assuming you have created the appropriate directory marker Objects, you can traverse your pseudo-hierarchical containers with the "path" argument.

$animals = $images->get_objects(0,NULL,NULL,"pictures/animals"); $dogs = $images->get_objects(0,NULL,NULL,"pictures/animals/dogs");

Parameters
int$limitoptional only return $limit names
int$markeroptional subset of names starting at $marker
string$prefixoptional Objects whose names begin with $prefix
string$pathoptional only return results under "pathname"
Returns
array array of strings
Exceptions
InvalidResponseExceptionunexpected response

Definition at line 1046 of file cloudfiles-kt.php.

list_objects (   $limit = 0,
  $marker = NULL,
  $prefix = NULL,
  $path = NULL 
)

Return a list of Objects

Return an array of strings listing the Object names in this Container.

Example: ... authentication code excluded (see previous examples) ...

$images = $conn->get_container("my photos");

Grab the list of all storage objects

$all_objects = $images->list_objects();

Grab subsets of all storage objects

$first_ten = $images->list_objects(10);

Note the use of the previous result's last object name being used as the 'marker' parameter to fetch the next 10 objects

$next_ten = $images->list_objects(10, $first_ten[count($first_ten)-1]);

Grab images starting with "birthday_party" and default limit/marker to match all photos with that prefix

$prefixed = $images->list_objects(0, NULL, "birthday");

Assuming you have created the appropriate directory marker Objects, you can traverse your pseudo-hierarchical containers with the "path" argument.

$animals = $images->list_objects(0,NULL,NULL,"pictures/animals"); $dogs = $images->list_objects(0,NULL,NULL,"pictures/animals/dogs");

Parameters
int$limitoptional only return $limit names
int$markeroptional subset of names starting at $marker
string$prefixoptional Objects whose names begin with $prefix
string$pathoptional only return results under "pathname"
Returns
array array of strings
Exceptions
InvalidResponseExceptionunexpected response

Definition at line 990 of file cloudfiles-kt.php.

make_private ( )

ÇØ´ç ÄÁÅ×À̳ʸ¦ °ø°³ ¼³Á¤¸¦ Ãë¼ÒÇÑ´Ù.

Example: ... authentication code excluded (see previous examples) ...

$conn = new CF_Connection($auth);

$test_container = $conn->get_container("test");

Config specific container

$test_container->make_private();

Returns
boolean True if successfully removed

Definition at line 1534 of file cloudfiles-kt.php.

make_public ( )

ÇØ´ç ÄÁÅ×À̳ʸ¦ °ø°³ ¼³Á¤ÇÑ´Ù. °ø°³ ¼³Á¤ ÇÒ °æ¿ì, ÀÎÁõ ¾øÀÌ ÄÁÅ×À̳ʿ¡ ÀÓÀÇÀÇ Á¢±Ù(ÀÐ±â ¹× Á¶È¸)ÀÌ °¡´ÉÇÏ´Ù. ¾²±â´Â ºÒ°¡´ÉÇÏ´Ù.

Example: ... authentication code excluded (see previous examples) ...

$conn = new CF_Connection($auth);

$test_container = $conn->get_container("test");

Config specific container

$test_container->make_public();

Returns
boolean True if successfully removed

Definition at line 1510 of file cloudfiles-kt.php.

move_object_from (   $obj,
  $container_source,
  $dest_obj_name = NULL,
  $metadata = NULL,
  $headers = NULL 
)

Move a remote storage Object from a source Container

Given an Object instance or name and a source Container instance or name, move copies the remote Object and all associated metadata and deletes the source Object afterwards

Example: ... authentication code excluded (see previous examples) ...

$conn = new CF_Connection($auth);

$images = $conn->get_container("my photos");

Move specific object

$images->move_object_from("disco_dancing.jpg","container_target");

Parameters
obj$objname or instance of Object to move
obj$container_sourcename or instance of target Container
string$dest_obj_namename of target object (optional - uses source name if omitted)
array$metadatametadata array for new object (optional)
array$headersheader fields array for the new object (optional)
Returns
boolean true if successfully moved
Exceptions
SyntaxExceptioninvalid Object/Container name
NoSuchObjectExceptionremote Object does not exist
InvalidResponseExceptionunexpected response

Definition at line 1287 of file cloudfiles-kt.php.

move_object_to (   $obj,
  $container_target,
  $dest_obj_name = NULL,
  $metadata = NULL,
  $headers = NULL 
)

Move a remote storage Object to a target Container

Given an Object instance or name and a target Container instance or name, move copies the remote Object and all associated metadata and deletes the source Object afterwards

Example: ... authentication code excluded (see previous examples) ...

$conn = new CF_Connection($auth);

$images = $conn->get_container("my photos");

Move specific object

$images->move_object_to("disco_dancing.jpg","container_target");

Parameters
obj$objname or instance of Object to move
obj$container_targetname or instance of target Container
string$dest_obj_namename of target object (optional - uses source name if omitted)
array$metadatametadata array for new object (optional)
array$headersheader fields array for the new object (optional)
Returns
boolean true if successfully moved
Exceptions
SyntaxExceptioninvalid Object/Container name
NoSuchObjectExceptionremote Object does not exist
InvalidResponseExceptionunexpected response

Definition at line 1247 of file cloudfiles-kt.php.

Field Documentation

$bytes_used

Definition at line 841 of file cloudfiles-kt.php.

$cfs_auth

Definition at line 837 of file cloudfiles-kt.php.

$cfs_http

Definition at line 838 of file cloudfiles-kt.php.

$metadata

Definition at line 842 of file cloudfiles-kt.php.

$name

Definition at line 839 of file cloudfiles-kt.php.

$object_count

Definition at line 840 of file cloudfiles-kt.php.


The documentation for this class was generated from the following file: