Changing how command names are parsed to allow multiple levels of namespaces

This commit is contained in:
Jonathan H. Wage 2010-04-16 13:19:23 -04:00 committed by Fabien Potencier
parent 0c78e9f121
commit 20cc9b9669
2 changed files with 2 additions and 2 deletions

View File

@ -496,7 +496,7 @@ class Application
{ {
// namespace // namespace
$namespace = ''; $namespace = '';
if (false !== $pos = strpos($name, ':')) if (false !== $pos = strrpos($name, ':'))
{ {
$namespace = $this->findNamespace(substr($name, 0, $pos)); $namespace = $this->findNamespace(substr($name, 0, $pos));
$name = substr($name, $pos + 1); $name = substr($name, $pos + 1);

View File

@ -282,7 +282,7 @@ class Command
*/ */
public function setName($name) public function setName($name)
{ {
if (false !== $pos = strpos($name, ':')) if (false !== $pos = strrpos($name, ':'))
{ {
$namespace = substr($name, 0, $pos); $namespace = substr($name, 0, $pos);
$name = substr($name, $pos + 1); $name = substr($name, $pos + 1);