Skip to content
Snippets Groups Projects
Commit a2d1feb8 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

fixes #67

parent d5f7a6af
No related branches found
No related tags found
No related merge requests found
...@@ -22,7 +22,7 @@ abstract class GitlabController extends Controller ...@@ -22,7 +22,7 @@ abstract class GitlabController extends Controller
$this->setCache(StudipCacheFactory::getCache(), 'gitlab/'); $this->setCache(StudipCacheFactory::getCache(), 'gitlab/');
$this->gitlab_project_id = Config::get()->getValue('TRAC2GITLAB_GITLAB_PROJECT_ID'); $this->gitlab_project_id = Config::get()->getValue('TRAC2GITLAB_GITLAB_PROJECT_ID');
$this->gitlab = app(Client::class); $this->gitlab = app()->get(Client::class);
} }
protected function fetchAll(AbstractApi $api, string $method, array $parameters = []): array protected function fetchAll(AbstractApi $api, string $method, array $parameters = []): array
......
...@@ -9,17 +9,16 @@ abstract class Plugin extends StudIPPlugin ...@@ -9,17 +9,16 @@ abstract class Plugin extends StudIPPlugin
{ {
protected function setupDiContainer() protected function setupDiContainer()
{ {
$builder = new DI\ContainerBuilder(); $container = DIContainer::getInstance();
$builder->useAutowiring(false);
$builder->addDefinitions(__DIR__ . '/../bootstrap-definitions.php');
$container = $builder->build();
$combinedContainer = new CombinedContainer( $definitions = require __DIR__ . '/../bootstrap-definitions.php';
$container,
DIContainer::getInstance()
);
DIContainer::setInstance($combinedContainer); foreach ($definitions as $name => $value) {
if ($value instanceof \Closure) {
$value = $value($container);
}
$container->set($name, $value);
}
} }
public function perform($unconsumed_path) public function perform($unconsumed_path)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment