BaseFsInterface

Type
Interface
Namespace
craft\base
Implemented by
craft\base\FsInterface, craft\models\Volume
Since
4.4.0

BaseFsInterface defines the common interface to be implemented by filesystem classes and volume model.

View source (opens new window)

# Public Methods

Method Description
copyFile() Copies a file.
createDirectory() Creates a directory.
deleteDirectory() Deletes a directory.
deleteFile() Deletes a file.
directoryExists() Returns whether a directory exists at the given path.
fileExists() Returns whether a file exists.
getDateModified() Returns the last time the file was modified.
getFileList() List files.
getFileSize() Return the file size.
getFileStream() Gets a stream ready for reading by a file's URI.
getRootUrl() Returns the root URL for a filesystem, if it has one.
read() Reads contents of a file to a string.
renameDirectory() Renames a directory.
renameFile() Renames a file.
write() Writes a string to a file.
writeFileFromStream() Writes a file to a fs from a given stream.

# copyFile()

Copies a file.

View source (opens new window)

Arguments

Throws

# createDirectory()

Creates a directory.

View source (opens new window)

Arguments

Throws

# deleteDirectory()

Deletes a directory.

View source (opens new window)

Arguments

Throws

# deleteFile()

Deletes a file.

View source (opens new window)

Arguments

# directoryExists()

Returns whether a directory exists at the given path.

View source (opens new window)

Arguments

Returns

boolean (opens new window)

Throws

# fileExists()

Returns whether a file exists.

View source (opens new window)

Arguments

Returns

boolean (opens new window)

Throws

# getDateModified()

Returns the last time the file was modified.

View source (opens new window)

Arguments

Returns

integer (opens new window)

Throws

# getFileList()

List files.

View source (opens new window)

Arguments

Returns

Generator (opens new window)

Throws

# getFileSize()

Return the file size.

View source (opens new window)

Arguments

Returns

integer (opens new window)

Throws

# getFileStream()

Gets a stream ready for reading by a file's URI.

View source (opens new window)

Arguments

Returns

resource (opens new window)

Throws

# getRootUrl()

Returns the root URL for a filesystem, if it has one.

View source (opens new window)

Returns

string (opens new window), null (opens new window)

# read()

Reads contents of a file to a string.

View source (opens new window)

Arguments

Returns

string (opens new window)

# renameDirectory()

Renames a directory.

View source (opens new window)

Arguments

Throws

# renameFile()

Renames a file.

View source (opens new window)

Arguments

Throws

# write()

Writes a string to a file.

View source (opens new window)

Arguments

Throws

# writeFileFromStream()

Writes a file to a fs from a given stream.

View source (opens new window)

Arguments

Throws