SetaPDF_Core_Writer_TempFile A writer class for temporary files

File: /SetaPDF/Core/Writer/TempFile.php

Class hierarchy

Implements

Summary

Static Properties

$_filePrefix

static public string SetaPDF_Core_Writer_TempFile::$_filePrefix = '.htSetaPDF'

The file prefix for the temporary files

$_keepFile

static protected bool SetaPDF_Core_Writer_TempFile::$_keepFile = false

Defines if the temporary file should be deleted in the destruct method or not

$_tempDir

static public string|null SetaPDF_Core_Writer_TempFile::$_tempDir

A temporary directory path

$tempWriters

static public array SetaPDF_Core_Writer_TempFile::$tempWriters = array()

Temporary file writers.


Properties

$_writer

The internal file writer instance.


Static Methods

createTempFile()

static public string SetaPDF_Core_Writer_TempFile::createTempFile ( string $content )

Creates a temporary file and returns the temporary path to it.

Parameters
$content : string
 

createTempPath()

static public string SetaPDF_Core_Writer_TempFile::createTempPath ( [ null $tempDir = null [, null $filePrefix = null ]] )

Creates a temporary path.

If a parameters is left, the static class method (getTempDir() or getFilePrefix()) will be used to resolve the desired data.

Parameters
$tempDir : null
 
$filePrefix : null
 
Exceptions

Throws InvalidArgumentException

getFilePrefix()

static public string SetaPDF_Core_Writer_TempFile::getFilePrefix ( void )

Get the file prefix for temporary files.

getKeepFile()

static public bool SetaPDF_Core_Writer_TempFile::getKeepFile ( void )

Get whether files should be kept or deleted automatically when an instance is destructed.

getTempDir()

static public null|string SetaPDF_Core_Writer_TempFile::getTempDir ( void )

Get the current temporary directory path.

setFilePrefix()

static public void SetaPDF_Core_Writer_TempFile::setFilePrefix ( string $filePrefix )

Set the file prefix for temporary files.

Parameters
$filePrefix : string
 

setKeepFile()

static public void SetaPDF_Core_Writer_TempFile::setKeepFile ( bool $keepFile )

Set whether files should be kept or deleted automatically when an instance is destructed.

Parameters
$keepFile : bool
 

setTempDir()

static public void SetaPDF_Core_Writer_TempFile::setTempDir ( null|string $tempDir )

Set the temporary directory path.

Parameters
$tempDir : null|string
 
Exceptions

Throws InvalidArgumentException


Methods

__construct()

public SetaPDF_Core_Writer_TempFile::__construct ( [ null $tempDir = null [, null $filePrefix = null ]] )

The constructor.

Parameters
$tempDir : null
 
$filePrefix : null
 

__destruct()

public void SetaPDF_Core_Writer_TempFile::__destruct ( void )

The destructor.

This method deletes the temporary file. This behavior could be controlled by the setKeepFile()-method.

cleanUp()

public void SetaPDF_Core_Writer_TempFile::cleanUp ( void )

Proxy method.

See

finish()

public void SetaPDF_Core_Writer_TempFile::finish ( void )

Proxy method.

See

getPath()

public string SetaPDF_Core_Writer_TempFile::getPath ( void )

Get the path of the temporary file.

getPos()

public int SetaPDF_Core_Writer_TempFile::getPos ( void )

Proxy method.

See

getStatus()

public int|string SetaPDF_Core_Writer_TempFile::getStatus ( void )

Proxy method.

See

start()

public void SetaPDF_Core_Writer_TempFile::start ( void )

Proxy method.

See

write()

public void SetaPDF_Core_Writer_TempFile::write ( string $s )

Proxy method.

Parameters
$s : string
 
See