File
extends Handler
in package
Tags
Table of Contents
- $filesystem : FilesystemInterface
- $path : string
- __call() : mixed
- Plugins pass-through.
- __construct() : mixed
- Constructor.
- copy() : File|false
- Copy the file.
- delete() : bool
- Delete the file.
- exists() : bool
- Check whether the file exists.
- getFilesystem() : FilesystemInterface
- Retrieve the Filesystem object.
- getMetadata() : array<string|int, mixed>|false
- Get the file's metadata.
- getMimetype() : string|false
- Get the file's mimetype.
- getPath() : string
- Retrieve the entree path.
- getSize() : int|false
- Get the file size.
- getTimestamp() : string|false
- Get the file's timestamp.
- getType() : string
- Retrieve the entree type (file|dir).
- getVisibility() : string|false
- Get the file's visibility.
- isDir() : bool
- Check whether the entree is a directory.
- isFile() : bool
- Check whether the entree is a file.
- put() : bool
- Create the file or update if exists.
- putStream() : bool
- Create the file or update if exists using a stream.
- read() : string|false
- Read the file.
- readStream() : resource|false
- Read the file as a stream.
- rename() : bool
- Rename the file.
- setFilesystem() : $this
- Set the Filesystem object.
- setPath() : $this
- Set the entree path.
- update() : bool
- Update the file contents.
- updateStream() : bool
- Update the file contents with a stream.
- write() : bool
- Write the new file.
- writeStream() : bool
- Write the new file using a stream.
Properties
$filesystem
protected
FilesystemInterface
$filesystem
$path
protected
string
$path
Methods
__call()
Plugins pass-through.
public
__call(string $method, array<string|int, mixed> $arguments) : mixed
Parameters
- $method : string
- $arguments : array<string|int, mixed>
Return values
mixed —__construct()
Constructor.
public
__construct([FilesystemInterface $filesystem = null ][, string $path = null ]) : mixed
Parameters
- $filesystem : FilesystemInterface = null
- $path : string = null
Return values
mixed —copy()
Copy the file.
public
copy(string $newpath) : File|false
Parameters
- $newpath : string
Return values
File|false —new file or false
delete()
Delete the file.
public
delete() : bool
Return values
bool —success boolean
exists()
Check whether the file exists.
public
exists() : bool
Return values
bool —getFilesystem()
Retrieve the Filesystem object.
public
getFilesystem() : FilesystemInterface
Return values
FilesystemInterface —getMetadata()
Get the file's metadata.
public
getMetadata() : array<string|int, mixed>|false
Return values
array<string|int, mixed>|false —The file metadata or false on failure.
getMimetype()
Get the file's mimetype.
public
getMimetype() : string|false
Return values
string|false —The file mime-type or false on failure.
getPath()
Retrieve the entree path.
public
getPath() : string
Return values
string —path
getSize()
Get the file size.
public
getSize() : int|false
Return values
int|false —The file size or false on failure.
getTimestamp()
Get the file's timestamp.
public
getTimestamp() : string|false
Return values
string|false —The timestamp or false on failure.
getType()
Retrieve the entree type (file|dir).
public
getType() : string
Return values
string —file or dir
getVisibility()
Get the file's visibility.
public
getVisibility() : string|false
Return values
string|false —The visibility (public|private) or false on failure.
isDir()
Check whether the entree is a directory.
public
isDir() : bool
Return values
bool —isFile()
Check whether the entree is a file.
public
isFile() : bool
Return values
bool —put()
Create the file or update if exists.
public
put(string $content) : bool
Parameters
- $content : string
Return values
bool —success boolean
putStream()
Create the file or update if exists using a stream.
public
putStream(resource $resource) : bool
Parameters
- $resource : resource
Return values
bool —success boolean
read()
Read the file.
public
read() : string|false
Return values
string|false —file contents
readStream()
Read the file as a stream.
public
readStream() : resource|false
Return values
resource|false —file stream
rename()
Rename the file.
public
rename(string $newpath) : bool
Parameters
- $newpath : string
Return values
bool —success boolean
setFilesystem()
Set the Filesystem object.
public
setFilesystem(FilesystemInterface $filesystem) : $this
Parameters
- $filesystem : FilesystemInterface
Return values
$this —setPath()
Set the entree path.
public
setPath(string $path) : $this
Parameters
- $path : string
Return values
$this —update()
Update the file contents.
public
update(string $content) : bool
Parameters
- $content : string
Return values
bool —success boolean
updateStream()
Update the file contents with a stream.
public
updateStream(resource $resource) : bool
Parameters
- $resource : resource
Return values
bool —success boolean
write()
Write the new file.
public
write(string $content) : bool
Parameters
- $content : string
Return values
bool —success boolean
writeStream()
Write the new file using a stream.
public
writeStream(resource $resource) : bool
Parameters
- $resource : resource
Return values
bool —success boolean