Class: CF_Container
Source Location: /cloudfiles.php
Class Details
Class Variables
Class Methods
constructor __construct [line 946]
CF_Container __construct(
&$cfs_auth,
&$cfs_http, string
$name, [int
$count = 0], [int
$bytes = 0], [
$docdn = True], obj
$cfs_auth, obj
$cfs_http)
|
|
Class constructor Constructor for Container
Tags:
Parameters:
method acl_referrer [line 1167]
boolean acl_referrer(
[
$cdn_acl_referrer = ""])
|
|
Enable ACL restriction by referer for this container. Example: # ... authentication code excluded (see previous examples) ...
#
$public_container = $conn->get_container("public");
# Enable Referrer
$public_container->acl_referrer("http://www.example.com/gallery.php");
Tags:
Parameters:
method acl_user_agent [line 1127]
boolean acl_user_agent(
[
$cdn_acl_user_agent = ""])
|
|
Enable ACL restriction by User Agent for this container. Example: # ... authentication code excluded (see previous examples) ...
#
$public_container = $conn->get_container("public");
# Enable ACL by Referrer
Tags:
Parameters:
method copy_object_from [line 1601]
boolean copy_object_from(
obj
$obj, obj
$container_source, [string
$dest_obj_name = NULL], [array
$metadata = NULL], [array
$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) ...
#
$images = $conn->get_container("my photos");
# Copy specific object
#
Tags:
Parameters:
method copy_object_to [line 1527]
boolean copy_object_to(
obj
$obj, obj
$container_target, [string
$dest_obj_name = NULL], [array
$metadata = NULL], [array
$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) ...
#
$images = $conn->get_container("my photos");
# Copy specific object
#
Tags:
Parameters:
method create_object [line 1337]
obj create_object(
[string
$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) ...
#
$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.
#
Tags:
Parameters:
method create_paths [line 1813]
void create_paths(
$path_name)
|
|
Helper function to create "path" elements for a given Object name Given an Object whos 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.
Parameters:
method delete_object [line 1753]
boolean delete_object(
obj
$obj, [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) ...
#
$images = $conn->get_container("my photos");
# Delete specific object
#
Tags:
Parameters:
method get_object [line 1366]
obj get_object(
[string
$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) ...
#
$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.
#
Tags:
Parameters:
method get_objects [line 1474]
array get_objects(
[int
$limit = 0], [int
$marker = NULL], [string
$prefix = NULL], [string
$path = 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
#
# Grab subsets of all storage objects
#
# Note the use of the previous result's last object name being
# used as the 'marker' parameter to fetch the next 10 objects
#
# Grab images starting with "birthday_party" and default limit/marker
# to match all photos with that prefix
#
# 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");
Tags:
Parameters:
method is_public [line 1309]
Check if this Container is being publicly served via CDN Use this method to determine if the Container's content is currently available through the CDN. Example: # ... authentication code excluded (see previous examples) ...
#
$public_container = $conn->get_container("public");
# Display CDN accessability
#
$public_container->is_public() ? print "Yes" : print "No";
Tags:
method list_objects [line 1415]
array list_objects(
[int
$limit = 0], [int
$marker = NULL], [string
$prefix = NULL], [string
$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
#
# Grab subsets of all storage objects
#
# Note the use of the previous result's last object name being
# used as the 'marker' parameter to fetch the next 10 objects
#
# Grab images starting with "birthday_party" and default limit/marker
# to match all photos with that prefix
#
# 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");
Tags:
Parameters:
method log_retention [line 1213]
boolean log_retention(
[
$cdn_log_retention = False])
|
|
Enable log retention for this CDN container. Enable CDN log retention on the container. If enabled logs will be periodically (at unpredictable intervals) compressed and uploaded to a ".CDN_ACCESS_LOGS" container in the form of "container_name.YYYYMMDDHH-XXXX.gz". Requires CDN be enabled on the account. Example: # ... authentication code excluded (see previous examples) ...
#
$public_container = $conn->get_container("public");
# Enable logs retention.
Tags:
Parameters:
method make_private [line 1263]
Disable the CDN sharing for this container Use this method to disallow distribution into the CDN of this Container's content. NOTE: Any content already cached in the CDN will continue to be served from its cache until the TTL expiration transpires. The default TTL is typically one day, so "privatizing" the Container will take up to 24 hours before the content is purged from the CDN cache. Example: # ... authentication code excluded (see previous examples) ...
#
$public_container = $conn->get_container("public");
# Disable CDN accessability
# ... still cached up to a month based on previous example
#
Tags:
method make_public [line 1032]
string make_public(
[int
$ttl = 86400])
|
|
Enable Container content to be served via CDN or modify CDN attributes Either enable this Container's content to be served via CDN or adjust its CDN attributes. This Container will always return the same CDN-enabled URI each time it is toggled public/private/public. Example: # ... authentication code excluded (see previous examples) ...
#
$public_container = $conn->create_container("public");
# CDN-enable the container and set it's TTL for a month
#
$public_container->make_public(86400/ 2); # 12 hours (86400 seconds/day)
Tags:
Parameters:
method move_object_from [line 1716]
boolean move_object_from(
obj
$obj, obj
$container_source, [string
$dest_obj_name = NULL], [array
$metadata = NULL], [array
$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) ...
#
$images = $conn->get_container("my photos");
# Move specific object
#
Tags:
Parameters:
method move_object_to [line 1676]
boolean move_object_to(
obj
$obj, obj
$container_target, [string
$dest_obj_name = NULL], [array
$metadata = NULL], [array
$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) ...
#
$images = $conn->get_container("my photos");
# Move specific object
#
Tags:
Parameters:
method purge_from_cdn [line 1093]
boolean purge_from_cdn(
[
$email = null])
|
|
Purge Containers objects from CDN Cache. Example:
Tags:
Parameters:
method __toString [line 982]
String representation of Container Pretty print the Container instance.
Tags:
|
|