Skip to content

Commit

Permalink
Merge pull request #35 from farazive/0.9
Browse files Browse the repository at this point in the history
bugfix; Annotations 'ThriftBundle:Thrift:server' no longer work for S…
  • Loading branch information
mcg-web authored Aug 3, 2018
2 parents 22be5c7 + facfd0d commit ab1739d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Routing/ThriftRoutingLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Overblog\ThriftBundle\Routing;

use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\Loader;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
Expand All @@ -27,18 +28,23 @@ public function __construct($services)
/**
* Loads a resource.
*
* @param mixed $resource The resource
* @param string|null $type The resource type or null if unknown
* @param mixed $resource The resource
* @param string|null $type The resource type or null if unknown
*
* @return RouteCollection
* @throws \Exception If something went wrong
*/
public function load($resource, $type = null)
{
$controllerArg = Kernel::VERSION_ID > 40000 ?
'Overblog\ThriftBundle\Controller\ThriftController::serverAction' :
'ThriftBundle:Thrift:server';

$coll = new RouteCollection();
foreach ($this->services as $path => $service) {
$route = new Route(
'/'.$path,
['_controller' => 'ThriftBundle:Thrift:server', 'extensionName' => $path],
['_controller' => $controllerArg, 'extensionName' => $path],
[],
[],
null,
Expand Down

0 comments on commit ab1739d

Please sign in to comment.