浏览代码

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

Jonathan H. Wage 15 年之前
父节点
当前提交
20cc9b9669
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      src/Symfony/Components/Console/Application.php
  2. 1 1
      src/Symfony/Components/Console/Command/Command.php

+ 1 - 1
src/Symfony/Components/Console/Application.php

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

+ 1 - 1
src/Symfony/Components/Console/Command/Command.php

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