浏览代码

Make use of SplFileInfo::getBasename

Victor Berchet 14 年之前
父节点
当前提交
9ffb1637b9
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/Symfony/Component/HttpKernel/Bundle/Bundle.php

+ 2 - 2
src/Symfony/Component/HttpKernel/Bundle/Bundle.php

@@ -121,7 +121,7 @@ abstract class Bundle extends ContainerAware implements BundleInterface
 
         $prefix = $this->namespacePrefix.'\\'.$this->name.'\\DependencyInjection';
         foreach ($finder as $file) {
-            $class = $prefix.strtr($file->getPath(), array($dir => '', '/' => '\\')).'\\'.basename($file, '.php');
+            $class = $prefix.strtr($file->getPath(), array($dir => '', '/' => '\\')).'\\'.$file->getBasename('.php');
 
             if ('Extension' === substr($class, -9)) {
                 $container->registerExtension(new $class());
@@ -150,7 +150,7 @@ abstract class Bundle extends ContainerAware implements BundleInterface
 
         $prefix = $this->namespacePrefix.'\\'.$this->name.'\\Command';
         foreach ($finder as $file) {
-            $r = new \ReflectionClass($prefix.strtr($file->getPath(), array($dir => '', '/' => '\\')).'\\'.basename($file, '.php'));
+            $r = new \ReflectionClass($prefix.strtr($file->getPath(), array($dir => '', '/' => '\\')).'\\'.$file->getBasename('.php'));
             if ($r->isSubclassOf('Symfony\\Component\\Console\\Command\\Command') && !$r->isAbstract()) {
                 $application->add($r->newInstance());
             }