PHP Класс ParagonIE\Halite\HiddenString

The purpose of this class is to encapsulate strings and hide their contents from stack traces should an unhandled exception occur in a program that uses Halite. The only things that should be protected: - Passwords - Plaintext (before encryption) - Plaintext (after decryption) This library makes heavy use of return-type declarations, which are a PHP 7 only feature. Read more about them here:
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$disallowInline boolean Disallow the contents from being accessed via __toString()?
$disallowSerialization boolean Disallow the contents from being accessed via __sleep()?
$internalStringValue string

Открытые методы

Метод Описание
__construct ( string $value, boolean $disallowInline = false, boolean $disallowSerialization = false ) HiddenString constructor.
__debugInfo ( ) : array Hide its internal state from var_dump()
__destruct ( ) Wipe it from memory after it's been used.
__sleep ( ) : array
__toString ( ) : string Returns a copy of the string's internal value, which should be zeroed.
getString ( ) : string Explicit invocation -- get the raw string value

Описание методов

__construct() публичный Метод

HiddenString constructor.
public __construct ( string $value, boolean $disallowInline = false, boolean $disallowSerialization = false )
$value string
$disallowInline boolean
$disallowSerialization boolean

__debugInfo() публичный Метод

Hide its internal state from var_dump()
public __debugInfo ( ) : array
Результат array

__destruct() публичный Метод

Wipe it from memory after it's been used.
public __destruct ( )

__sleep() публичный Метод

public __sleep ( ) : array
Результат array

__toString() публичный Метод

Optionally, it can return an empty string.
public __toString ( ) : string
Результат string

getString() публичный Метод

Explicit invocation -- get the raw string value
public getString ( ) : string
Результат string

Описание свойств

$disallowInline защищенное свойство

Disallow the contents from being accessed via __toString()?
protected bool $disallowInline
Результат boolean

$disallowSerialization защищенное свойство

Disallow the contents from being accessed via __sleep()?
protected bool $disallowSerialization
Результат boolean

$internalStringValue защищенное свойство

protected string $internalStringValue
Результат string