kernel/classes/clusterfilehandlers/ezfsfilehandler.php
\eZFSFileHandler
- Children
- \eZFS2FileHandler
Constants
Properties
Methods

abortCacheGeneration(
)
:
voidAborts the current cache generation process.
Does so by rolling back the current transaction, which should be the .generating file lock

checkCacheGenerationTimeout(
)
:
voidChecks if the .generating file was changed, which would mean that generation timed out. If not timed out, refreshes the timestamp so that storage won't be stolen

delete(
)
:
voidDeletes specified file/directory.
If a directory specified it is deleted recursively.
\public \static

deleteLocal(
)
:
voidDeletes a file that has been fetched before.
In case of fetching from filesystem does nothing.
\public

eZFSFileHandler(
$filePath
=
false
)
:
voidConstructor.
$filePath File path. If specified, file metadata is fetched in the constructor.
| Name | Type | Description |
|---|---|---|
| $filePath |

exists(
)
:
voidCheck if given file/dir exists.
NOTE: this function does not interact with filesystem. Instead, it just returns existance status determined in the constructor.
\public

fetch(
$noLocalCache
=
false
)
:
voidFetches file from db and saves it in FS under the same name.
In case of fetching from filesystem does nothing.
| Name | Type | Description |
|---|---|---|
| $noLocalCache |

fetchContents(
)
:
voidReturns file contents.
\public \return contents string, or false in case of an error.

fetchUnique(
)
:
stringFetches file from db and saves it in FS under unique name.
In case of fetching from filesystem, does nothing
| Type | Description |
|---|---|
| string | The unique file path. on FS, the file path. |

fileCopy(
$srcPath, $dstPath
)
:
voidCopy file.
\public \static
| Name | Type | Description |
|---|---|---|
| $srcPath | ||
| $dstPath |

fileDelete(
$path, $fnamePart
=
false
)
:
void\public \static
| Name | Type | Description |
|---|---|---|
| $path | ||
| $fnamePart |

fileDeleteByDirList(
$dirList, $commonPath, $commonSuffix
)
:
voidDelete files located in a directories from dirList, with common prefix specified by commonPath, and common suffix with added wildcard at the end
\public \static \sa fileDeleteByRegex()
| Name | Type | Description |
|---|---|---|
| $dirList | ||
| $commonPath | ||
| $commonSuffix |

fileDeleteByRegex(
$dir, $fileRegex
)
:
voidDelete files matching regex $fileRegex under directory $dir.
\public \static \sa fileDeleteByWildcard()
| Name | Type | Description |
|---|---|---|
| $dir | ||
| $fileRegex |

fileDeleteByWildcard(
$wildcard
)
:
voidDelete files matching given wildcard.
Note that this method is faster than fileDeleteByRegex().
\public \static \sa fileDeleteByRegex()
| Name | Type | Description |
|---|---|---|
| $wildcard |

fileDeleteLocal(
$path
)
:
voidDeletes a file that has been fetched before.
| Name | Type | Description |
|---|---|---|
| $path |
- See
- \fetchUnique

fileExists(
$path
)
:
voidCheck if given file/dir exists.
\public \static
| Name | Type | Description |
|---|---|---|
| $path |

fileFetch(
$filePath
)
:
voidFetches file from db and saves it in FS under the same name.
In case of fetching from filesystem does nothing.
| Name | Type | Description |
|---|---|---|
| $filePath |

fileFetchContents(
$filePath
)
:
string | falseReturns file contents.
| Name | Type | Description |
|---|---|---|
| $filePath |
| Type | Description |
|---|---|
| string | false | contents string, or false in case of an error. |

fileLinkCopy(
$srcPath, $dstPath, $symLink
)
:
voidCreate symbolic or hard link to file.
\public \static
| Name | Type | Description |
|---|---|---|
| $srcPath | ||
| $dstPath | ||
| $symLink |

fileMove(
$srcPath, $dstPath
)
:
voidMove file.
\public \static
| Name | Type | Description |
|---|---|---|
| $srcPath | ||
| $dstPath |

