eZPublish  3.9
eZFSFileHandler Class Reference

Public Member Functions

 deleteLocal ()
 Deletes a file that has been fetched before. More...
 
 exists ()
 Check if given file/dir exists. More...
 
 eZFSFileHandler ($filePath=false)
 Constructor. More...
 
 fetch ()
 Fetches file from db and saves it in FS under the same name. More...
 
 fetchContents ()
 Returns file contents. More...
 
 fetchUnique ()
 Fetches file from db and saves it in FS under unique name. More...
 
 loadMetaData ($force=false)
 
 move ($dstPath)
 Move file. More...
 
 mtime ()
 Returns file modification time. More...
 
 name ()
 Returns file name. More...
 
 passthrough ()
 Outputs file contents prepending them with appropriate HTTP headers. More...
 
 size ()
 Returns file size. More...
 
 stat ()
 Returns file metadata. More...
 

Static Public Member Functions

 delete ()
 Deletes specified file/directory. More...
 
 fileCopy ($srcPath, $dstPath)
 Copy file. More...
 
 fileDelete ($path)
 
 fileDeleteByDirList ($dirList, $commonPath, $commonSuffix)
 Delete files located in a directories from dirList, with common prefix specified by commonPath, and common suffix with added wildcard at the end. More...
 
 fileDeleteByRegex ($dir, $fileRegex)
 Delete files matching regex $fileRegex under directory $dir. More...
 
 fileDeleteByWildcard ($wildcard)
 Delete files matching given wildcard. More...
 
 fileDeleteLocal ($path)
 Deletes a file that has been fetched before. More...
 
 fileExists ($path)
 Check if given file/dir exists. More...
 
 fileFetch ($filePath)
 Fetches file from db and saves it in FS under the same name. More...
 
 fileFetchContents ($filePath)
 Returns file contents. More...
 
 fileLinkCopy ($srcPath, $dstPath, $symLink)
 Create symbolic or hard link to file. More...
 
 fileMove ($srcPath, $dstPath)
 Move file. More...
 
 fileStore ($filePath, $scope=false, $delete=false, $datatype=false)
 Store file. More...
 
 fileStoreContents ($filePath, $contents, $scope=false, $datatype=false)
 Store file contents. More...
 
 storeContents ($contents, $scope=false, $datatype=false)
 Store file contents. More...
 

Public Attributes

 $metaData = null
 

Member Function Documentation

eZFSFileHandler::delete ( )
static

Deletes specified file/directory.

If a directory specified it is deleted recursively.

eZFSFileHandler::deleteLocal ( )

Deletes a file that has been fetched before.

In case of fetching from filesystem does nothing.

eZFSFileHandler::exists ( )

Check if given file/dir exists.

NOTE: this function does not interact with filesystem. Instead, it just returns existance status determined in the constructor.

eZFSFileHandler::eZFSFileHandler (   $filePath = false)

Constructor.

$filePath File path. If specified, file metadata is fetched in the constructor.

eZFSFileHandler::fetch ( )

Fetches file from db and saves it in FS under the same name.

In case of fetching from filesystem does nothing.

eZFSFileHandler::fetchContents ( )

Returns file contents.

Returns
contents string, or false in case of an error.
eZFSFileHandler::fetchUnique ( )

Fetches file from db and saves it in FS under unique name.

In case of fetching from filesystem does nothing.

eZFSFileHandler::fileCopy (   $srcPath,
  $dstPath 
)
static

Copy file.

eZFSFileHandler::fileDelete (   $path)
static
eZFSFileHandler::fileDeleteByDirList (   $dirList,
  $commonPath,
  $commonSuffix 
)
static

Delete files located in a directories from dirList, with common prefix specified by commonPath, and common suffix with added wildcard at the end.

See Also
fileDeleteByRegex()
eZFSFileHandler::fileDeleteByRegex (   $dir,
  $fileRegex 
)
static

Delete files matching regex $fileRegex under directory $dir.

See Also
fileDeleteByWildcard()
eZFSFileHandler::fileDeleteByWildcard (   $wildcard)
static

Delete files matching given wildcard.

Note that this method is faster than fileDeleteByRegex().

See Also
fileDeleteByRegex()
eZFSFileHandler::fileDeleteLocal (   $path)
static

Deletes a file that has been fetched before.

In case of fetching from filesystem does nothing.

eZFSFileHandler::fileExists (   $path)
static

Check if given file/dir exists.

eZFSFileHandler::fileFetch (   $filePath)
static

Fetches file from db and saves it in FS under the same name.

In case of fetching from filesystem does nothing.

eZFSFileHandler::fileFetchContents (   $filePath)
static

Returns file contents.

Returns
contents string, or false in case of an error.
eZFSFileHandler::fileLinkCopy (   $srcPath,
  $dstPath,
  $symLink 
)
static

Create symbolic or hard link to file.

eZFSFileHandler::fileMove (   $srcPath,
  $dstPath 
)
static

Move file.

eZFSFileHandler::fileStore (   $filePath,
  $scope = false,
  $delete = false,
  $datatype = false 
)
static

Store file.

In case of storing to filesystem does nothing.

Parameters
$filePathPath to the file being stored.
$scopeMeans something like "file category". May be used to clean caches of a certain type.
$deletetrue if the file should be deleted after storing.
eZFSFileHandler::fileStoreContents (   $filePath,
  $contents,
  $scope = false,
  $datatype = false 
)
static

Store file contents.

eZFSFileHandler::loadMetaData (   $force = false)

Load file meta information.

Parameters
$forceIf true, file stats will be refreshed

Referenced by eZFSFileHandler().

eZFSFileHandler::move (   $dstPath)

Move file.

eZFSFileHandler::mtime ( )

Returns file modification time.

eZFSFileHandler::name ( )

Returns file name.

eZFSFileHandler::passthrough ( )

Outputs file contents prepending them with appropriate HTTP headers.

eZFSFileHandler::size ( )

Returns file size.

eZFSFileHandler::stat ( )

Returns file metadata.

Referenced by loadMetaData().

eZFSFileHandler::storeContents (   $contents,
  $scope = false,
  $datatype = false 
)
static

Store file contents.

Member Data Documentation

eZFSFileHandler::$metaData = null

Referenced by stat().


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