eZPublish  4.4
eZFile Class Reference

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

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)
 
static splitLines ($file)
 Reads the whole contents of the file $file and splits it into lines which is collected into an array and returned. More...
 
static suffix ($filename)
 

Detailed Description

Tool class which has convencience functions for files and directories.

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.

Referenced by eZPackage\appendDocument(), eZMutex\clearMeta(), eZDFSFileHandlerDFSBackend\copyFromDFS(), eZDFSFileHandlerDFSBackend\copyFromDFSToDFS(), eZDFSFileHandlerDFSBackend\copyToDFS(), eZDFSFileHandlerDFSBackend\createFileOnDFS(), eZStepSiteTypes\downloadFile(), 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
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
static eZFile::isWriteable (   $filename)
static

Check if a given file is writeable

Returns
TRUE/FALSE

Referenced by eZSetupPrvtAreDirAndFilesWritable(), and eZSetupTestFilePermissions().

static eZFile::rename (   $srcFile,
  $destFile 
)
static
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.
Deprecated:
Since 4.4, use file( $file, FILE_IGNORE_NEW_LINES ) instead.
Returns
array|false

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