SetaPDF_Core_Reader_MaxFileHandler Class that handles SetaPDF_Core_Reader_MaxFile instances.

File: /SetaPDF v2/Core/Reader/MaxFileHandler.php

It is responsible for observing the open file handles and ensures that a specific limit is not reached by setting other instances into sleep-mode.

Class hierarchy

Summary

Properties

$_instances

$_maxOpenHandles

Maximum open handles

$_openHandles

Currently open handles.


Methods

__construct()

public SetaPDF_Core_Reader_MaxFileHandler::__construct (
[ int $maxOpenHandles = 1000 ]
)

The constructor.

Parameters
$maxOpenHandles : int
 

createReader()

Helper method to create a reader instance.

Parameters
$filename : string
 
Exceptions

Throws SetaPDF_Core_Reader_Exception

See

ensureFreeHandle()

Ensures a free handle.

getInstances()

Get all reader instances registered in this handler instance.

getMaxOpenHandles()

Get the maximum open handles.

getOpenHandles()

Get the currently opened handles count.

onHandleClosed()

Shall be triggered if a handle is closed.

onHandleOpened()

Shall be triggered if a handle is opened.

setMaxOpenHandles()

public SetaPDF_Core_Reader_MaxFileHandler::setMaxOpenHandles (
int $maxOpenHandles
): void

Set the maximum open handles.

Parameters
$maxOpenHandles : int