Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix; Annotations 'ThriftBundle:Thrift:server' no longer work for S… #35

Merged
merged 2 commits into from
Aug 3, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 App\Kernel;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong class replace by Symfony\Component\HttpKernel\Kernel

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixing it right now.. thanks

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