SetaPDF_Core_Writer_File A writer class for files or writable streams

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

Class hierarchy

Implements

Summary

Properties

$_handle

The file stream resource

$_path

protected string SetaPDF_Core_Writer_File::$_path

Path to the output file

$_status

Status property


Methods

__construct()

public SetaPDF_Core_Writer_File::__construct (
string $path
)

The constructor.

Parameters
$path : string

The path to the output file

_setHandle()

protected SetaPDF_Core_Writer_Stream::_setHandle (
resource $handle
): void

Set the stream handle.

Parameters
$handle : resource
 

cleanUp()

public SetaPDF_Core_Writer_File::cleanUp (
void
): void

Close the file handle if needed.

See

copy()

WARNING: This method is marked as deprecated!

Use copyStream() instead.

Parameters
$source : resource|SetaPDF_Core_Writer_Stream
 

copyStream()

Copies an existing stream into the target stream.

Parameters
$source : resource|SetaPDF_Core_Writer_Stream
 

finish()

public SetaPDF_Core_Writer_File::finish (
void
): void

This method is called when the writing process is finished.

It closes the file handle.

getHandle()

public SetaPDF_Core_Writer_File::getHandle (
void
): resource|null

Get the stream handle.

getPath()

public SetaPDF_Core_Writer_File::getPath (
void
): string

Get the file path of the writer.

getPos()

public SetaPDF_Core_Writer_Stream::getPos (
void
): integer

Returns the current position of the output file.

getStatus()

Get the current status of the writer object.

start()

public SetaPDF_Core_Writer_File::start (
void
): void

Method called when the writing process starts.

It setups the file handle for this writer.

write()

public SetaPDF_Core_Writer_Stream::write (
string $s
): void

Write the content to the output file.

Parameters
$s : string