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