eZPublishCommunityProject(LegacyStack)  2013.6
eZDFSFileHandlerDFSBackend Class Reference

Public Member Functions

 __construct ()
 
 copyFromDFS ($srcFilePath, $dstFilePath=false)
 Copies the DFS file $srcFilePath to FS. More...
 
 copyFromDFSToDFS ($srcFilePath, $dstFilePath)
 Creates a copy of $srcFilePath from DFS to $dstFilePath on DFS. More...
 
 copyToDFS ($srcFilePath, $dstFilePath=false)
 Copies the local file $filePath to DFS under the same name, or a new name if specified. More...
 
 createFileOnDFS ($filePath, $contents)
 Creates the file $filePath on DFS with content $contents. More...
 
 delete ($filePath)
 Deletes one or more files from DFS. More...
 
 existsOnDFS ($filePath)
 Checks if a file exists on the DFS. More...
 
 getContents ($filePath)
 Returns the binary content of $filePath from DFS. More...
 
 getDfsFileSize ($filePath)
 Returns size of a file in the DFS backend, from a relative path. More...
 
 getMountPoint ()
 Returns the mount point. More...
 
 passthrough ($filePath, $startOffset=0, $length=false)
 Sends the contents of $filePath to default output. More...
 
 renameOnDFS ($oldPath, $newPath)
 Renamed DFS file $oldPath to DFS file $newPath. More...
 

Protected Member Functions

 accumulatorStart ()
 
 accumulatorStop ()
 
 createFile ($filePath, $contents, $atomic=true)
 
 fixPermissions ($filePath)
 
 makeDFSPath ($filePath)
 Computes the DFS file path based on a relative file path. More...
 

Protected Attributes

 $mountPointPath
 

Private Attributes

 $filePermissionMask
 

Constructor & Destructor Documentation

eZDFSFileHandlerDFSBackend::__construct ( )

Member Function Documentation

eZDFSFileHandlerDFSBackend::accumulatorStart ( )
protected
eZDFSFileHandlerDFSBackend::accumulatorStop ( )
protected
eZDFSFileHandlerDFSBackend::copyFromDFS (   $srcFilePath,
  $dstFilePath = false 
)

Copies the DFS file $srcFilePath to FS.

Parameters
string$srcFilePathSource file path (on DFS)
string$dstFilePathDestination file path (on FS). If not specified, $srcFilePath is used
Returns
bool
eZDFSFileHandlerDFSBackend::copyFromDFSToDFS (   $srcFilePath,
  $dstFilePath 
)

Creates a copy of $srcFilePath from DFS to $dstFilePath on DFS.

Parameters
string$srcFilePathLocal source file path
string$dstFilePathLocal destination file path
eZDFSFileHandlerDFSBackend::copyToDFS (   $srcFilePath,
  $dstFilePath = false 
)

Copies the local file $filePath to DFS under the same name, or a new name if specified.

Parameters
string$srcFilePathLocal file path to copy from
bool | string$dstFilePathOptional path to copy to. If not specified, $srcFilePath is used
Returns
bool
eZDFSFileHandlerDFSBackend::createFile (   $filePath,
  $contents,
  $atomic = true 
)
protected
eZDFSFileHandlerDFSBackend::createFileOnDFS (   $filePath,
  $contents 
)

Creates the file $filePath on DFS with content $contents.

Parameters
string$filePath
binary$contents
Returns
bool
eZDFSFileHandlerDFSBackend::delete (   $filePath)

Deletes one or more files from DFS.

Parameters
string | array$filePathSingle local filename, or array of local filenames
Returns
bool true if deletion was successful, false otherwise
Todo:
Improve error handling using exceptions
eZDFSFileHandlerDFSBackend::existsOnDFS (   $filePath)

Checks if a file exists on the DFS.

Parameters
string$filePath
Returns
bool
eZDFSFileHandlerDFSBackend::fixPermissions (   $filePath)
protected
eZDFSFileHandlerDFSBackend::getContents (   $filePath)

Returns the binary content of $filePath from DFS.

Parameters
string$filePathlocal file path
Returns
binary|bool file's content, or false
Todo:
Handle errors using exceptions
eZDFSFileHandlerDFSBackend::getDfsFileSize (   $filePath)

Returns size of a file in the DFS backend, from a relative path.

Parameters
string$filePathThe relative file path we want to get size of
Returns
int
eZDFSFileHandlerDFSBackend::getMountPoint ( )

Returns the mount point.

Returns
string
eZDFSFileHandlerDFSBackend::makeDFSPath (   $filePath)
protected

Computes the DFS file path based on a relative file path.

Parameters
string$filePath
Returns
string the absolute DFS file path

Referenced by copyFromDFS(), copyFromDFSToDFS(), copyToDFS(), createFileOnDFS(), delete(), existsOnDFS(), getContents(), getDfsFileSize(), passthrough(), and renameOnDFS().

eZDFSFileHandlerDFSBackend::passthrough (   $filePath,
  $startOffset = 0,
  $length = false 
)

Sends the contents of $filePath to default output.

Parameters
string$filePathFile path
int$startOffsetStarting offset
bool | int$lengthLength to transmit, false means everything
Returns
bool true, or false if operation failed
eZDFSFileHandlerDFSBackend::renameOnDFS (   $oldPath,
  $newPath 
)

Renamed DFS file $oldPath to DFS file $newPath.

Parameters
string$oldPath
string$newPath
Returns
bool

Member Data Documentation

eZDFSFileHandlerDFSBackend::$filePermissionMask
private
eZDFSFileHandlerDFSBackend::$mountPointPath
protected

Referenced by __construct(), and getMountPoint().


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