Pair\Helpers\Options manages application options stored in database table options.
Pair\Helpers\Options
options
It is a singleton with typed casting and optional password encryption.
Options::get(string $name): mixed
Returns one option value.
Options::set(string $name, mixed $value): bool
Updates one option value in DB and in-memory cache.
Options::exists(string $name): bool
Options::getInstance(): Options
getAll(): array
refresh(): void
Password-type options can be encrypted/decrypted using OPTIONS_CRYPT_KEY from .env.
OPTIONS_CRYPT_KEY
.env
Helper:
isCryptAvailable(): bool
use Pair\Helpers\Options; $siteName = Options::get('site_name'); if (Options::exists('smtp_password')) { Options::set('smtp_password', 'new-secret'); } $all = Options::getInstance()->getAll();
PairException
int
bool
password
See also: Database, Configuration-file, Mailer.
There was an error while loading. Please reload this page.