@@ 529-536 (lines=8) @@ | ||
526 | * @param string $name |
|
527 | * @param mixed $value |
|
528 | */ |
|
529 | function set($name, $value) |
|
530 | { |
|
531 | if (!Context::has()) { |
|
532 | Deployer::get()->config->set($name, $value); |
|
533 | } else { |
|
534 | Context::get()->getConfig()->set($name, $value); |
|
535 | } |
|
536 | } |
|
537 | ||
538 | /** |
|
539 | * Merge new config params to existing config array. |
|
@@ 544-551 (lines=8) @@ | ||
541 | * @param string $name |
|
542 | * @param array $array |
|
543 | */ |
|
544 | function add($name, $array) |
|
545 | { |
|
546 | if (!Context::has()) { |
|
547 | Deployer::get()->config->add($name, $array); |
|
548 | } else { |
|
549 | Context::get()->getConfig()->add($name, $array); |
|
550 | } |
|
551 | } |
|
552 | ||
553 | /** |
|
554 | * Get configuration value. |
|
@@ 560-567 (lines=8) @@ | ||
557 | * @param mixed|null $default |
|
558 | * @return mixed |
|
559 | */ |
|
560 | function get($name, $default = null) |
|
561 | { |
|
562 | if (!Context::has()) { |
|
563 | return Deployer::get()->config->get($name, $default); |
|
564 | } else { |
|
565 | return Context::get()->getConfig()->get($name, $default); |
|
566 | } |
|
567 | } |
|
568 | ||
569 | /** |
|
570 | * Check if there is such configuration option. |
|
@@ 575-582 (lines=8) @@ | ||
572 | * @param string $name |
|
573 | * @return boolean |
|
574 | */ |
|
575 | function has($name) |
|
576 | { |
|
577 | if (!Context::has()) { |
|
578 | return Deployer::get()->config->has($name); |
|
579 | } else { |
|
580 | return Context::get()->getConfig()->has($name); |
|
581 | } |
|
582 | } |
|
583 | ||
584 | /** |
|
585 | * @param string $message |