com\setasign\SetaFramework\Registry

PersistantFile Class Persistant

File: /SetaFramework/src/Registry/PersistantFile.php

Class hierarchy

Implements

  • \Psr\Log\LoggerAwareInterface

Summary

Constants

LOCK_NONE

private const PersistantFile::LOCK_NONE = 0

LOCK_READ

private const PersistantFile::LOCK_READ = 2

LOCK_WRITE

private const PersistantFile::LOCK_WRITE = 1

Properties

$file

protected ?resource PersistantFile::$file

$filename

protected string PersistantFile::$filename

$lock

protected int PersistantFile::$lock

$logger

protected ?\Psr\Log\LoggerInterface PersistantFile::$logger

Methods

__construct()

public PersistantFile::__construct (
string $filename,
bool $create = false
)
Parameters
$filename : string
 
$create : bool

If no registry file exists, create a new file.

Exceptions

Throws \com\setasign\SetaFramework\Exception

__destruct()

public PersistantFile::__destruct (
void
): void

endRead()

public PersistantFile::endRead (
void
): void

hasReadLock()

public PersistantFile::hasReadLock (
void
): bool

Checks whether the registry has actual a read lock.

hasWriteLock()

public PersistantFile::hasWriteLock (
void
): bool

Checks whether the registry has actual a write lock.

read()

public PersistantFile::read (
callable $callback
): void
Parameters
$callback : callable

First param is the registry

Exceptions

Throws \Throwable

setLogger()

public PersistantFile::setLogger (
\Psr\Log\LoggerInterface $logger
): void

Sets a logger instance on the object.

Parameters
$logger : \Psr\Log\LoggerInterface
 

startRead()

write()

public PersistantFile::write (
callable $callback
): void
Parameters
$callback : callable

First param is the persistantRegistry

Exceptions

Throws \Throwable