2 Commits

Author SHA1 Message Date
bb74b56fc4 Armored getContextPath() 2016-11-01 15:32:53 +01:00
3cbf504aed Fixed bug in addCommands 2016-11-01 15:28:03 +01:00
2 changed files with 8 additions and 1 deletions

View File

@ -36,7 +36,7 @@ class Context
$handler = [ $this,$handler ];
}
// Add the command to the command list
$this->addCommand($handler);
$this->addCommand($command, $handler);
}
}

View File

@ -60,10 +60,17 @@ class Shell
public function getContextPath($separator=":")
{
// Return null if we don't have a current context
if (!$this->context)
return null;
// Assemble the contexts to walk
$stack = [ $this->context->getName() ];
foreach ($this->contextStack as $context) {
$stack[] = $context->getName();
}
// Reverse the order to make it more logical
$stack = array_reverse($stack);
return join($separator,$stack);
}