Edit File by line
/home/barbar84/www/wp-conte.../plugins/updraftp.../includes/cloudfil...
File: cloudfiles.php
}
[500] Fix | Delete
#if ($status == 401 && $this->_re_auth()) {
[501] Fix | Delete
# return $this->create_container($container_name);
[502] Fix | Delete
#}
[503] Fix | Delete
if ($return_code != 201 && $return_code != 202) {
[504] Fix | Delete
throw new InvalidResponseException(
[505] Fix | Delete
"Invalid response (".$return_code."): "
[506] Fix | Delete
. $this->cfs_http->get_error());
[507] Fix | Delete
}
[508] Fix | Delete
return new UpdraftPlus_CF_Container($this->cfs_auth, $this->cfs_http, $container_name);
[509] Fix | Delete
}
[510] Fix | Delete
[511] Fix | Delete
/**
[512] Fix | Delete
* Delete a Container
[513] Fix | Delete
*
[514] Fix | Delete
* Given either a Container instance or name, remove the remote Container.
[515] Fix | Delete
* The Container must be empty prior to removing it.
[516] Fix | Delete
*
[517] Fix | Delete
* Example:
[518] Fix | Delete
* <code>
[519] Fix | Delete
* # ... authentication code excluded (see previous examples) ...
[520] Fix | Delete
* #
[521] Fix | Delete
* $conn = new CF_Connection($auth);
[522] Fix | Delete
*
[523] Fix | Delete
* $conn->delete_container("my photos");
[524] Fix | Delete
* </code>
[525] Fix | Delete
*
[526] Fix | Delete
* @param string|obj $container container name or instance
[527] Fix | Delete
* @return boolean <kbd>True</kbd> if successfully deleted
[528] Fix | Delete
* @throws SyntaxException missing proper argument
[529] Fix | Delete
* @throws InvalidResponseException invalid response
[530] Fix | Delete
* @throws NonEmptyContainerException container not empty
[531] Fix | Delete
* @throws NoSuchContainerException remote container does not exist
[532] Fix | Delete
*/
[533] Fix | Delete
function delete_container($container=NULL)
[534] Fix | Delete
{
[535] Fix | Delete
$container_name = NULL;
[536] Fix | Delete
[537] Fix | Delete
if (is_object($container)) {
[538] Fix | Delete
if (get_class($container) == "UpdraftPlus_CF_Container") {
[539] Fix | Delete
$container_name = $container->name;
[540] Fix | Delete
}
[541] Fix | Delete
}
[542] Fix | Delete
if (is_string($container)) {
[543] Fix | Delete
$container_name = $container;
[544] Fix | Delete
}
[545] Fix | Delete
[546] Fix | Delete
if ($container_name != "0" and !isset($container_name))
[547] Fix | Delete
throw new SyntaxException("Must specify container object or name.");
[548] Fix | Delete
[549] Fix | Delete
$return_code = $this->cfs_http->delete_container($container_name);
[550] Fix | Delete
[551] Fix | Delete
if (!$return_code) {
[552] Fix | Delete
throw new InvalidResponseException("Failed to obtain http response");
[553] Fix | Delete
}
[554] Fix | Delete
#if ($status == 401 && $this->_re_auth()) {
[555] Fix | Delete
# return $this->delete_container($container);
[556] Fix | Delete
#}
[557] Fix | Delete
if ($return_code == 409) {
[558] Fix | Delete
throw new NonEmptyContainerException(
[559] Fix | Delete
"Container must be empty prior to removing it.");
[560] Fix | Delete
}
[561] Fix | Delete
if ($return_code == 404) {
[562] Fix | Delete
throw new NoSuchContainerException(
[563] Fix | Delete
"Specified container did not exist to delete.");
[564] Fix | Delete
}
[565] Fix | Delete
if ($return_code != 204) {
[566] Fix | Delete
throw new InvalidResponseException(
[567] Fix | Delete
"Invalid response (".$return_code."): "
[568] Fix | Delete
. $this->cfs_http->get_error());
[569] Fix | Delete
}
[570] Fix | Delete
return True;
[571] Fix | Delete
}
[572] Fix | Delete
[573] Fix | Delete
/**
[574] Fix | Delete
* Return a Container instance
[575] Fix | Delete
*
[576] Fix | Delete
* For the given name, return a Container instance if the remote Container
[577] Fix | Delete
* exists, otherwise throw a Not Found exception.
[578] Fix | Delete
*
[579] Fix | Delete
* Example:
[580] Fix | Delete
* <code>
[581] Fix | Delete
* # ... authentication code excluded (see previous examples) ...
[582] Fix | Delete
* #
[583] Fix | Delete
* $conn = new CF_Connection($auth);
[584] Fix | Delete
*
[585] Fix | Delete
* $images = $conn->get_container("my photos");
[586] Fix | Delete
* print "Number of Objects: " . $images->count . "\n";
[587] Fix | Delete
* print "Bytes stored in container: " . $images->bytes . "\n";
[588] Fix | Delete
* </code>
[589] Fix | Delete
*
[590] Fix | Delete
* @param string $container_name name of the remote Container
[591] Fix | Delete
* @return container CF_Container instance
[592] Fix | Delete
* @throws NoSuchContainerException thrown if no remote Container
[593] Fix | Delete
* @throws InvalidResponseException unexpected response
[594] Fix | Delete
*/
[595] Fix | Delete
function get_container($container_name=NULL)
[596] Fix | Delete
{
[597] Fix | Delete
list($status, $reason, $count, $bytes) =
[598] Fix | Delete
$this->cfs_http->head_container($container_name);
[599] Fix | Delete
#if ($status == 401 && $this->_re_auth()) {
[600] Fix | Delete
# return $this->get_container($container_name);
[601] Fix | Delete
#}
[602] Fix | Delete
if ($status == 404) {
[603] Fix | Delete
throw new NoSuchContainerException("Container not found.");
[604] Fix | Delete
}
[605] Fix | Delete
if ($status < 200 || $status > 299) {
[606] Fix | Delete
throw new InvalidResponseException(
[607] Fix | Delete
"Invalid response: ".$this->cfs_http->get_error());
[608] Fix | Delete
}
[609] Fix | Delete
return new UpdraftPlus_3CF_Container($this->cfs_auth, $this->cfs_http,
[610] Fix | Delete
$container_name, $count, $bytes);
[611] Fix | Delete
}
[612] Fix | Delete
[613] Fix | Delete
/**
[614] Fix | Delete
* Return array of Container instances
[615] Fix | Delete
*
[616] Fix | Delete
* Return an array of CF_Container instances on the account. The instances
[617] Fix | Delete
* will be fully populated with Container attributes (bytes stored and
[618] Fix | Delete
* Object count)
[619] Fix | Delete
*
[620] Fix | Delete
* Example:
[621] Fix | Delete
* <code>
[622] Fix | Delete
* # ... authentication code excluded (see previous examples) ...
[623] Fix | Delete
* #
[624] Fix | Delete
* $conn = new CF_Connection($auth);
[625] Fix | Delete
*
[626] Fix | Delete
* $clist = $conn->get_containers();
[627] Fix | Delete
* foreach ($clist as $cont) {
[628] Fix | Delete
* print "Container name: " . $cont->name . "\n";
[629] Fix | Delete
* print "Number of Objects: " . $cont->count . "\n";
[630] Fix | Delete
* print "Bytes stored in container: " . $cont->bytes . "\n";
[631] Fix | Delete
* }
[632] Fix | Delete
* </code>
[633] Fix | Delete
*
[634] Fix | Delete
* @return array An array of CF_Container instances
[635] Fix | Delete
* @throws InvalidResponseException unexpected response
[636] Fix | Delete
*/
[637] Fix | Delete
function get_containers($limit=0, $marker=NULL)
[638] Fix | Delete
{
[639] Fix | Delete
list($status, $reason, $container_info) =
[640] Fix | Delete
$this->cfs_http->list_containers_info($limit, $marker);
[641] Fix | Delete
#if ($status == 401 && $this->_re_auth()) {
[642] Fix | Delete
# return $this->get_containers();
[643] Fix | Delete
#}
[644] Fix | Delete
if ($status < 200 || $status > 299) {
[645] Fix | Delete
throw new InvalidResponseException(
[646] Fix | Delete
"Invalid response: ".$this->cfs_http->get_error());
[647] Fix | Delete
}
[648] Fix | Delete
$containers = array();
[649] Fix | Delete
foreach ($container_info as $name => $info) {
[650] Fix | Delete
$containers[] = new UpdraftPlus_CF_Container($this->cfs_auth, $this->cfs_http,
[651] Fix | Delete
$info['name'], $info["count"], $info["bytes"], False);
[652] Fix | Delete
}
[653] Fix | Delete
return $containers;
[654] Fix | Delete
}
[655] Fix | Delete
[656] Fix | Delete
/**
[657] Fix | Delete
* Return list of remote Containers
[658] Fix | Delete
*
[659] Fix | Delete
* Return an array of strings containing the names of all remote Containers.
[660] Fix | Delete
*
[661] Fix | Delete
* Example:
[662] Fix | Delete
* <code>
[663] Fix | Delete
* # ... authentication code excluded (see previous examples) ...
[664] Fix | Delete
* #
[665] Fix | Delete
* $conn = new CF_Connection($auth);
[666] Fix | Delete
*
[667] Fix | Delete
* $container_list = $conn->list_containers();
[668] Fix | Delete
* print_r($container_list);
[669] Fix | Delete
* Array
[670] Fix | Delete
* (
[671] Fix | Delete
* [0] => "my photos",
[672] Fix | Delete
* [1] => "my docs"
[673] Fix | Delete
* )
[674] Fix | Delete
* </code>
[675] Fix | Delete
*
[676] Fix | Delete
* @param integer $limit restrict results to $limit Containers
[677] Fix | Delete
* @param string $marker return results greater than $marker
[678] Fix | Delete
* @return array list of remote Containers
[679] Fix | Delete
* @throws InvalidResponseException unexpected response
[680] Fix | Delete
*/
[681] Fix | Delete
function list_containers($limit=0, $marker=NULL)
[682] Fix | Delete
{
[683] Fix | Delete
list($status, $reason, $containers) =
[684] Fix | Delete
$this->cfs_http->list_containers($limit, $marker);
[685] Fix | Delete
#if ($status == 401 && $this->_re_auth()) {
[686] Fix | Delete
# return $this->list_containers($limit, $marker);
[687] Fix | Delete
#}
[688] Fix | Delete
if ($status < 200 || $status > 299) {
[689] Fix | Delete
throw new InvalidResponseException(
[690] Fix | Delete
"Invalid response (".$status."): ".$this->cfs_http->get_error());
[691] Fix | Delete
}
[692] Fix | Delete
return $containers;
[693] Fix | Delete
}
[694] Fix | Delete
[695] Fix | Delete
/**
[696] Fix | Delete
* Return array of information about remote Containers
[697] Fix | Delete
*
[698] Fix | Delete
* Return a nested array structure of Container info.
[699] Fix | Delete
*
[700] Fix | Delete
* Example:
[701] Fix | Delete
* <code>
[702] Fix | Delete
* # ... authentication code excluded (see previous examples) ...
[703] Fix | Delete
* #
[704] Fix | Delete
*
[705] Fix | Delete
* $container_info = $conn->list_containers_info();
[706] Fix | Delete
* print_r($container_info);
[707] Fix | Delete
* Array
[708] Fix | Delete
* (
[709] Fix | Delete
* ["my photos"] =>
[710] Fix | Delete
* Array
[711] Fix | Delete
* (
[712] Fix | Delete
* ["bytes"] => 78,
[713] Fix | Delete
* ["count"] => 2
[714] Fix | Delete
* )
[715] Fix | Delete
* ["docs"] =>
[716] Fix | Delete
* Array
[717] Fix | Delete
* (
[718] Fix | Delete
* ["bytes"] => 37323,
[719] Fix | Delete
* ["count"] => 12
[720] Fix | Delete
* )
[721] Fix | Delete
* )
[722] Fix | Delete
* </code>
[723] Fix | Delete
*
[724] Fix | Delete
* @param integer $limit restrict results to $limit Containers
[725] Fix | Delete
* @param string $marker return results greater than $marker
[726] Fix | Delete
* @return array nested array structure of Container info
[727] Fix | Delete
* @throws InvalidResponseException unexpected response
[728] Fix | Delete
*/
[729] Fix | Delete
function list_containers_info($limit=0, $marker=NULL)
[730] Fix | Delete
{
[731] Fix | Delete
list($status, $reason, $container_info) =
[732] Fix | Delete
$this->cfs_http->list_containers_info($limit, $marker);
[733] Fix | Delete
#if ($status == 401 && $this->_re_auth()) {
[734] Fix | Delete
# return $this->list_containers_info($limit, $marker);
[735] Fix | Delete
#}
[736] Fix | Delete
if ($status < 200 || $status > 299) {
[737] Fix | Delete
throw new InvalidResponseException(
[738] Fix | Delete
"Invalid response (".$status."): ".$this->cfs_http->get_error());
[739] Fix | Delete
}
[740] Fix | Delete
return $container_info;
[741] Fix | Delete
}
[742] Fix | Delete
[743] Fix | Delete
/**
[744] Fix | Delete
* Return list of Containers that have been published to the CDN.
[745] Fix | Delete
*
[746] Fix | Delete
* Return an array of strings containing the names of published Containers.
[747] Fix | Delete
* Note that this function returns the list of any Container that has
[748] Fix | Delete
* ever been CDN-enabled regardless of it's existence in the storage
[749] Fix | Delete
* system.
[750] Fix | Delete
*
[751] Fix | Delete
* Example:
[752] Fix | Delete
* <code>
[753] Fix | Delete
* # ... authentication code excluded (see previous examples) ...
[754] Fix | Delete
* #
[755] Fix | Delete
* $conn = new CF_Connection($auth);
[756] Fix | Delete
*
[757] Fix | Delete
* $public_containers = $conn->list_public_containers();
[758] Fix | Delete
* print_r($public_containers);
[759] Fix | Delete
* Array
[760] Fix | Delete
* (
[761] Fix | Delete
* [0] => "images",
[762] Fix | Delete
* [1] => "css",
[763] Fix | Delete
* [2] => "javascript"
[764] Fix | Delete
* )
[765] Fix | Delete
* </code>
[766] Fix | Delete
*
[767] Fix | Delete
* @param bool $enabled_only Will list all containers ever CDN enabled if * set to false or only currently enabled CDN containers if set to true. * Defaults to false.
[768] Fix | Delete
* @return array list of published Container names
[769] Fix | Delete
* @throws InvalidResponseException unexpected response
[770] Fix | Delete
*/
[771] Fix | Delete
function list_public_containers($enabled_only=False)
[772] Fix | Delete
{
[773] Fix | Delete
list($status, $reason, $containers) =
[774] Fix | Delete
$this->cfs_http->list_cdn_containers($enabled_only);
[775] Fix | Delete
#if ($status == 401 && $this->_re_auth()) {
[776] Fix | Delete
# return $this->list_public_containers();
[777] Fix | Delete
#}
[778] Fix | Delete
if ($status < 200 || $status > 299) {
[779] Fix | Delete
throw new InvalidResponseException(
[780] Fix | Delete
"Invalid response (".$status."): ".$this->cfs_http->get_error());
[781] Fix | Delete
}
[782] Fix | Delete
return $containers;
[783] Fix | Delete
}
[784] Fix | Delete
[785] Fix | Delete
/**
[786] Fix | Delete
* Set a user-supplied callback function to report download progress
[787] Fix | Delete
*
[788] Fix | Delete
* The callback function is used to report incremental progress of a data
[789] Fix | Delete
* download functions (e.g. $container->list_objects(), $obj->read(), etc).
[790] Fix | Delete
* The specified function will be periodically called with the number of
[791] Fix | Delete
* bytes transferred until the entire download is complete. This callback
[792] Fix | Delete
* function can be useful for implementing "progress bars" for large
[793] Fix | Delete
* downloads.
[794] Fix | Delete
*
[795] Fix | Delete
* The specified callback function should take a single integer parameter.
[796] Fix | Delete
*
[797] Fix | Delete
* <code>
[798] Fix | Delete
* function read_callback($bytes_transferred) {
[799] Fix | Delete
* print ">> downloaded " . $bytes_transferred . " bytes.\n";
[800] Fix | Delete
* # ... do other things ...
[801] Fix | Delete
* return;
[802] Fix | Delete
* }
[803] Fix | Delete
*
[804] Fix | Delete
* $conn = new CF_Connection($auth_obj);
[805] Fix | Delete
* $conn->set_read_progress_function("read_callback");
[806] Fix | Delete
* print_r($conn->list_containers());
[807] Fix | Delete
*
[808] Fix | Delete
* # output would look like this:
[809] Fix | Delete
* #
[810] Fix | Delete
* >> downloaded 10 bytes.
[811] Fix | Delete
* >> downloaded 11 bytes.
[812] Fix | Delete
* Array
[813] Fix | Delete
* (
[814] Fix | Delete
* [0] => fuzzy.txt
[815] Fix | Delete
* [1] => space name
[816] Fix | Delete
* )
[817] Fix | Delete
* </code>
[818] Fix | Delete
*
[819] Fix | Delete
* @param string $func_name the name of the user callback function
[820] Fix | Delete
*/
[821] Fix | Delete
function set_read_progress_function($func_name)
[822] Fix | Delete
{
[823] Fix | Delete
$this->cfs_http->setReadProgressFunc($func_name);
[824] Fix | Delete
}
[825] Fix | Delete
[826] Fix | Delete
/**
[827] Fix | Delete
* Set a user-supplied callback function to report upload progress
[828] Fix | Delete
*
[829] Fix | Delete
* The callback function is used to report incremental progress of a data
[830] Fix | Delete
* upload functions (e.g. $obj->write() call). The specified function will
[831] Fix | Delete
* be periodically called with the number of bytes transferred until the
[832] Fix | Delete
* entire upload is complete. This callback function can be useful
[833] Fix | Delete
* for implementing "progress bars" for large uploads/downloads.
[834] Fix | Delete
*
[835] Fix | Delete
* The specified callback function should take a single integer parameter.
[836] Fix | Delete
*
[837] Fix | Delete
* <code>
[838] Fix | Delete
* function write_callback($bytes_transferred) {
[839] Fix | Delete
* print ">> uploaded " . $bytes_transferred . " bytes.\n";
[840] Fix | Delete
* # ... do other things ...
[841] Fix | Delete
* return;
[842] Fix | Delete
* }
[843] Fix | Delete
*
[844] Fix | Delete
* $conn = new CF_Connection($auth_obj);
[845] Fix | Delete
* $conn->set_write_progress_function("write_callback");
[846] Fix | Delete
* $container = $conn->create_container("stuff");
[847] Fix | Delete
* $obj = $container->create_object("foo");
[848] Fix | Delete
* $obj->write("The callback function will be called during upload.");
[849] Fix | Delete
*
[850] Fix | Delete
* # output would look like this:
[851] Fix | Delete
* # >> uploaded 51 bytes.
[852] Fix | Delete
* #
[853] Fix | Delete
* </code>
[854] Fix | Delete
*
[855] Fix | Delete
* @param string $func_name the name of the user callback function
[856] Fix | Delete
*/
[857] Fix | Delete
function set_write_progress_function($func_name)
[858] Fix | Delete
{
[859] Fix | Delete
$this->cfs_http->setWriteProgressFunc($func_name);
[860] Fix | Delete
}
[861] Fix | Delete
[862] Fix | Delete
/**
[863] Fix | Delete
* Use the Certificate Authority bundle included with this API
[864] Fix | Delete
*
[865] Fix | Delete
* Most versions of PHP with cURL support include an outdated Certificate
[866] Fix | Delete
* Authority (CA) bundle (the file that lists all valid certificate
[867] Fix | Delete
* signing authorities). The SSL certificates used by the Cloud Files
[868] Fix | Delete
* storage system are perfectly valid but have been created/signed by
[869] Fix | Delete
* a CA not listed in these outdated cURL distributions.
[870] Fix | Delete
*
[871] Fix | Delete
* As a work-around, we've included an updated CA bundle obtained
[872] Fix | Delete
* directly from cURL's web site (http://curl.haxx.se). You can direct
[873] Fix | Delete
* the API to use this CA bundle by calling this method prior to making
[874] Fix | Delete
* any remote calls. The best place to use this method is right after
[875] Fix | Delete
* the CF_Authentication instance has been instantiated.
[876] Fix | Delete
*
[877] Fix | Delete
* You can specify your own CA bundle by passing in the full pathname
[878] Fix | Delete
* to the bundle. You can use the included CA bundle by leaving the
[879] Fix | Delete
* argument blank.
[880] Fix | Delete
*
[881] Fix | Delete
* @param string $path Specify path to CA bundle (default to included)
[882] Fix | Delete
*/
[883] Fix | Delete
function ssl_use_cabundle($path=NULL)
[884] Fix | Delete
{
[885] Fix | Delete
$this->cfs_http->ssl_use_cabundle($path);
[886] Fix | Delete
}
[887] Fix | Delete
[888] Fix | Delete
#private function _re_auth()
[889] Fix | Delete
#{
[890] Fix | Delete
# $new_auth = new CF_Authentication(
[891] Fix | Delete
# $this->cfs_auth->username,
[892] Fix | Delete
# $this->cfs_auth->api_key,
[893] Fix | Delete
# $this->cfs_auth->auth_host,
[894] Fix | Delete
# $this->cfs_auth->account);
[895] Fix | Delete
# $new_auth->authenticate();
[896] Fix | Delete
# $this->cfs_auth = $new_auth;
[897] Fix | Delete
# $this->cfs_http->setCFAuth($this->cfs_auth);
[898] Fix | Delete
# return True;
[899] Fix | Delete
#}
[900] Fix | Delete
}
[901] Fix | Delete
[902] Fix | Delete
/**
[903] Fix | Delete
* Container operations
[904] Fix | Delete
*
[905] Fix | Delete
* Containers are storage compartments where you put your data (objects).
[906] Fix | Delete
* A container is similar to a directory or folder on a conventional filesystem
[907] Fix | Delete
* with the exception that they exist in a flat namespace, you can not create
[908] Fix | Delete
* containers inside of containers.
[909] Fix | Delete
*
[910] Fix | Delete
* You also have the option of marking a Container as "public" so that the
[911] Fix | Delete
* Objects stored in the Container are publicly available via the CDN.
[912] Fix | Delete
*
[913] Fix | Delete
* @package php-cloudfiles
[914] Fix | Delete
*/
[915] Fix | Delete
class UpdraftPlus_CF_Container
[916] Fix | Delete
{
[917] Fix | Delete
public $cfs_auth;
[918] Fix | Delete
public $cfs_http;
[919] Fix | Delete
public $name;
[920] Fix | Delete
public $object_count;
[921] Fix | Delete
public $bytes_used;
[922] Fix | Delete
public $metadata;
[923] Fix | Delete
public $cdn_enabled;
[924] Fix | Delete
public $cdn_streaming_uri;
[925] Fix | Delete
public $cdn_ssl_uri;
[926] Fix | Delete
public $cdn_uri;
[927] Fix | Delete
public $cdn_ttl;
[928] Fix | Delete
public $cdn_log_retention;
[929] Fix | Delete
public $cdn_acl_user_agent;
[930] Fix | Delete
public $cdn_acl_referrer;
[931] Fix | Delete
[932] Fix | Delete
/**
[933] Fix | Delete
* Class constructor
[934] Fix | Delete
*
[935] Fix | Delete
* Constructor for Container
[936] Fix | Delete
*
[937] Fix | Delete
* @param obj $cfs_auth CF_Authentication instance
[938] Fix | Delete
* @param obj $cfs_http HTTP connection manager
[939] Fix | Delete
* @param string $name name of Container
[940] Fix | Delete
* @param int $count number of Objects stored in this Container
[941] Fix | Delete
* @param int $bytes number of bytes stored in this Container
[942] Fix | Delete
* @throws SyntaxException invalid Container name
[943] Fix | Delete
*/
[944] Fix | Delete
function __construct(&$cfs_auth, &$cfs_http, $name, $count=0,
[945] Fix | Delete
$bytes=0, $docdn=True)
[946] Fix | Delete
{
[947] Fix | Delete
if (strlen($name) > MAX_CONTAINER_NAME_LEN) {
[948] Fix | Delete
throw new SyntaxException("Container name exceeds "
[949] Fix | Delete
. "maximum allowed length.");
[950] Fix | Delete
}
[951] Fix | Delete
if (strpos($name, "/") !== False) {
[952] Fix | Delete
throw new SyntaxException(
[953] Fix | Delete
"Container names cannot contain a '/' character.");
[954] Fix | Delete
}
[955] Fix | Delete
$this->cfs_auth = $cfs_auth;
[956] Fix | Delete
$this->cfs_http = $cfs_http;
[957] Fix | Delete
$this->name = $name;
[958] Fix | Delete
$this->object_count = $count;
[959] Fix | Delete
$this->bytes_used = $bytes;
[960] Fix | Delete
$this->metadata = array();
[961] Fix | Delete
$this->cdn_enabled = NULL;
[962] Fix | Delete
$this->cdn_uri = NULL;
[963] Fix | Delete
$this->cdn_ssl_uri = NULL;
[964] Fix | Delete
$this->cdn_streaming_uri = NULL;
[965] Fix | Delete
$this->cdn_ttl = NULL;
[966] Fix | Delete
$this->cdn_log_retention = NULL;
[967] Fix | Delete
$this->cdn_acl_user_agent = NULL;
[968] Fix | Delete
$this->cdn_acl_referrer = NULL;
[969] Fix | Delete
if ($this->cfs_http->getCDNMUrl() != NULL && $docdn) {
[970] Fix | Delete
$this->_cdn_initialize();
[971] Fix | Delete
}
[972] Fix | Delete
}
[973] Fix | Delete
[974] Fix | Delete
/**
[975] Fix | Delete
* String representation of Container
[976] Fix | Delete
*
[977] Fix | Delete
* Pretty print the Container instance.
[978] Fix | Delete
*
[979] Fix | Delete
* @return string Container details
[980] Fix | Delete
*/
[981] Fix | Delete
function __toString()
[982] Fix | Delete
{
[983] Fix | Delete
$me = sprintf("name: %s, count: %.0f, bytes: %.0f",
[984] Fix | Delete
$this->name, $this->object_count, $this->bytes_used);
[985] Fix | Delete
if ($this->cfs_http->getCDNMUrl() != NULL) {
[986] Fix | Delete
$me .= sprintf(", cdn: %s, cdn uri: %s, cdn ttl: %.0f, logs retention: %s",
[987] Fix | Delete
$this->is_public() ? "Yes" : "No",
[988] Fix | Delete
$this->cdn_uri, $this->cdn_ttl,
[989] Fix | Delete
$this->cdn_log_retention ? "Yes" : "No"
[990] Fix | Delete
);
[991] Fix | Delete
[992] Fix | Delete
if ($this->cdn_acl_user_agent != NULL) {
[993] Fix | Delete
$me .= ", cdn acl user agent: " . $this->cdn_acl_user_agent;
[994] Fix | Delete
}
[995] Fix | Delete
[996] Fix | Delete
if ($this->cdn_acl_referrer != NULL) {
[997] Fix | Delete
$me .= ", cdn acl referrer: " . $this->cdn_acl_referrer;
[998] Fix | Delete
}
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function