\App\ConsoleModule\ModelsFeatureManager

Webapp's optional feature manager

Summary

Methods
Properties
Constants
__construct()
isEnabled()
hasUrl()
listEnabled()
listUrl()
setEnabled()
list()
No public properties found
DEFAULTS
read()
write()
No protected properties found
N/A
No private methods found
$path
$translator
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

$translator

$translator : \Nette\Localization\ITranslator

Type

\Nette\Localization\ITranslator — Translator

Methods

__construct()

__construct(string  $path, \Nette\Localization\ITranslator  $translator) : mixed

Constructor

Parameters

string $path

Path to the configuration file

\Nette\Localization\ITranslator $translator

ITranslator

Returns

mixed

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?

list()

list() : string[][]

Lists the optional features

Returns

string[][] —

Optional features

read()

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

Reads features configuration

Returns

array> —

Features configuration

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