spaceboy / nette-slalom
Make server-dependent configuration slalom easy and readable. Adapted for Nette framework configurator.
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/spaceboy/nette-slalom
Requires
- php: >=5.0.0
- spaceboy/config-slalom: dev-master
This package is auto-updated.
Last update: 2025-10-19 16:24:31 UTC
README
Do configuration magic easily in Nette!
Extension of Spaceboy\ConfigSlalom for Nette.
Installation:
Type
composer require spaceboy/nette-slalom
and that's all.
Example:
use Spaceboy\ConfigSlalom\NetteSlalom;
$configurator = NetteSlalom::run()
->when()
->serverNameIs('localhost')
->addConfig('config.local.neon')
->setDebugMode(TRUE)
->andContinue()
->when()
->serverNameIsIn(['localhost', 'farhost'])
->addConfig('config.farhost.neon')
->andContinue()
->when()
->serverNameNotMatches('^ocalhost$')
->addConfig('config.ocal.neon')
->otherwise()
->throw(new \Exception('Wrong server host.'))
->finally()
->addConfig('config.finally.neon')
->addParameters('finally', 'FOO')
->addParameters([
'finally1' => 'BAR',
'finally2' => 'BAZ',
])
->run();
$container = $configurator->createContainer();
return $container;
-
withConfigurator(Nette\Configurator $configurator): NetteSlalomStarts new configuration slalom with existing
$configurator. -
addDynamicParameters(array $parametersArray): NetteSlalomProvides an action.
Equal to
$configurator->addDynamicParameters($parametersArray). -
addConfig(string $config): NetteSlalomProvides an action.
Equal to
$configurator->addConfig($config). -
addParameters(array|string $parameters[, mixed $value]): NetteSlalomProvides an action.
Adds parameters to
$configurator.When first parameter is array, sets array of parameters.
When first parameter is string, parameter array is created as
array($firstParameter => secondParameter).Equal to
$configurator->addParameters($parameters). -
addServices(array $servicesArray): NetteSlalomProvides an action.
Adds a
$servicesArrayto$configurator.Equal to
$configurator->addServices($servicesArray). -
createRobotLoader(): NetteSlalomProvides an action.
Creates robot loader.
Equal to
$configurator->createRobotLoader(). -
enableDebugger([string $logDirectory[, string $email]]): NetteSlalomProvides an action.
Adds a
$configfile to$configurator.Equal to
$configurator->enableDebugger([$logDirectory[, $email]]). -
enableTracy([string $logDirectory[, string $email]]): NetteSlalomProvides an action.
Enables Tracy.
Equal to
$configurator->enableTracy([$logDirectory[, $email]]). -
setDebugMode(bool $mode): NetteSlalomProvides an action.
Sets DEBUG mode.
Equal to
$configurator->setDebugMode($mode).