瀏覽代碼

Add 'OCP\Files\IMimeTypeDetector' to DI container

* Added test to server container as well
tags/v9.0beta1
Roeland Jago Douma 8 年之前
父節點
當前提交
cd35ad6aaa
共有 2 個文件被更改,包括 6 次插入0 次删除
  1. 4
    0
      lib/private/appframework/dependencyinjection/dicontainer.php
  2. 2
    0
      tests/lib/server.php

+ 4
- 0
lib/private/appframework/dependencyinjection/dicontainer.php 查看文件

@@ -165,6 +165,10 @@ class DIContainer extends SimpleContainer implements IAppContainer {
$this->registerAlias('OCP\\AppFramework\\Utility\\IControllerMethodReflector', 'OC\AppFramework\Utility\ControllerMethodReflector');
$this->registerAlias('ControllerMethodReflector', 'OCP\\AppFramework\\Utility\\IControllerMethodReflector');

$this->registerService('OCP\\Files\\IMimeTypeDetector', function($c) {
return $this->getServer()->getMimeTypeDetector();
});

$this->registerService('OCP\\INavigationManager', function($c) {
return $this->getServer()->getNavigationManager();
});

+ 2
- 0
tests/lib/server.php 查看文件

@@ -94,6 +94,8 @@ class Server extends \Test\TestCase {
['HttpClientService', '\OCP\Http\Client\IClientService'],

['IniWrapper', '\bantu\IniGetWrapper\IniGetWrapper'],
['MimeTypeDetector', '\OCP\Files\IMimeTypeDetector'],
['MimeTypeDetector', '\OC\Files\Type\Detection'],

['JobList', '\OC\BackgroundJob\JobList'],
['JobList', '\OCP\BackgroundJob\IJobList'],

Loading…
取消
儲存