src/Pqb/FilemanagerLaravel/plugins/rsc/cloudfiles.php
function create_container($container_name=NULL)
    {
        if ($container_name != "0" and !isset($container_name))
            throw new SyntaxException("Container name not set.");
        
        if (!isset($container_name) or $container_name == "") 
            throw new SyntaxException("Container name not set.");

        if (strpos($container_name, "/") !== False) {
            $r = "Container name '".$container_name;
            $r .= "' cannot contain a '/' character.";
            throw new SyntaxException($r);
        }
        if (strlen($container_name) > MAX_CONTAINER_NAME_LEN) {
            throw new SyntaxException(sprintf(
                "Container name exeeds %d bytes.",
                MAX_CONTAINER_NAME_LEN));
        }

        $return_code = $this->cfs_http->create_container($container_name);
        if (!$return_code) {
            throw new InvalidResponseException("Invalid response ("
                . $return_code. "): " . $this->cfs_http->get_error());
        }
        #if ($status == 401 && $this->_re_auth()) {
        #    return $this->create_container($container_name);
        #}
        if ($return_code != 201 && $return_code != 202) {
            throw new InvalidResponseException(
                "Invalid response (".$return_code."): "
                    . $this->cfs_http->get_error());
        }
        return new CF_Container($this->cfs_auth, $this->cfs_http, $container_name);
    }
function create_container($container_name=NULL)
    {
        if ($container_name != "0" and !isset($container_name))
            throw new SyntaxException("Container name not set.");
        
        if (!isset($container_name) or $container_name == "") 
            throw new SyntaxException("Container name not set.");

        if (strpos($container_name, "/") !== False) {
            $r = "Container name '".$container_name;
            $r .= "' cannot contain a '/' character.";
            throw new SyntaxException($r);
        }
        if (strlen($container_name) > MAX_CONTAINER_NAME_LEN) {
            throw new SyntaxException(sprintf(
                "Container name exeeds %d bytes.",
                MAX_CONTAINER_NAME_LEN));
        }

        $return_code = $this->cfs_http->create_container($container_name);
        if (!$return_code) {
            throw new InvalidResponseException("Invalid response ("
                . $return_code. "): " . $this->cfs_http->get_error());
        }
        #if ($status == 401 && $this->_re_auth()) {
        #    return $this->create_container($container_name);
        #}
        if ($return_code != 201 && $return_code != 202) {
            throw new InvalidResponseException(
                "Invalid response (".$return_code."): "
                    . $this->cfs_http->get_error());
        }
        return new CF_Container($this->cfs_auth, $this->cfs_http, $container_name);
    }
function create_container ( $ container_name = NULL ) { if ( $ container_name != "0" and ! isset ( $ container_name ) ) throw new SyntaxException ( "Container name not set." ) ; if ( ! isset ( $ container_name ) or $ container_name == "" ) throw new SyntaxException ( "Container name not set." ) ; if ( strpos ( $ container_name , "/" ) !== False ) { $ r = "Container name '" . $ container_name ; $ r .= "' cannot contain a '/' character." ; throw new SyntaxException ( $ r ) ; } if ( strlen ( $ container_name ) > MAX_CONTAINER_NAME_LEN ) { throw new SyntaxException ( sprintf ( "Container name exeeds %d bytes." , MAX_CONTAINER_NAME_LEN ) ) ; } $ return_code = $ this -> cfs_http -> create_container ( $ container_name ) ; if ( ! $ return_code ) { throw new InvalidResponseException ( "Invalid response (" . $ return_code . "): " . $ this -> cfs_http -> get_error ( ) ) ; } #if ($status == 401 && $this->_re_auth()) { #    return $this->create_container($container_name); #} if ( $ return_code != 201 && $ return_code != 202 ) { throw new InvalidResponseException ( "Invalid response (" . $ return_code . "): " . $ this -> cfs_http -> get_error ( ) ) ; } return new CF_Container ( $ this -> cfs_auth , $ this -> cfs_http , $ container_name ) ; }
Create a Container

Given a Container name, return a Container instance, creating a new
remote Container if it does not exit.

Example:
<code>
# ... authentication code excluded (see previous examples) ...
#
$conn = new CF_Authentication($auth);

$images = $conn->create_container("my photos");
</code>

@param string $container_name container name
@return CF_Container
@throws SyntaxException invalid name
@throws InvalidResponseException unexpected response
Create a Container