Localfile API Documentation
SoPHIELabs Localfile API Class
The Localfile API provides a way to use local files for direct manipulation and caching the filesystem.
Init: $localfileApi = $api->get('sophielabs_localfile');
Method: $localfileApi->getPath(...)
Translates and sanitizes the path to the absolute local path
Returns String $path
Method: $localfileApi->write(...)
Write Files (fails if file already exists)
Directories are created implicitly when writing to a deeper path
Method: $localfileApi->update(...)
Update Files
Method: $localfileApi->put(...)
Write or Update Files
Method: $localfileApi->read(...)
Read Files
Returns String File contents
Method: $localfileApi->has(...)
Check if a file exists
Method: $localfileApi->delete(...)
Delete Files
Method: $localfileApi->noneExistingFilePath(...)
Generates a none existing filename optionally using a path and extentsion
Returns String None existing file path
Method: $localfileApi->open(...)
Open File
Returns int File-Handle
Method: $localfileApi->close(...)
Close File
Returns int File-Descriptor
Method: $localfileApi->putFromFileApi(...)
Get file api as localfile
Returns int File-Descriptor
Method: $localfileApi->putFromAssetApi(...)
Get file api as localfile
Returns int File-Descriptor