Storage/src/StreamWrapper.php
public function mkdir($path, $mode, $options)
    {
        $path = $this->makeDirectory($path);
        $client = $this->openPath($path);
        $predefinedAcl = $this->determineAclFromMode($mode);

        try {
            if ($options & STREAM_MKDIR_RECURSIVE || $this->file == '') {
                if (!$this->bucket->exists()) {
                    $client->createBucket($this->bucket->name(), [
                        'predefinedAcl' => $predefinedAcl,
                        'predefinedDefaultObjectAcl' => $predefinedAcl
                    ]);
                }
            }

            // If the file name is empty, we were trying to create a bucket. In this case,
            // don't create the placeholder file.
            if ($this->file != '') {
                // Fake a directory by creating an empty placeholder file whose name ends in '/'
                $this->bucket->upload('', [
                    'name' => $this->file,
                    'predefinedAcl' => $predefinedAcl
                ]);
            }
        } catch (ServiceException $e) {
            return false;
        }
        return true;
    }
public function mkdir($path, $mode, $options)
    {
        $path = $this->makeDirectory($path);
        $client = $this->openPath($path);
        $predefinedAcl = $this->determineAclFromMode($mode);

        try {
            if ($options & STREAM_MKDIR_RECURSIVE || $this->file == '') {
                if (!$this->bucket->exists()) {
                    $client->createBucket($this->bucket->name(), [
                        'predefinedAcl' => $predefinedAcl,
                        'predefinedDefaultObjectAcl' => $predefinedAcl
                    ]);
                }
            }

            // If the file name is empty, we were trying to create a bucket. In this case,
            // don't create the placeholder file.
            if ($this->file != '') {
                // Fake a directory by creating an empty placeholder file whose name ends in '/'
                $this->bucket->upload('', [
                    'name' => $this->file,
                    'predefinedAcl' => $predefinedAcl
                ]);
            }
        } catch (ServiceException $e) {
            return false;
        }
        return true;
    }
public function mkdir ( $ path , $ mode , $ options ) { $ path = $ this -> makeDirectory ( $ path ) ; $ client = $ this -> openPath ( $ path ) ; $ predefinedAcl = $ this -> determineAclFromMode ( $ mode ) ; try { if ( $ options & STREAM_MKDIR_RECURSIVE || $ this -> file == '' ) { if ( ! $ this -> bucket -> exists ( ) ) { $ client -> createBucket ( $ this -> bucket -> name ( ) , [ 'predefinedAcl' => $ predefinedAcl , 'predefinedDefaultObjectAcl' => $ predefinedAcl ] ) ; } } // If the file name is empty, we were trying to create a bucket. In this case, // don't create the placeholder file. if ( $ this -> file != '' ) { // Fake a directory by creating an empty placeholder file whose name ends in '/' $ this -> bucket -> upload ( '' , [ 'name' => $ this -> file , 'predefinedAcl' => $ predefinedAcl ] ) ; } } catch ( ServiceException $ e ) { return false ; } return true ; }
Callback handler for trying to create a directory. If no file path is specified,
or STREAM_MKDIR_RECURSIVE option is set, then create the bucket if it does not exist.

@param string $path The url directory to create
@param int $mode The permissions on the directory
@param int $options Bitwise mask of options. STREAM_MKDIR_RECURSIVE
@return bool
Callback handler for trying to create a directory . If no file path is specified or STREAM_MKDIR_RECURSIVE option is set then create the bucket if it does not exist .