\App\CoreModule\ModelsFeatureManager

Optional feature manager

Summary

Methods
Properties
Constants
__construct()
read()
edit()
get()
isEnabled()
hasUrl()
listEnabled()
listUrl()
setEnabled()
No public properties found
DEFAULTS
write()
No protected properties found
N/A
No private methods found
$path
N/A

Constants

DEFAULTS

DEFAULTS = ['docs' => ['enabled' => true, 'url' => 'https://docs.iqrf.org/iqrf-gateway/'], 'grafana' => ['enabled' => false, 'url' => '/grafana/'], 'networkManager' => ['enabled' => false], 'nodeRed' => ['enabled' => false, 'url' => '/node-red/'], 'pixla' => ['enabled' => false], 'ssh' => ['enabled' => false], 'supervisord' => ['enabled' => false, 'url' => 'supervisord/'], 'trUpload' => ['enabled' => false], 'updater' => ['enabled' => false], 'unattendedUpgrades' => ['enabled' => false], 'versionChecker' => ['enabled' => false]] : 

Default configuration

Properties

$path

$path : string

Type

normal — Path to the configuration file

Methods

__construct()

__construct(string  $path) : mixed

Constructor

Parameters

string $path

Path to the configuration file

Returns

mixed

read()

read() : array<string,array<string,bool|int|string>>

Reads features configuration

Returns

array> —

Features configuration

edit()

edit(string  $name, array<string,bool|int|string>  $config) : void

Edits feature configuration

Parameters

string $name

Feature name

array $config

Feature configuration

Throws

\App\CoreModule\Exceptions\FeatureNotFoundException
\Nette\IOException

get()

get(string  $name) : array<string,bool|int|string>

Returns feature configuration

Parameters

string $name

Feature name

Throws

\App\CoreModule\Exceptions\FeatureNotFoundException

Returns

array

Feature configuration

isEnabled()

isEnabled(string  $name) : bool

Checks if the feature is enabled

Parameters

string $name

Feature name

Throws

\App\CoreModule\Exceptions\FeatureNotFoundException

Returns

bool —

Is the feature enabled?

hasUrl()

hasUrl(string  $name) : bool

Checks if the feature has URL

Parameters

string $name

Feature name

Returns

bool —

Has the feature URL?

listEnabled()

listEnabled() : string[]

Lists enabled features

Returns

string[] —

Enabled features

listUrl()

listUrl() : array<string,string>

Lists URL of enabled features

Returns

array

Enabled features with URL

setEnabled()

setEnabled(string[]  $names, bool  $enabled = true) : void

Sets features enablement

Parameters

string[] $names

Feature names

bool $enabled

Are features enabled?

Throws

\Nette\IOException

write()

write(array<string,array<string,bool|int|string>>  $features) : void

Writes the features configuration

Parameters

array> $features

Feature configuration to write

Throws

\Nette\IOException