mirror of
https://github.com/deployphp/deployer.git
synced 2025-02-24 09:12:51 +01:00
Merge pull request #1295 from kszymukowicz/callable_default_stage
Added possibility to use callable when setting 'default_stage'.
This commit is contained in:
commit
2e56bfad83
@ -3,7 +3,8 @@
|
||||
## master
|
||||
[v5.1.3...master](https://github.com/deployphp/deployer/compare/v5.1.3...master)
|
||||
|
||||
|
||||
### Added
|
||||
- Added possibility to use callable when setting 'default_stage'.
|
||||
|
||||
## v5.1.3
|
||||
[v5.1.2...v5.1.3](https://github.com/deployphp/deployer/compare/v5.1.2...v5.1.3)
|
||||
|
@ -116,7 +116,11 @@ class Deployer extends Container
|
||||
return new Task\ScriptManager($c['tasks']);
|
||||
};
|
||||
$this['hostSelector'] = function ($c) {
|
||||
return new Host\HostSelector($c['hosts'], $c['config']['default_stage']);
|
||||
$defaultStage = $c['config']['default_stage'];
|
||||
if (is_object($defaultStage) && ($defaultStage instanceof \Closure)) {
|
||||
$defaultStage = call_user_func($defaultStage);
|
||||
}
|
||||
return new Host\HostSelector($c['hosts'], $defaultStage);
|
||||
};
|
||||
$this['fail'] = function () {
|
||||
return new Collection();
|
||||
|
Loading…
x
Reference in New Issue
Block a user