BlueSpice MediaWiki REL1_27
 All Classes Namespaces Files Functions Variables Groups Pages
FileBackendDBRepoWrapper Class Reference

Proxy backend that manages file layout rewriting for FileRepo. More...

Inheritance diagram for FileBackendDBRepoWrapper:
Collaboration diagram for FileBackendDBRepoWrapper:

Public Member Functions

 __construct (array $config)
 
 getInternalBackend ()
 
 getBackendPath ($path, $latest=true)
 
 getBackendPaths (array $paths, $latest=true)
 
 concatenate (array $params)
 
 fileExists (array $params)
 
 getFileTimestamp (array $params)
 
 getFileSize (array $params)
 
 getFileStat (array $params)
 
 getFileXAttributes (array $params)
 
 getFileSha1Base36 (array $params)
 
 getFileProps (array $params)
 
 streamFile (array $params)
 
 getFileContentsMulti (array $params)
 
 getLocalReferenceMulti (array $params)
 
 getLocalCopyMulti (array $params)
 
 getFileHttpUrl (array $params)
 
 directoryExists (array $params)
 
 getDirectoryList (array $params)
 
 getFileList (array $params)
 
 getFeatures ()
 
 clearCache (array $paths=null)
 
 preloadCache (array $paths)
 
 preloadFileStat (array $params)
 
 getScopedLocksForOps (array $ops, Status $status)
 
 getPathForSHA1 ($sha1)
 
- Public Member Functions inherited from FileBackend
 __construct (array $config)
 
 getName ()
 
 getWikiId ()
 
 isReadOnly ()
 
 getReadOnlyReason ()
 
 getFeatures ()
 
 hasFeatures ($bitfield)
 
 doOperations (array $ops, array $opts=[])
 
 doOperation (array $op, array $opts=[])
 
 create (array $params, array $opts=[])
 
 store (array $params, array $opts=[])
 
 copy (array $params, array $opts=[])
 
 move (array $params, array $opts=[])
 
 delete (array $params, array $opts=[])
 
 describe (array $params, array $opts=[])
 
 doQuickOperations (array $ops, array $opts=[])
 
 doQuickOperation (array $op)
 
 quickCreate (array $params)
 
 quickStore (array $params)
 
 quickCopy (array $params)
 
 quickMove (array $params)
 
 quickDelete (array $params)
 
 quickDescribe (array $params)
 
 concatenate (array $params)
 
 prepare (array $params)
 
 secure (array $params)
 
 publish (array $params)
 
 clean (array $params)
 
 fileExists (array $params)
 
 getFileTimestamp (array $params)
 
 getFileContents (array $params)
 
 getFileContentsMulti (array $params)
 
 getFileXAttributes (array $params)
 
 getFileSize (array $params)
 
 getFileStat (array $params)
 
 getFileSha1Base36 (array $params)
 
 getFileProps (array $params)
 
 streamFile (array $params)
 
 getLocalReference (array $params)
 
 getLocalReferenceMulti (array $params)
 
 getLocalCopy (array $params)
 
 getLocalCopyMulti (array $params)
 
 getFileHttpUrl (array $params)
 
 directoryExists (array $params)
 
 getDirectoryList (array $params)
 
 getTopDirectoryList (array $params)
 
 getFileList (array $params)
 
 getTopFileList (array $params)
 
 preloadCache (array $paths)
 
 clearCache (array $paths=null)
 
 preloadFileStat (array $params)
 
 lockFiles (array $paths, $type, $timeout=0)
 
 unlockFiles (array $paths, $type)
 
 getScopedFileLocks (array $paths, $type, Status $status, $timeout=0)
 
 getScopedLocksForOps (array $ops, Status $status)
 
 getRootStoragePath ()
 
 getContainerStoragePath ($container)
 
 getJournal ()
 

