From 4a077e20c504f67353330e635d38bb4168ea9c85 Mon Sep 17 00:00:00 2001 From: f1nder Date: Wed, 29 Aug 2018 13:39:53 +0300 Subject: [PATCH] #fixes --- DependencyInjection/OverblogThriftExtension.php | 14 ++++++++++++++ Resources/config/services.yml | 14 +++++++------- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/DependencyInjection/OverblogThriftExtension.php b/DependencyInjection/OverblogThriftExtension.php index 39e5849..324a76a 100755 --- a/DependencyInjection/OverblogThriftExtension.php +++ b/DependencyInjection/OverblogThriftExtension.php @@ -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; @@ -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(); + } /** diff --git a/Resources/config/services.yml b/Resources/config/services.yml index bb5a628..ea67a01 100755 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -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