Encrypted
in package
implements
ISettingSource
Encrypted YAML setting source
Provides access to settings stored in encrypted YAML files. Used for storing sensitive configuration like database passwords, API keys, and other secrets.
Table of Contents
Interfaces
- ISettingSource
- Access to setting based services.
Properties
- $credentialsPath : string
- $encryptor : IEncryptor
- $fs : IFileSystem
- $keyPath : string
- $settings : array<string|int, mixed>
Methods
- __construct() : mixed
- get() : mixed
- getSection() : array<string|int, mixed>|null
- getSectionNames() : array<string|int, mixed>
- getSectionSettingNames() : array<string|int, mixed>
- save() : bool
- set() : ISettingSource
- getKey() : string|null
- Get the encryption key from file or environment
- loadSettings() : void
- Load and decrypt settings from the encrypted file
Properties
$credentialsPath
private
string
$credentialsPath
$encryptor
private
IEncryptor
$encryptor
$fs
private
IFileSystem
$fs
$keyPath
private
string
$keyPath
$settings
private
array<string|int, mixed>
$settings
= []
Methods
__construct()
public
__construct(string $credentialsPath, string $keyPath[, IEncryptor|null $encryptor = null ][, IFileSystem|null $fs = null ]) : mixed
Parameters
- $credentialsPath : string
-
Path to encrypted credentials file
- $keyPath : string
-
Path to encryption key file
- $encryptor : IEncryptor|null = null
-
Encryption implementation
- $fs : IFileSystem|null = null
-
File system implementation
Tags
get()
public
get(string $sectionName, string $name) : mixed
Parameters
- $sectionName : string
- $name : string
Tags
getSection()
public
getSection(string $sectionName) : array<string|int, mixed>|null
Parameters
- $sectionName : string
Tags
Return values
array<string|int, mixed>|nullgetSectionNames()
public
getSectionNames() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>getSectionSettingNames()
public
getSectionSettingNames(string $section) : array<string|int, mixed>
Parameters
- $section : string
Tags
Return values
array<string|int, mixed>save()
public
save() : bool
Tags
Return values
boolset()
public
set(string $sectionName, string $name, mixed $value) : ISettingSource
Parameters
- $sectionName : string
- $name : string
- $value : mixed
Tags
Return values
ISettingSourcegetKey()
Get the encryption key from file or environment
private
getKey() : string|null
Return values
string|null —The key, or null if not found
loadSettings()
Load and decrypt settings from the encrypted file
private
loadSettings() : void