fileStore(
string $filePath, string $scope
=
false, string $delete
=
false, $datatype
=
false
)
:
voidStore file.
In case of storing to filesystem does nothing.
| Name | Type | Description |
|---|---|---|
| $filePath | string | Path to the file being stored. |
| $scope | string | Means something like "file category". May be used to clean caches of a certain type. |
| $delete | string | true if the file should be deleted after storing. |
| $datatype |

fileStoreContents(
$filePath, $contents, $scope
=
false, $datatype
=
false
)
:
voidStore file contents.
\public \static
| Name | Type | Description |
|---|---|---|
| $filePath | ||
| $contents | ||
| $scope | ||
| $datatype |

isExpired(
int $expiry, int $curtime, int $ttl
)
:
boolCalculates if the current file data is expired or not.
| Name | Type | Description |
|---|---|---|
| $expiry | int | Time when file is to be expired, a value of -1 will disable this check. |
| $curtime | int | The current time to check against. |
| $ttl | int | Number of seconds the data can live, set to null to disable TTL. |
| Type | Description |
|---|---|
| bool |

isFileExpired(
string $fname, int $mtime, int $expiry, int $curtime, int $ttl
)
:
boolCalculates if the file data is expired or not.
| Name | Type | Description |
|---|---|---|
| $fname | string | Name of file, available for easy debugging. |
| $mtime | int | Modification time of file, can be set to false if file does not exist. |
| $expiry | int | Time when file is to be expired, a value of -1 will disable this check. |
| $curtime | int | The current time to check against. |
| $ttl | int | Number of seconds the data can live, set to null to disable TTL. |
| Type | Description |
|---|---|
| bool |

processCache(
$retrieveCallback, $generateCallback
=
null, $ttl
=
null, $expiry
=
null, $extraData
=
null
)
:
void| Name | Type | Description |
|---|---|---|
| $retrieveCallback | ||
| $generateCallback | ||
| $ttl | ||
| $expiry | ||
| $extraData |

processFile(
$callback, $expiry
=
false, $extraData
=
null
)
:
void| Name | Type | Description |
|---|---|---|
| $callback | ||
| $expiry | ||
| $extraData |

purge(
$printCallback
=
false, $microsleep
=
false, $max
=
false, $expiry
=
false
)
:
void| Name | Type | Description |
|---|---|---|
| $printCallback | ||
| $microsleep | ||
| $max | ||
| $expiry |

requiresBinaryPurge(
)
:
booleZFS does not require binary purge.
Files are stored on plain FS and removed using FS functions
| Type | Description |
|---|---|
| bool |
- Deprecated
- Deprecated as of 4.5, use {@link eZFSFileHandler::requiresPurge()} instead.
- Since
- 4.3

requiresClusterizing(
)
:
booleZFS only stores data to FS and doesn't require/support clusterizing
| Type | Description |
|---|---|
| bool | false |

requiresPurge(
)
:
booleZFS does not require binary purge.
Files are stored on plain FS and removed using FS functions
| Type | Description |
|---|---|
| bool |
- Since
- 4.5.0

startCacheGeneration(
)
:
mixedStarts cache generation for the current file.
This is done by creating a file named by the original file name, prefixed with '.generating'.
| Type | Description |
|---|---|
| mixed | true if generation lock was granted, an integer matching the time before the current generation times out |
- Todo
- add timeout handling...

storeCache(
$fileData, $storeCache
=
true
)
:
void| Name | Type | Description |
|---|---|---|
| $fileData | ||
| $storeCache |

storeContents(
string $contents, string $scope
=
false, string $datatype
=
false, bool $storeLocally
=
false
)
:
voidStore file contents to disk
| Name | Type | Description |
|---|---|---|
| $contents | string | Binary file data |
| $scope | string | Not used in the FS handler |
| $datatype | string | Not used in the FS handler |
| $storeLocally | bool | Not used in the FS handler |