kernel/classes/clusterfilehandlers/dbbackends/mysql.php
File containing the eZDBFileHandlerMysqlBackend class.
- Copyright
- Copyright (C) 1999-2011 eZ Systems AS. All rights reserved.
- License
- eZ Business Use License Agreement Version 2.0
- Package
- kernel
- Version
- 4.6.0
Constants
\eZDBFileHandlerMysqlBackend
Properties
Methods

_abortCacheGeneration(
string $generatingFilePath
)
:
voidAborts the cache generation process by removing the .generating file
| Name | Type | Description |
|---|---|---|
| $generatingFilePath | string | .generating cache file path |

_checkCacheGenerationTimeout(
string $generatingFilePath, int $generatingFileMtime
)
:
boolChecks if generation has timed out by looking for the .generating file and comparing its timestamp to the one assigned when the file was created
| Name | Type | Description |
|---|---|---|
| $generatingFilePath | string | |
| $generatingFileMtime | int |
| Type | Description |
|---|---|
| bool | true if the file didn't timeout, false otherwise |

_cleanupFiledata(
$filePath, $contentLength, $fname
)
:
void| Name | Type | Description |
|---|---|---|
| $filePath | ||
| $contentLength | ||
| $fname |

_copy(
$srcFilePath, $dstFilePath, $fname
=
false
)
:
void| Name | Type | Description |
|---|---|---|
| $srcFilePath | ||
| $dstFilePath | ||
| $fname |

_copyInner(
$srcFilePath, $dstFilePath, $fname, $metaData
)
:
void| Name | Type | Description |
|---|---|---|
| $srcFilePath | ||
| $dstFilePath | ||
| $fname | ||
| $metaData |

_delete(
$filePath, $insideOfTransaction
=
false, $fname
=
false
)
:
void| Name | Type | Description |
|---|---|---|
| $filePath | ||
| $insideOfTransaction | ||
| $fname |

_deleteByDirList(
$dirList, $commonPath, $commonSuffix, $fname
=
false
)
:
void| Name | Type | Description |
|---|---|---|
| $dirList | ||
| $commonPath | ||
| $commonSuffix | ||
| $fname |

_deleteByDirListInner(
$dirList, $commonPath, $commonSuffix, $fname
)
:
void| Name | Type | Description |
|---|---|---|
| $dirList | ||
| $commonPath | ||
| $commonSuffix | ||
| $fname |

_deleteByWildcard(
$wildcard, $fname
=
false
)
:
void| Name | Type | Description |
|---|---|---|
| $wildcard | ||
| $fname |

_deleteByWildcardInner(
$wildcard, $fname
)
:
void| Name | Type | Description |
|---|---|---|
| $wildcard | ||
| $fname |

_endCacheGeneration(
string $filePath, $generatingFilePath, $rename
)
:
boolEnds the cache generation for the current file: moves the (meta)data for the .generating file to the actual file, and removed the .generating
| Name | Type | Description |
|---|---|---|
| $filePath | string | |
| $generatingFilePath | ||
| $rename |
| Type | Description |
|---|---|
| bool |

_error(
$query, $fname, $error
=
"Failed to execute SQL for function:"
)
:
void| Name | Type | Description |
|---|---|---|
| $query | ||
| $fname | ||
| $error |

_exclusiveLock(
$filePath, $fname
=
false
)
:
void| Name | Type | Description |
|---|---|---|
| $filePath | ||
| $fname |

_exists(
$filePath, $fname
=
false, $ignoreExpiredFiles
=
true
)
:
void| Name | Type | Description |
|---|---|---|
| $filePath | ||
| $fname | ||
| $ignoreExpiredFiles |

_fetch(
string $filePath, string $uniqueName
=
false
)
:
\theFetches the file $filePath from the database, saving it locally with its original name, or $uniqueName if given
| Name | Type | Description |
|---|---|---|
| $filePath | string | |
| $uniqueName | string |
| Type | Description |
|---|---|
| \the | file physical path, or false if fetch failed |

_fetchContents(
$filePath, $fname
=
false
)
:
void| Name | Type | Description |
|---|---|---|
| $filePath | ||
| $fname |

_fetchMetadata(
$filePath, $fname
=
false
)
:
void\return file metadata, or false if the file does not exist in database.
| Name | Type | Description |
|---|---|---|
| $filePath | ||
| $fname |

_getFileList(
$scopes
=
false, $excludeScopes
=
false
)
:
void| Name | Type | Description |
|---|---|---|
| $scopes | ||
| $excludeScopes |

_insertUpdate(
$table, $array, $update, $fname, $reportError
=
true
)
:
void| Name | Type | Description |
|---|---|---|
| $table | ||
| $array | ||
| $update | ||
| $fname | ||
| $reportError |

_linkCopy(
$srcPath, $dstPath, $fname
=
false
)
:
void| Name | Type | Description |
|---|---|---|
| $srcPath | ||
| $dstPath | ||
| $fname |

