| @@ 503-510 (lines=8) @@ | ||
| 500 | * @param string $name |
|
| 501 | * @param mixed $value |
|
| 502 | */ |
|
| 503 | function set($name, $value) |
|
| 504 | { |
|
| 505 | if (!Context::has()) { |
|
| 506 | Deployer::get()->config->set($name, $value); |
|
| 507 | } else { |
|
| 508 | Context::get()->getConfig()->set($name, $value); |
|
| 509 | } |
|
| 510 | } |
|
| 511 | ||
| 512 | /** |
|
| 513 | * Merge new config params to existing config array. |
|
| @@ 518-525 (lines=8) @@ | ||
| 515 | * @param string $name |
|
| 516 | * @param array $array |
|
| 517 | */ |
|
| 518 | function add($name, $array) |
|
| 519 | { |
|
| 520 | if (!Context::has()) { |
|
| 521 | Deployer::get()->config->add($name, $array); |
|
| 522 | } else { |
|
| 523 | Context::get()->getConfig()->add($name, $array); |
|
| 524 | } |
|
| 525 | } |
|
| 526 | ||
| 527 | /** |
|
| 528 | * Get configuration value. |
|
| @@ 534-541 (lines=8) @@ | ||
| 531 | * @param mixed|null $default |
|
| 532 | * @return mixed |
|
| 533 | */ |
|
| 534 | function get($name, $default = null) |
|
| 535 | { |
|
| 536 | if (!Context::has()) { |
|
| 537 | return Deployer::get()->config->get($name, $default); |
|
| 538 | } else { |
|
| 539 | return Context::get()->getConfig()->get($name, $default); |
|
| 540 | } |
|
| 541 | } |
|
| 542 | ||
| 543 | /** |
|
| 544 | * Check if there is such configuration option. |
|
| @@ 549-556 (lines=8) @@ | ||
| 546 | * @param string $name |
|
| 547 | * @return boolean |
|
| 548 | */ |
|
| 549 | function has($name) |
|
| 550 | { |
|
| 551 | if (!Context::has()) { |
|
| 552 | return Deployer::get()->config->has($name); |
|
| 553 | } else { |
|
| 554 | return Context::get()->getConfig()->has($name); |
|
| 555 | } |
|
| 556 | } |
|
| 557 | ||
| 558 | /** |
|
| 559 | * @param string $message |
|