Skip to content

Commit

Permalink
#fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
f1nder committed Aug 29, 2018
1 parent 390fe6e commit 4a077e2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
14 changes: 14 additions & 0 deletions DependencyInjection/OverblogThriftExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Overblog\ThriftBundle\DependencyInjection;

use Overblog\ThriftBundle\CacheWarmer\ThriftCompileCacheWarmer;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
Expand Down Expand Up @@ -44,6 +45,19 @@ public function load(array $configs, ContainerBuilder $container)
foreach ($config['clients'] as $name => $client) {
$this->loadClient($name, $client, $container, $config['testMode']);
}


$cacheDir = $container->getParameter('kernel.cache_dir');

$warmer = new ThriftCompileCacheWarmer(
$cacheDir,
$container->getParameter('kernel.root_dir'),
$container->getParameter('thrift.config.compiler.path'),
$container->getParameter('thrift.config.services')
);

$warmer->compile();

}

/**
Expand Down
14 changes: 7 additions & 7 deletions Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ services:
public: true
arguments: ['%thrift.config.services%']

thrift.classloader.listener:
arguments: ['%kernel.cache_dir%']
class: '%thrift.classloader.listener.class%'
public: true
tags:
- { name: kernel.event_listener, event: kernel.request, method: onKernelRequest, priority: 255 }
- { name: kernel.event_listener, event: console.command, method: onConsoleCommand, priority: 255 }
# thrift.classloader.listener:
# arguments: ['%kernel.cache_dir%']
# class: '%thrift.classloader.listener.class%'
# public: true
# tags:
# - { name: kernel.event_listener, event: kernel.request, method: onKernelRequest, priority: 255 }
# - { name: kernel.event_listener, event: console.command, method: onConsoleCommand, priority: 255 }

thrift.routing.loader:
class: Overblog\ThriftBundle\Routing\ThriftRoutingLoader
Expand Down

0 comments on commit 4a077e2

Please sign in to comment.