eZPublish  3.8
eZFile Class Reference

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

Public Member Functions

 create ($filename, $directory=false, $data=false)
 
 eZFile ()
 

Static Public Member Functions

 download ($file, $isAttachedDownload=true, $overrideFilename=false)
 
 getContents ($filename)
 
 isWriteable ($filename)
 
 rename ($srcFile, $destFile)
 
 splitLines ($file)
 
 suffix ($filename)
 

Detailed Description

Tool class which has convencience functions for files and directories.

Member Function Documentation

eZFile::create (   $filename,
  $directory = false,
  $data = false 
)

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.

Referenced by eZMutex\clearMeta(), and eZMutex\setMeta().

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

Prepares a file for Download and terminates the execution.

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

Constructor

eZFile::getContents (   $filename)
static

Read all content of file.

Parameters
filename
Returns
file contents, false if error

Referenced by eZMutex\meta(), eZINI\parseFile(), eZDbSchema\read(), eZStepSiteTypes\retrieveRemotePackagesList(), and eZMutex\setMeta().

eZFile::isWriteable (   $filename)
static

Check if a given file is writeable

Returns
TRUE/FALSE

Referenced by eZSetupPrvtAreDirAndFilesWritable(), and eZSetupTestFilePermissions().

eZFile::rename (   $srcFile,
  $destFile 
)
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.

Referenced by eZMD5\checkMD5Sums().

eZFile::suffix (   $filename)
static

Get suffix from filename

Parameters
filename
Returns
suffix, extends: file/to/readme.txt return txt

Referenced by eZMediaType\insertRegularFile(), eZBinaryFileType\unserializeContentObjectAttribute(), and eZMediaType\unserializeContentObjectAttribute().


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