Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit 7042b18

Browse files
committed
Fix getting bundle path
$bundles array contains only classes, not objects, so we need to instantiate them before getting path. In $resouces 'type' cannot be equal to $extension, because YmlFileLoader checks for 'yaml' as type, not 'yml'.
1 parent 2c20b51 commit 7042b18

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

DependencyInjection/CmfRoutingAutoExtension.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,11 @@ protected function findMappingFiles($bundles)
5656
{
5757
$resources = array();
5858
foreach ($bundles as $bundle) {
59+
$obj = new $bundle;
5960
foreach (array('xml', 'yml') as $extension) {
60-
$path = $bundle->getPath().'/Resources/config/auto_routing.'.$extension;
61+
$path = $obj->getPath().'/Resources/config/auto_routing.'.$extension;
6162
if (file_exists($path)) {
62-
$resources[] = array('path' => $path, 'type' => $extension);
63+
$resources[] = array('path' => $path, 'type' => null);
6364
}
6465
}
6566
}

0 commit comments

Comments
 (0)