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