DiskFilesystemService
class DiskFilesystemService implements FilesystemInterface (View source)
Methods
MountFilesystem constructor.
Get the base directory
Function to upload a file
Put other file content in given file
Resolves file path.
Create a directory
Add content before the contents of the file
Add content after the contents of the file
List the files of a folder passed as a parameter
List the folder of a folder passed as a parameter
Renames or moves a source file to a target file.
Copy the contents of a source file to a target file.
Check the existence of a file or directory
isFile alias of is_file.
isDirectory alias of is_dir.
Recover the contents of the file
Delete file or directory
The file extension
Details
__construct(string $base_directory)
MountFilesystem constructor.
string
getBaseDirectory()
Get the base directory
array|bool|string
store(UploadedFile $file, string|null $location = null, array $option = [])
Function to upload a file
bool
put(string $file, string $content)
Put other file content in given file
string
path(string $file)
Resolves file path.
Give the absolute path of a path
bool
makeDirectory(string $dirname, int $mode = 0777)
Create a directory
bool
prepend(string $file, string $content)
Add content before the contents of the file
bool
append(string $file, string $content)
Add content after the contents of the file
array
files(string $dirname)
List the files of a folder passed as a parameter
array
directories(string $dirname)
List the folder of a folder passed as a parameter
bool
move(string $source, string $target)
Renames or moves a source file to a target file.
bool
copy(string $source, string $target)
Copy the contents of a source file to a target file.
bool
exists(string $file)
Check the existence of a file or directory
bool
isFile(string $file)
isFile alias of is_file.
bool
isDirectory(string $dirname)
isDirectory alias of is_dir.
string|null
get(string $file)
Recover the contents of the file
bool
delete(string $file)
Delete file or directory
string|null
extension(string $filename)
The file extension