Example #1
0
 public function configure(Container $container)
 {
     $container->register('console.application', function (Container $container) {
         $application = new Application();
         foreach (array_keys($container->getServiceIdsForTag('console.command')) as $serviceId) {
             $command = $container->get($serviceId);
             $application->add($command);
         }
         return $application;
     });
     $container->register('benchmark.runner', function (Container $container) {
         return new Runner($container->get('benchmark.collection_builder'), $container->get('benchmark.executor'), $container->getParameter('config_path'));
     });
     $container->register('benchmark.executor', function (Container $container) {
         return new Executor($container->get('benchmark.telespector'));
     });
     $container->register('benchmark.finder', function (Container $container) {
         return new Finder();
     });
     $container->register('benchmark.telespector', function (Container $container) {
         return new Telespector($container->hasParameter('bootstrap') ? $container->getParameter('bootstrap') : null, $container->getParameter('config_path'));
     });
     $container->register('benchmark.teleflector', function (Container $container) {
         return new Teleflector($container->get('benchmark.telespector'));
     });
     $container->register('benchmark.benchmark_builder', function (Container $container) {
         return new BenchmarkBuilder($container->get('benchmark.teleflector'), $container->get('benchmark.parser'));
     });
     $container->register('benchmark.parser', function (Container $container) {
         return new Parser();
     });
     $container->register('benchmark.collection_builder', function (Container $container) {
         return new CollectionBuilder($container->get('benchmark.benchmark_builder'), $container->get('benchmark.finder'), dirname($container->getParameter('config_path')));
     });
     $container->register('report.manager', function (Container $container) {
         return new ReportManager($container->get('json_schema.validator'));
     });
     $container->register('progress_logger.registry', function (Container $container) {
         return new ProgressLoggerRegistry();
     });
     $this->registerJsonSchema($container);
     $this->registerTabular($container);
     $this->registerCommands($container);
     $this->registerProgressLoggers($container);
     $this->registerReportGenerators($container);
     $container->mergeParameters(array('path' => null, 'reports' => array(), 'config_path' => null, 'progress_logger_name' => 'dots'));
 }