Protected Member Functions

 doOperationsInternal (array $ops, array $opts)
 
 doQuickOperationsInternal (array $ops)
 
 doPrepare (array $params)
 
 doSecure (array $params)
 
 doPublish (array $params)
 
 doClean (array $params)
 
 getDB ($index)
 
 translateSrcParams ($function, array $params)
 
 translateArrayResults ($function, array $params)
 
 mungeOpPaths (array $ops)
 
- Protected Member Functions inherited from FileBackend
 doOperationsInternal (array $ops, array $opts)
 
 doQuickOperationsInternal (array $ops)
 
 doPrepare (array $params)
 
 doSecure (array $params)
 
 doPublish (array $params)
 
 doClean (array $params)
 
 getScopedPHPBehaviorForOps ()
 
 resolveFSFileObjects (array $ops)
 

Protected Attributes

 $backend
 
 $repoName
 
 $dbHandleFunc
 
 $resolvedPathCache
 
 $dbs
 
- Protected Attributes inherited from FileBackend
 $name
 
 $wikiId
 
 $readOnly
 
 $parallelize
 
 $concurrency
 
 $lockManager
 
 $fileJournal
 

Additional Inherited Members

- Static Public Member Functions inherited from FileBackend
static isStoragePath ($path)
 
static splitStoragePath ($storagePath)
 
static normalizeStoragePath ($storagePath)
 
static parentStoragePath ($storagePath)
 
static extensionFromPath ($path, $case= 'lowercase')
 
static isPathTraversalFree ($path)
 
static makeContentDisposition ($type, $filename= '')
 
- Public Attributes inherited from FileBackend
const ATTR_HEADERS = 1
 
const ATTR_METADATA = 2
 
const ATTR_UNICODE_PATHS = 4
 
- Static Protected Member Functions inherited from FileBackend
static normalizeContainerPath ($path)
 

Detailed Description

Proxy backend that manages file layout rewriting for FileRepo.

LocalRepo may be configured to store files under their title names or by SHA-1. This acts as a shim in the later case, providing backwards compatability for most callers. All "public"/"deleted" zone files actually go in an "original" container and are never changed.

This requires something like thumb_handler.php and img_auth.php for client viewing of files.

Since
1.25

Member Function Documentation

FileBackendDBRepoWrapper::getBackendPath (   $path,
  $latest = true 
)

Translate a legacy "title" path to it's "sha1" counterpart

E.g. mwstore://local-backend/local-public/a/ab/<name>.jpg => mwstore://local-backend/local-original/x/y/z/<sha1>.jpg

Parameters
string$path
bool$latest
Returns
string
FileBackendDBRepoWrapper::getBackendPaths ( array  $paths,
  $latest = true 
)

Translate legacy "title" paths to their "sha1" counterparts

E.g. mwstore://local-backend/local-public/a/ab/<name>.jpg => mwstore://local-backend/local-original/x/y/z/<sha1>.jpg

Parameters
array$paths
bool$latest
Returns
array Translated paths in same order
FileBackendDBRepoWrapper::getDB (   $index)
protected

Get a connection to the repo file registry DB

Parameters
integer$index
Returns
DBConnRef
FileBackendDBRepoWrapper::getInternalBackend ( )

Get the underlying FileBackend that is being wrapped

Returns
FileBackend
FileBackendDBRepoWrapper::getPathForSHA1 (   $sha1)

Get the ultimate original storage path for a file

Use this when putting a new file into the system

Parameters
string$sha1File SHA-1 base36
Returns
string
FileBackendDBRepoWrapper::mungeOpPaths ( array  $ops)
protected

Translate legacy "title" source paths to their "sha1" counterparts

This leaves destination paths alone since we don't want those to mutate

Parameters
array$ops
Returns
array
FileBackendDBRepoWrapper::translateArrayResults (   $function,
array  $params 
)
protected

Translates paths when the backend function returns results keyed by paths

Parameters
string$function
array$params
Returns
array
FileBackendDBRepoWrapper::translateSrcParams (   $function,
array  $params 
)
protected

Translates paths found in the "src" or "srcs" keys of a params array

Parameters
string$function
array$params

The documentation for this class was generated from the following file: