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