Added container service into application.

This commit is contained in:
Marco Vito Moscaritolo 2015-05-31 13:30:38 +02:00
parent 7e71e2ec7b
commit 601d42ea6e
2 changed files with 10 additions and 2 deletions

View file

@ -18,6 +18,7 @@ use b8\Http\Router;
use b8\View;
use PHPCI\Store\UserStore;
use PHPCI\Store\ProjectStore;
use Symfony\Component\DependencyInjection\Container;
/**
* PHPCI Front Controller
@ -40,13 +41,14 @@ class Application extends b8\Application
*/
protected $projectStore;
public function __construct(Config $config, Request $request, Response $response, UserStore $userStore, ProjectStore $projectStore)
public function __construct(Config $config, Request $request, Response $response, UserStore $userStore, ProjectStore $projectStore, Container $container)
{
$this->config = $config;
$this->response = $response;
$this->request = $request;
$this->userStore = $userStore;
$this->projectStore = $projectStore;
$this->container = $container;
$this->router = new Router($this, $this->request, $this->config);

View file

@ -40,7 +40,13 @@ services:
arguments: [%config_file%]
application:
class: PHPCI\Application
arguments: [@config, @http.request, @http.response, @storage.user, @storage.project]
arguments:
- @config
- @http.request
- @http.response
- @storage.user
- @storage.project
- @service_container
service.build:
class: PHPCI\Service\BuildService
arguments: [@storage.build]