class File extends SplFileInfo
A file in the file system.
Methods
|
__construct(string $path, Boolean $checkPath = true)
Constructs a new file from the given path. |
||
| string|null |
guessExtension()
Returns the extension based on the mime type. |
|
| string|null |
getMimeType()
Returns the mime type of the file. |
|
| string |
getExtension()
Returns the extension of the file. |
|
| File |
move(string $directory, string $name = null)
Moves the file to a new location. |
Details
at line 38
public
__construct(string $path, Boolean $checkPath = true)
Constructs a new file from the given path.
at line 62
public string|null
guessExtension()
Returns the extension based on the mime type.
If the mime type is unknown, returns null.
This method uses the mime type as guessed by getMimeType()
to guess the file extension.
at line 83
public string|null
getMimeType()
Returns the mime type of the file.
The mime type is guessed using a MimeTypeGuesser instance, which uses finfo(),
mime_content_type() and the system binary "file" (in this order), depending on
which of those are available.
at line 99
public string
getExtension()
Returns the extension of the file.
\SplFileInfo::getExtension() is not available before PHP 5.3.6
at line 116
public File
move(string $directory, string $name = null)
Moves the file to a new location.