setasign\SetaPDF2\Core\Writer

FileWriter A writer class for files or writable streams

File: /SetaPDF v2/Core/Writer/FileWriter.php
Old class name (alias): \SetaPDF_Core_Writer_File

Class hierarchy

Implements

Summary

Properties

$_handle

protected resource StreamWriter::$_handle

The file stream resource

$_path

protected string FileWriter::$_path

Path to the output file

$_status

protected string AbstractWriter::$_status = 0

Status property


Methods

__construct()

public FileWriter::__construct (
string $path
)

The constructor.

Parameters
$path : string

The path to the output file

_setHandle()

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

Set the stream handle.

Parameters
$handle : resource
 

cleanUp()

public FileWriter::cleanUp (
void
): void

Close the file handle if needed.

See

copy()

WARNING: This method is marked as deprecated!

Use copyStream() instead.

public StreamWriter::copy (
resource|\SetaPDF_Core_Writer_Stream $source
): void
Parameters
$source : resource|\SetaPDF_Core_Writer_Stream
 

copyStream()

public StreamWriter::copyStream (
resource|\SetaPDF_Core_Writer_Stream $source
): void

Copies an existing stream into the target stream.

Parameters
$source : resource|\SetaPDF_Core_Writer_Stream
 

finish()

public FileWriter::finish (
void
): void

This method is called when the writing process is finished.

It closes the file handle.

getHandle()

public FileWriter::getHandle (
void
): ?resource

Get the stream handle.

getPath()

public FileWriter::getPath (
void
): string

Get the file path of the writer.

getPos()

public StreamWriter::getPos (
void
): int

Returns the current position of the output file.

getStatus()

public AbstractWriter::getStatus (
void
): string

Get the current status of the writer object.

start()

public FileWriter::start (
void
): void

Method called when the writing process starts.

It setups the file handle for this writer.

write()

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

Write the content to the output file.

Parameters
$s : string