kernel/classes/clusterfilehandlers/dbbackends/mysql.php

Show: inherited
Table of Contents

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

Constant  TABLE_METADATA = 'ezdbfile'
Constant  TABLE_DATA = 'ezdbfile_data'

\eZDBFileHandlerMysqlBackend

Package:

Properties

Propertyprivate  $backendVerify= 'null'
Default valuenullDetails
Type
n/a
Propertypublic  $db= 'null'
Default valuenullDetails
Type
n/a
Propertypublic  $dbparams= ''
Details
Type
n/a
Propertypublic  $numQueries= '0'
Default value0Details
Type
n/a
Propertypublic  $transactionCount= '0'
Default value0Details
Type
n/a

Methods

methodpublic__mkdir_p(  $dir ) : void

Parameters
Name Type Description
$dir
methodpublic_abortCacheGeneration( string $generatingFilePath ) : void

Aborts the cache generation process by removing the .generating file

Parameters
Name Type Description
$generatingFilePath string

.generating cache file path

methodpublic_begin(  $fname = false ) : void

Parameters
Name Type Description
$fname
methodpublic_checkCacheGenerationTimeout( string $generatingFilePath, int $generatingFileMtime ) : bool

Checks if generation has timed out by looking for the .generating file and comparing its timestamp to the one assigned when the file was created

Parameters
Name Type Description
$generatingFilePath string
$generatingFileMtime int
Returns
Type Description
bool true if the file didn't timeout, false otherwise
methodpublic_cleanupFiledata(  $filePath,  $contentLength,  $fname ) : void

Parameters
Name Type Description
$filePath
$contentLength
$fname
methodpublic_commit(  $fname = false ) : void

Parameters
Name Type Description
$fname
methodpublic_connect(  $newLink = false ) : void

Parameters
Name Type Description
$newLink
methodpublic_copy(  $srcFilePath,  $dstFilePath,  $fname = false ) : void

Parameters
Name Type Description
$srcFilePath
$dstFilePath
$fname
methodpublic_copyInner(  $srcFilePath,  $dstFilePath,  $fname,  $metaData ) : void

Parameters
Name Type Description
$srcFilePath
$dstFilePath
$fname
$metaData
methodpublic_delete(  $filePath,  $insideOfTransaction = false,  $fname = false ) : void

Parameters
Name Type Description
$filePath
$insideOfTransaction
$fname
methodpublic_deleteByDirList(  $dirList,  $commonPath,  $commonSuffix,  $fname = false ) : void

Parameters
Name Type Description
$dirList
$commonPath
$commonSuffix
$fname
methodpublic_deleteByDirListInner(  $dirList,  $commonPath,  $commonSuffix,  $fname ) : void

Parameters
Name Type Description
$dirList
$commonPath
$commonSuffix
$fname
methodpublic_deleteByLike(  $like,  $fname = false ) : void

Parameters
Name Type Description
$like
$fname
methodpublic_deleteByLikeInner(  $like,  $fname ) : void

Parameters
Name Type Description
$like
$fname
methodpublic_deleteByRegex(  $regex,  $fname = false ) : void

Parameters
Name Type Description
$regex
$fname
methodpublic_deleteByRegexInner(  $regex,  $fname ) : void

Parameters
Name Type Description
$regex
$fname
methodpublic_deleteByWildcard(  $wildcard,  $fname = false ) : void

Parameters
Name Type Description
$wildcard
$fname
methodpublic_deleteByWildcardInner(  $wildcard,  $fname ) : void

Parameters
Name Type Description
$wildcard
$fname
methodpublic_deleteInner(  $filePath,  $fname ) : void

Parameters
Name Type Description
$filePath
$fname
methodpublic_die(  $msg,  $sql = null ) : void

Parameters
Name Type Description
$msg
$sql
methodpublic_disconnect( ) : void

Disconnects the handler from the database

methodpublic_endCacheGeneration( string $filePath,  $generatingFilePath,  $rename ) : bool

Ends the cache generation for the current file: moves the (meta)data for the .generating file to the actual file, and removed the .generating

Parameters
Name Type Description
$filePath string
$generatingFilePath
$rename
Returns
Type Description
bool
methodpublic_error(  $query,  $fname,  $error = "Failed to execute SQL for function:" ) : void

Parameters
Name Type Description
$query
$fname
$error
methodpublic_exclusiveLock(  $filePath,  $fname = false ) : void

Parameters
Name Type Description
$filePath
$fname
methodpublic_exists(  $filePath,  $fname = false,  $ignoreExpiredFiles = true ) : void

Parameters
Name Type Description
$filePath
$fname
$ignoreExpiredFiles
methodpublic_fail(  $value,  $text = false ) : void

Parameters
Name Type Description
$value
$text
methodpublic_fetch( string $filePath, string $uniqueName = false ) : \the

Fetches the file $filePath from the database, saving it locally with its original name, or $uniqueName if given

Parameters
Name Type Description
$filePath string
$uniqueName string
Returns
Type Description
\the file physical path, or false if fetch failed
methodpublic_fetchContents(  $filePath,  $fname = false ) : void

Parameters
Name Type Description
$filePath
$fname
methodpublic_fetchMetadata(  $filePath,  $fname = false ) : void

