Neuron-PHP

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

$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
throws
Exception

If credentials cannot be decrypted

get()

public get(string $sectionName, string $name) : mixed
Parameters
$sectionName : string
$name : string
Tags
inheritDoc

getSection()

public getSection(string $sectionName) : array<string|int, mixed>|null
Parameters
$sectionName : string
Tags
inheritDoc
Return values
array<string|int, mixed>|null

getSectionNames()

public getSectionNames() : array<string|int, mixed>
Tags
inheritDoc
Return values
array<string|int, mixed>

getSectionSettingNames()

public getSectionSettingNames(string $section) : array<string|int, mixed>
Parameters
$section : string
Tags
inheritDoc
Return values
array<string|int, mixed>

save()

public save() : bool
Tags
inheritDoc

Re-encrypts and saves the current settings

Return values
bool

set()

public set(string $sectionName, string $name, mixed $value) : ISettingSource
Parameters
$sectionName : string
$name : string
$value : mixed
Tags
inheritDoc

Note: Setting values in encrypted source requires re-encryption This is typically done through SecretManager::edit() instead

Return values
ISettingSource

getKey()

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
Tags
throws
Exception

If file cannot be read or decrypted


        
On this page

Search results