eZ Publish  [4.2]
eZFile Class Reference

Tool class which has convencience functions for files and directories. More...

List of all members.

Static Public Member Functions

static create ($filename, $directory=false, $data=false, $atomic=false)
static download ($file, $isAttachedDownload=true, $overrideFilename=false)
static getContents ($filename)
static isWriteable ($filename)
static rename ($srcFile, $destFile, $mkdir=false)
static splitLines ($file)
static suffix ($filename)

Detailed Description

Tool class which has convencience functions for files and directories.

Definition at line 40 of file ezfile.php.


Member Function Documentation

static eZFile::create ( filename,
directory = false,
data = false,
atomic = false 
) [static]

Creates a file called $filename. If $directory is specified the file is placed there, the directory will also be created if missing. if $data is specified the file will created with the content of this variable.

Parameters:
$atomicIf true the file contents will be written to a temporary file and renamed to the correct file.

Definition at line 69 of file ezfile.php.

Referenced by eZMutex\clearMeta(), eZDFSFileHandlerDFSBackend\copyFromDFS(), eZDFSFileHandlerDFSBackend\copyFromDFSToDFS(), eZDFSFileHandlerDFSBackend\copyToDFS(), eZDFSFileHandlerDFSBackend\createFileOnDFS(), eZFSFileHandler\fileStoreContents(), eZFileTransport\sendMail(), eZMutex\setMeta(), eZDBFileHandler\storeCache(), eZDFSFileHandler\storeCache(), eZDBFileHandler\storeContents(), eZDFSFileHandler\storeContents(), and eZFSFileHandler\storeContents().

static eZFile::download ( file,
isAttachedDownload = true,
overrideFilename = false 
) [static]

Prepares a file for Download and terminates the execution.

Parameters:
$fileFilename
$isAttachedDownloadDetermines weather to download the file as an attachment ( download popup box ) or not.
Returns:
false if error

Definition at line 210 of file ezfile.php.

static eZFile::getContents ( filename) [static]

Read all content of file.

Parameters:
filename
Returns:
file contents, false if error
Deprecated:
since eZ Publish 4.1, use file_get_contents() instead

Definition at line 120 of file ezfile.php.

static eZFile::isWriteable ( filename) [static]

Check if a given file is writeable

Returns:
TRUE/FALSE

Definition at line 160 of file ezfile.php.

static eZFile::rename ( srcFile,
destFile,
mkdir = false 
) [static]

Renames a file atomically on Unix, and provides a workaround for Windows

Parameters:
$srcFilefrom filename
$destFileto filename
$mkdirmake directory for dest file if needed
Returns:
rename status. ( true if successful, false if not )

Definition at line 187 of file ezfile.php.

Referenced by eZDBFileHandlerMysqlBackend\_fetch(), eZDFSFileHandlerMySQLBackend\_fetch(), eZMutex\clearMeta(), eZPHPCreator\close(), create(), eZFS2FileHandler\endCacheGeneration(), eZFileHandler\move(), eZWebDAVFileServer\move(), eZWebDAVFileServer\put(), eZSubtreeCache\renameDir(), eZDFSFileHandlerDFSBackend\renameOnDFS(), eZLog\rotateLog(), eZDebug\rotateLog(), eZINI\saveCache(), eZMutex\setMeta(), and eZStaticCache\storeCachedFile().

static eZFile::splitLines ( file) [static]

Reads the whole contents of the file $file and splits it into lines which is collected into an array and returned. It will handle Unix (
), Windows (
) and Mac () style newlines.

Note:
The newline character(s) are not present in the line string.

Definition at line 49 of file ezfile.php.

Referenced by eZMD5\checkMD5Sums().


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