_passThrough(
string $filePath, int $startOffset
=
0, false | int $length
=
false, false | string $fname
=
false
)
:
voidSends a binary file's content to the client
| Name | Type | Description |
|---|---|---|
| $filePath | string | File path |
| $startOffset | int | Starting offset |
| $length | false | int | Length to transmit, false means everything |
| $fname | false | string | The function name that started the query |

_purge(
$filePath, $onlyExpired
=
false, $expiry
=
false, $fname
=
false
)
:
void| Name | Type | Description |
|---|---|---|
| $filePath | ||
| $onlyExpired | ||
| $expiry | ||
| $fname |

_purgeByLike(
$like, $onlyExpired
=
false, $limit
=
50, $expiry
=
false, $fname
=
false
)
:
void| Name | Type | Description |
|---|---|---|
| $like | ||
| $onlyExpired | ||
| $limit | ||
| $expiry | ||
| $fname |

_query(
$query, $fname
=
false, $reportError
=
true
)
:
void| Name | Type | Description |
|---|---|---|
| $query | ||
| $fname | ||
| $reportError |

_rename(
$srcFilePath, $dstFilePath
)
:
void| Name | Type | Description |
|---|---|---|
| $srcFilePath | ||
| $dstFilePath |

_report(
$query, string $fname, int $timeTaken, int $numRows
=
false
)
:
voidReport SQL $query to debug system.
| Name | Type | Description |
|---|---|---|
| $query | ||
| $fname | string | The function name that started the query, should contain relevant arguments in the text. |
| $timeTaken | int | Number of seconds the query + related operations took (as float). |
| $numRows | int | Number of affected rows. |

_selectOne(
$query, $fname, $error
=
false, $debug
=
false, $fetchCall
)
:
void| Name | Type | Description |
|---|---|---|
| $query | ||
| $fname | ||
| $error | ||
| $debug | ||
| $fetchCall |

_selectOneAssoc(
$query, $fname, $error
=
false, $debug
=
false
)
:
void| Name | Type | Description |
|---|---|---|
| $query | ||
| $fname | ||
| $error | ||
| $debug |

_selectOneRow(
$query, $fname, $error
=
false, $debug
=
false
)
:
void| Name | Type | Description |
|---|---|---|
| $query | ||
| $fname | ||
| $error | ||
| $debug |

_startCacheGeneration(
string $filePath, $generatingFilePath
)
:
arrayAttempts to begin cache generation by creating a new file named as the given filepath, suffixed with .generating. If the file already exists, insertion is not performed and false is returned (means that the file is already being generated)
| Name | Type | Description |
|---|---|---|
| $filePath | string | |
| $generatingFilePath |
| Type | Description |
|---|---|
| array | array with 2 indexes: 'result', containing either ok or ko, and another index that depends on the result: - if result == 'ok', the 'mtime' index contains the generating file's mtime - if result == 'ko', the 'remaining' index contains the remaining generation time (time until timeout) in seconds |

_store(
$filePath, $datatype, $scope, $fname
=
false
)
:
void| Name | Type | Description |
|---|---|---|
| $filePath | ||
| $datatype | ||
| $scope | ||
| $fname |

_storeContents(
$filePath, $contents, $scope, $datatype, $mtime
=
false, $fname
=
false
)
:
void| Name | Type | Description |
|---|---|---|
| $filePath | ||
| $contents | ||
| $scope | ||
| $datatype | ||
| $mtime | ||
| $fname |

_storeContentsInner(
$filePath, $contents, $scope, $datatype, $curTime, $fname
)
:
void| Name | Type | Description |
|---|---|---|
| $filePath | ||
| $contents | ||
| $scope | ||
| $datatype | ||
| $curTime | ||
| $fname |

_storeInner(
$filePath, $datatype, $scope, $fname
)
:
void| Name | Type | Description |
|---|---|---|
| $filePath | ||
| $datatype | ||
| $scope | ||
| $fname |

_verifyExclusiveLock(
string $filePath, int $expiry, int $curtime, int $ttl, string $fname
=
false
)
:
boolUses a secondary database connection to check outside the transaction scope if a file has been generated during the current process execution
| Name | Type | Description |
|---|---|---|
| $filePath | string | |
| $expiry | int | |
| $curtime | int | |
| $ttl | int | |
| $fname | string |
| Type | Description |
|---|---|
| bool | false if the file exists and is not expired, true otherwise |

expiredFilesList(
array $scopes, int $limit
=
array( 0, 100 ), int $expiry
=
false
)
:
\array(filepath)Returns the list of expired files
| Name | Type | Description |
|---|---|---|
| $scopes | array | Array of scopes to consider. At least one. |
| $limit | int | Max number of items. Set to false for unlimited. |
| $expiry | int | Number of seconds, only items older than this will be returned. |
| Type | Description |
|---|---|
| \array(filepath) |
- Since
- 4.3

nameTrunk(
string $filePath, string $scope
)
:
stringReturns the name_trunk for a file path
| Name | Type | Description |
|---|---|---|
| $filePath | string | |
| $scope | string |
| Type | Description |
|---|---|
| string |