File API Documentation
SoPHIE File API Class
The File API provides a way to store and retrieve files in the filesystem.
Init: $fileApi = $api->get('sophie_file');
Method: $fileApi->write(...)
Write Files (fails if file already exists)
Directories are created implicitly when writing to a deeper path
Method: $fileApi->update(...)
Update Files
Method: $fileApi->put(...)
Write or Update Files
Method: $fileApi->read(...)
Read Files
Returns String File contents
Method: $fileApi->has(...)
Check if a file exists
Method: $fileApi->delete(...)
Delete Files
Method: $fileApi->copy(...)
Copy Files
(Only supported with storage library dependency)
Method: $fileApi->rename(...)
Rename Files
(Only supported with storage library dependency)
Method: $fileApi->readAndDelete(...)
Read and Delete
(Only supported with storage library dependency)
Returns String File contents
Method: $fileApi->getSize(...)
Get File Sizes
(Only supported with storage library dependency)
Returns ...
Method: $fileApi->getMimetype(...)
Get Mimetypes
(Only supported with storage library dependency)
Returns ...
Method: $fileApi->getTimestamp(...)
Get Timestamps
(Only supported with storage library dependency)
Returns ...
Method: $fileApi->createDir(...)
Create Directories
(Only supported with storage library dependency)
Returns ...
Method: $fileApi->deleteDir(...)
Delete Directories
(Only supported with storage library dependency)
Returns ...
Method: $fileApi->listPaths(...)
List Paths
(Only supported with storage library dependency)
Returns ...
Method: $fileApi->listContents(...)
List Contents
(Only supported with storage library dependency)
Returns ...
Method: $fileApi->noneExistingFilePath(...)
Generates a none existing filename optionally using a path and extentsion
Returns String None existing file path
Method: $fileApi->isLocalAccessAllowed(...)
Get information on local access feature for used filesystem adapter
Returns Boolean is local access allowed
Method: $fileApi->getLocalPath(...)
Get local file path information
Returns String Full path of local file