private static function createDirectory($file)
    {
        $basename = is_string($file) ? basename($file) : '';
        $path = str_replace($basename, '', $file);

        if (! empty($path) && ! is_dir($path)) {
            if (! mkdir($path, 0755, true)) {
                $message = 'Could not create directory in';
                throw new JsonException($message . ' ' . $path);
            }
        }
    }
private static function createDirectory($file)
    {
        $basename = is_string($file) ? basename($file) : '';
        $path = str_replace($basename, '', $file);

        if (! empty($path) && ! is_dir($path)) {
            if (! mkdir($path, 0755, true)) {
                $message = 'Could not create directory in';
                throw new JsonException($message . ' ' . $path);
            }
        }
    }
private static function createDirectory ( $ file ) { $ basename = is_string ( $ file ) ? basename ( $ file ) : '' ; $ path = str_replace ( $ basename , '' , $ file ) ; if ( ! empty ( $ path ) && ! is_dir ( $ path ) ) { if ( ! mkdir ( $ path , 0755 , true ) ) { $ message = 'Could not create directory in' ; throw new JsonException ( $ message . ' ' . $ path ) ; } } }
Create directory recursively if it doesn't exist.

@since 1.1.3

@param string $file → path to the directory

@throws JsonException → couldn't create directory
Create directory recursively if it doesn t exist .