Bugfixes and improvements to shell and context

This commit is contained in:
2016-11-02 13:53:56 +01:00
parent a2c1148c52
commit fe27eeb4a3
2 changed files with 29 additions and 1 deletions

View File

@ -35,8 +35,10 @@ class Shell
public function pushContext(Context $context)
{
if ($this->context) {
$context->setParent($this->context);
array_unshift($this->contextStack, $this->context);
}
$context->setShell($this);
$this->context = $context;
$this->dispatchEvent("context.update", [ "context"=>$this->context ]);
}
@ -173,7 +175,7 @@ class Shell
* Execute a command with arguments.
*
* @param string $command The command name to execute
* @param string.. $args Arguments
* @param string $args Arguments
* @return mixed
* @throws Exception\BadCommandExcception
*/