| @@ 548-555 (lines=8) @@ | ||
| 545 | * @param string $name |
|
| 546 | * @param mixed $value |
|
| 547 | */ |
|
| 548 | function set($name, $value) |
|
| 549 | { |
|
| 550 | if (!Context::has()) { |
|
| 551 | Deployer::get()->config->set($name, $value); |
|
| 552 | } else { |
|
| 553 | Context::get()->getConfig()->set($name, $value); |
|
| 554 | } |
|
| 555 | } |
|
| 556 | ||
| 557 | /** |
|
| 558 | * Merge new config params to existing config array. |
|
| @@ 563-570 (lines=8) @@ | ||
| 560 | * @param string $name |
|
| 561 | * @param array $array |
|
| 562 | */ |
|
| 563 | function add($name, $array) |
|
| 564 | { |
|
| 565 | if (!Context::has()) { |
|
| 566 | Deployer::get()->config->add($name, $array); |
|
| 567 | } else { |
|
| 568 | Context::get()->getConfig()->add($name, $array); |
|
| 569 | } |
|
| 570 | } |
|
| 571 | ||
| 572 | /** |
|
| 573 | * Get configuration value. |
|
| @@ 579-586 (lines=8) @@ | ||
| 576 | * @param mixed|null $default |
|
| 577 | * @return mixed |
|
| 578 | */ |
|
| 579 | function get($name, $default = null) |
|
| 580 | { |
|
| 581 | if (!Context::has()) { |
|
| 582 | return Deployer::get()->config->get($name, $default); |
|
| 583 | } else { |
|
| 584 | return Context::get()->getConfig()->get($name, $default); |
|
| 585 | } |
|
| 586 | } |
|
| 587 | ||
| 588 | /** |
|
| 589 | * Check if there is such configuration option. |
|
| @@ 594-601 (lines=8) @@ | ||
| 591 | * @param string $name |
|
| 592 | * @return boolean |
|
| 593 | */ |
|
| 594 | function has($name) |
|
| 595 | { |
|
| 596 | if (!Context::has()) { |
|
| 597 | return Deployer::get()->config->has($name); |
|
| 598 | } else { |
|
| 599 | return Context::get()->getConfig()->has($name); |
|
| 600 | } |
|
| 601 | } |
|
| 602 | ||
| 603 | /** |
|
| 604 | * @param string $message |
|