\return file metadata, or false if the file does not exist in database.

Parameters
Name Type Description
$filePath
$fname
methodpublic_freeExclusiveLock(  $fname = false ) : void

Parameters
Name Type Description
$fname
methodpublic_freeSharedLock(  $fname = false ) : void

Parameters
Name Type Description
$fname
methodpublic_getFileList(  $scopes = false,  $excludeScopes = false ) : void

Parameters
Name Type Description
$scopes
$excludeScopes
methodpublic_handleErrorType(  $res ) : void

Parameters
Name Type Description
$res
methodpublic_insert(  $table,  $array,  $fname ) : void

Parameters
Name Type Description
$table
$array
$fname
methodpublic_insertUpdate(  $table,  $array,  $update,  $fname,  $reportError = true ) : void

Parameters
Name Type Description
$table
$array
$update
$fname
$reportError
methodpublic_isFailure(  $result ) : void

Parameters
Name Type Description
$result
methodpublic_linkCopy(  $srcPath,  $dstPath,  $fname = false ) : void

Parameters
Name Type Description
$srcPath
$dstPath
$fname
methodpublic_md5(  $value ) : void

Parameters
Name Type Description
$value
methodpublic_passThrough( string $filePath, int $startOffset = 0, false | int $length = false, false | string $fname = false ) : void

Sends a binary file's content to the client

Parameters
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

methodpublic_protect( ) : void

methodpublic_purge(  $filePath,  $onlyExpired = false,  $expiry = false,  $fname = false ) : void

Parameters
Name Type Description
$filePath
$onlyExpired
$expiry
$fname
methodpublic_purgeByLike(  $like,  $onlyExpired = false,  $limit = 50,  $expiry = false,  $fname = false ) : void

Parameters
Name Type Description
$like
$onlyExpired
$limit
$expiry
$fname
methodpublic_query(  $query,  $fname = false,  $reportError = true ) : void

Parameters
Name Type Description
$query
$fname
$reportError
methodpublic_quote(  $value ) : void

Parameters
Name Type Description
$value
methodpublic_rename(  $srcFilePath,  $dstFilePath ) : void

Parameters
Name Type Description
$srcFilePath
$dstFilePath
methodpublic_report(  $query, string $fname, int $timeTaken, int $numRows = false ) : void

Report SQL $query to debug system.

Parameters
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.

methodpublic_rollback(  $fname = false ) : void

Parameters
Name Type Description
$fname
methodpublic_selectOne(  $query,  $fname,  $error = false,  $debug = false,  $fetchCall ) : void

Parameters
Name Type Description
$query
$fname
$error
$debug
$fetchCall
methodpublic_selectOneAssoc(  $query,  $fname,  $error = false,  $debug = false ) : void

Parameters
Name Type Description
$query
$fname
$error
$debug
methodpublic_selectOneRow(  $query,  $fname,  $error = false,  $debug = false ) : void

Parameters
Name Type Description
$query
$fname
$error
$debug
methodpublic_sharedLock(  $filePath,  $fname = false ) : void

Parameters
Name Type Description
$filePath
$fname
methodpublic_sqlList(  $array ) : void

Parameters
Name Type Description
$array
methodpublic_startCacheGeneration( string $filePath,  $generatingFilePath ) : array

Attempts 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)

Parameters
Name Type Description
$filePath string
$generatingFilePath
Returns
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
methodpublic_store(  $filePath,  $datatype,  $scope,  $fname = false ) : void

Parameters
Name Type Description
$filePath
$datatype
$scope
$fname
methodpublic_storeContents(  $filePath,  $contents,  $scope,  $datatype,  $mtime = false,  $fname = false ) : void

Parameters
Name Type Description
$filePath
$contents
$scope
$datatype
$mtime
$fname
methodpublic_storeContentsInner(  $filePath,  $contents,  $scope,  $datatype,  $curTime,  $fname ) : void

Parameters
Name Type Description
$filePath
$contents
$scope
$datatype
$curTime
$fname
methodpublic_storeInner(  $filePath,  $datatype,  $scope,  $fname ) : void

Parameters
Name Type Description
$filePath
$datatype
$scope
$fname
methodpublic_verifyExclusiveLock( string $filePath, int $expiry, int $curtime, int $ttl, string $fname = false ) : bool

Uses a secondary database connection to check outside the transaction scope if a file has been generated during the current process execution

Parameters
Name Type Description
$filePath string
$expiry int
$curtime int
$ttl int
$fname string
Returns
Type Description
bool false if the file exists and is not expired, true otherwise
methodpublicexpiredFilesList( array $scopes, int $limit = array( 0, 100 ), int $expiry = false ) : \array(filepath)

Returns the list of expired files

Parameters
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.

Returns
Type Description
\array(filepath)
Details
Since
4.3  
methodpublicnameTrunk( string $filePath, string $scope ) : string
static

Returns the name_trunk for a file path

Parameters
Name Type Description
$filePath string
$scope string
Returns
Type Description
string
methodprivateremainingCacheGenerationTime(  $row ) : int

Returns the remaining time, in seconds, before the generating file times out

Parameters
Name Type Description
$row
Returns
Type Description
int Remaining generation seconds. A negative value indicates a timeout.
Documentation was generated by DocBlox 0.18.1.