class Illuminate / Filesystem / FilesystemAdapter

FilesystemAdapter

Implements

Uses

Properties

protected

$driver League\...\FilesystemOperator

The Flysystem filesystem implementation.

Default: null
protected

$adapter League\...\FilesystemAdapter

The Flysystem adapter implementation.

Default: null
protected

$config array

The filesystem configuration.

Default: null
protected

$prefixer League\...\PathPrefixer

The Flysystem PathPrefixer instance.

Default: null
protected

$temporaryUrlCallback Closure |null

The temporary URL builder callback.

Default: null

Methods

public

__construct ( League\...\FilesystemOperator $driver , League\...\FilesystemAdapter $adapter , array $config ) : void

Create a new filesystem adapter instance.

Parameters

  • $driver League\...\FilesystemOperator
  • $adapter League\...\FilesystemAdapter
  • $config array
public

assertExists ( $path , $content ) : $this

Assert that the given file or directory exists.

Parameters

  • $path string|array
  • $content string|null
public

assertMissing ( $path ) : $this

Assert that the given file or directory does not exist.

Parameters

  • $path string|array
public

assertDirectoryEmpty ( $path ) : $this

Assert that the given directory is empty.

Parameters

  • $path string
public

exists ( $path ) : bool

Determine if a file or directory exists.

Parameters

  • $path string
public

missing ( $path ) : bool

Determine if a file or directory is missing.

Parameters

  • $path string
public

fileExists ( $path ) : bool

Determine if a file exists.

Parameters

  • $path string
public

fileMissing ( $path ) : bool

Determine if a file is missing.

Parameters

  • $path string
public

directoryExists ( $path ) : bool

Determine if a directory exists.

Parameters

  • $path string
public

directoryMissing ( $path ) : bool

Determine if a directory is missing.

Parameters

  • $path string
public

path ( $path ) : string

Get the full path for the file at the given "short" path.

Parameters

  • $path string
public

get ( $path ) : string|null

Get the contents of a file.

Parameters

  • $path string
public

json ( $path , $flags ) : array|null

Get the contents of a file as decoded JSON.

Parameters

  • $path string
  • $flags int
public

response ( $path , $name , array $headers , $disposition ) : Symfony\...\StreamedResponse

Create a streamed response for a given file.

Parameters

  • $path string
  • $name string|null
  • $headers array
  • $disposition string|null
public

download ( $path , $name , array $headers ) : Symfony\...\StreamedResponse

Create a streamed download response for a given file.

Parameters

  • $path string
  • $name string|null
protected

fallbackName ( $name ) : string

Convert the string to ASCII characters that are equivalent to the given name.

Parameters

  • $name string
public

put ( $path , $contents , $options ) : string|bool

Write the contents of a file.

Parameters

  • $path string
  • $contents Psr\...\StreamInterface|File |UploadedFile |string|resource
  • $options mixed
public

putFile ( $path , $file , $options ) : string|false

Store the uploaded file on the disk.

Parameters

public

putFileAs ( $path , $file , $name , $options ) : string|false

Store the uploaded file on the disk with a given name.

Parameters

public

getVisibility ( $path ) : string

Get the visibility for the given path.

Parameters

  • $path string
public

setVisibility ( $path , $visibility ) : bool

Set the visibility for the given path.

Parameters

  • $path string
  • $visibility string
public

prepend ( $path , $data , $separator ) : bool

Prepend to a file.

Parameters

  • $path string
  • $data string
  • $separator string
public

append ( $path , $data , $separator ) : bool

Append to a file.

Parameters

  • $path string
  • $data string
  • $separator string
public

delete ( $paths ) : bool

Delete the file at a given path.

Parameters

  • $paths string|array
public

copy ( $from , $to ) : bool

Copy a file to a new location.

Parameters

  • $from string
  • $to string
public

move ( $from , $to ) : bool

Move a file to a new location.

Parameters

  • $from string
  • $to string
public

size ( $path ) : int

Get the file size of a given file.

Parameters

  • $path string
public

checksum ( string $path , array $options ) : string|false

Get the checksum for a file.

public

mimeType ( $path ) : string|false

Get the mime-type of a given file.

Parameters

  • $path string
public

lastModified ( $path ) : int

Get the file's last modification time.

Parameters

  • $path string
public

readStream ( $path ) : void

{@inheritdoc}

public

writeStream ( $path , $resource , array $options ) : void

{@inheritdoc}

public

url ( $path ) : string

Get the URL for the file at the given path.

Parameters

  • $path string
protected

getFtpUrl ( $path ) : string

Get the URL for the file at the given path.

Parameters

  • $path string
protected

getLocalUrl ( $path ) : string

Get the URL for the file at the given path.

Parameters

  • $path string
public

providesTemporaryUrls ( ) : bool

Determine if temporary URLs can be generated.

public

temporaryUrl ( $path , $expiration , array $options ) : string

Get a temporary URL for the file at the given path.

Parameters

public

temporaryUploadUrl ( $path , $expiration , array $options ) : array

Get a temporary upload URL for the file at the given path.

Parameters

protected

concatPathToUrl ( $url , $path ) : string

Concatenate a path to a URL.

Parameters

  • $url string
  • $path string
protected

replaceBaseUrl ( $uri , $url ) : Psr\...\UriInterface

Replace the scheme, host and port of the given UriInterface with values from the given URL.

Parameters

  • $uri Psr\...\UriInterface
  • $url string
public

files ( $directory , $recursive ) : array

Get an array of all files in a directory.

Parameters

  • $directory string|null
  • $recursive bool
public

allFiles ( $directory ) : array

Get all of the files from the given directory (recursive).

Parameters

  • $directory string|null
public

directories ( $directory , $recursive ) : array

Get all of the directories within a given directory.

Parameters

  • $directory string|null
  • $recursive bool
public

allDirectories ( $directory ) : array

Get all the directories within a given directory (recursive).

Parameters

  • $directory string|null
public

makeDirectory ( $path ) : bool

Create a directory.

Parameters

  • $path string
public

deleteDirectory ( $directory ) : bool

Recursively delete a directory.

Parameters

  • $directory string
public

getDriver ( ) : League\...\FilesystemOperator

Get the Flysystem driver.

public

getAdapter ( ) : League\...\FilesystemAdapter

Get the Flysystem adapter.

public

getConfig ( ) : array

Get the configuration values.

protected

parseVisibility ( $visibility ) : string|null

Parse the given visibility value.

Parameters

  • $visibility string|null
public

buildTemporaryUrlsUsing ( Closure $callback ) : void

Define a custom temporary URL builder callback.

Parameters

protected

throwsExceptions ( ) : bool

Determine if Flysystem exceptions should be thrown.

public

__call ( $method , $parameters ) : mixed

Pass dynamic methods call onto Flysystem.

Parameters

  • $method string
  • $parameters array