Skip to content

Commit ab1739d

Browse files
authored
Merge pull request #35 from farazive/0.9
bugfix; Annotations 'ThriftBundle:Thrift:server' no longer work for S…
2 parents 22be5c7 + facfd0d commit ab1739d

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Routing/ThriftRoutingLoader.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Overblog\ThriftBundle\Routing;
1313

14+
use Symfony\Component\HttpKernel\Kernel;
1415
use Symfony\Component\Config\Loader\Loader;
1516
use Symfony\Component\Routing\Route;
1617
use Symfony\Component\Routing\RouteCollection;
@@ -27,18 +28,23 @@ public function __construct($services)
2728
/**
2829
* Loads a resource.
2930
*
30-
* @param mixed $resource The resource
31-
* @param string|null $type The resource type or null if unknown
31+
* @param mixed $resource The resource
32+
* @param string|null $type The resource type or null if unknown
3233
*
34+
* @return RouteCollection
3335
* @throws \Exception If something went wrong
3436
*/
3537
public function load($resource, $type = null)
3638
{
39+
$controllerArg = Kernel::VERSION_ID > 40000 ?
40+
'Overblog\ThriftBundle\Controller\ThriftController::serverAction' :
41+
'ThriftBundle:Thrift:server';
42+
3743
$coll = new RouteCollection();
3844
foreach ($this->services as $path => $service) {
3945
$route = new Route(
4046
'/'.$path,
41-
['_controller' => 'ThriftBundle:Thrift:server', 'extensionName' => $path],
47+
['_controller' => $controllerArg, 'extensionName' => $path],
4248
[],
4349
[],
4450
null,

0 commit comments

Comments
 (0)