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