src/Components/LocalFileSystem.php
public function createContainer($properties = [], $check_exist = false)
    {
        $container = array_get($properties, 'name', array_get($properties, 'path'));
        if (empty($container)) {
            throw new BadRequestException('No name found for container in create request.');
        }
        // does this folder already exist?
        if ($this->folderExists($container, '')) {
            if ($check_exist) {
                throw new BadRequestException("Container '$container' already exists.");
            }
        } else {
            // create the container
            $dir = static::addContainerToName($container, '');

            if (!mkdir($dir, 0777, true)) {
                throw new InternalServerErrorException('Failed to create container.');
            }
        }

        return ['name' => $container, 'path' => $container];

//            $properties = (empty($properties)) ? '' : json_encode($properties);
//            $result = file_put_contents($key, $properties);
//            if (false === $result) {
//                throw new InternalServerErrorException('Failed to create container properties.');
//            }
    }
public function createContainer($properties = [], $check_exist = false)
    {
        $container = array_get($properties, 'name', array_get($properties, 'path'));
        if (empty($container)) {
            throw new BadRequestException('No name found for container in create request.');
        }
        // does this folder already exist?
        if ($this->folderExists($container, '')) {
            if ($check_exist) {
                throw new BadRequestException("Container '$container' already exists.");
            }
        } else {
            // create the container
            $dir = static::addContainerToName($container, '');

            if (!mkdir($dir, 0777, true)) {
                throw new InternalServerErrorException('Failed to create container.');
            }
        }

        return ['name' => $container, 'path' => $container];

//            $properties = (empty($properties)) ? '' : json_encode($properties);
//            $result = file_put_contents($key, $properties);
//            if (false === $result) {
//                throw new InternalServerErrorException('Failed to create container properties.');
//            }
    }
public function createContainer ( $ properties = [ ] , $ check_exist = false ) { $ container = array_get ( $ properties , 'name' , array_get ( $ properties , 'path' ) ) ; if ( empty ( $ container ) ) { throw new BadRequestException ( 'No name found for container in create request.' ) ; } // does this folder already exist? if ( $ this -> folderExists ( $ container , '' ) ) { if ( $ check_exist ) { throw new BadRequestException ( "Container '$container' already exists." ) ; } } else { // create the container $ dir = static :: addContainerToName ( $ container , '' ) ; if ( ! mkdir ( $ dir , 0777 , true ) ) { throw new InternalServerErrorException ( 'Failed to create container.' ) ; } } return [ 'name' => $ container , 'path' => $ container ] ; //            $properties = (empty($properties)) ? '' : json_encode($properties); //            $result = file_put_contents($key, $properties); //            if (false === $result) { //                throw new InternalServerErrorException('Failed to create container properties.'); //            } }
Create a container using properties, where at least name is required

@param array $properties
@param bool  $check_exist If true, throws error if the container already exists

@throws \Exception
@throws BadRequestException
@return array
Create a container using properties where at least name is required