1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Analytics |
4
|
|
|
* |
5
|
|
|
* This file is licensed under the Affero General Public License version 3 or |
6
|
|
|
* later. See the LICENSE.md file. |
7
|
|
|
* |
8
|
|
|
* @author Marcel Scherello <[email protected]> |
9
|
|
|
* @copyright 2020 Marcel Scherello |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace OCA\Analytics\AppInfo; |
13
|
|
|
|
14
|
|
|
use OCA\Analytics\Dashboard\Widget; |
15
|
|
|
use OCA\Analytics\Flow\Operation; |
16
|
|
|
use OCA\Analytics\Notification\Notifier; |
17
|
|
|
use OCP\AppFramework\App; |
18
|
|
|
use OCP\AppFramework\Bootstrap\IBootContext; |
|
|
|
|
19
|
|
|
use OCP\AppFramework\Bootstrap\IBootstrap; |
|
|
|
|
20
|
|
|
use OCP\AppFramework\Bootstrap\IRegistrationContext; |
|
|
|
|
21
|
|
|
use OCP\AppFramework\QueryException; |
22
|
|
|
use OCP\EventDispatcher\IEventDispatcher; |
23
|
|
|
use OCP\IServerContainer; |
24
|
|
|
|
25
|
|
|
class Application20 extends App implements IBootstrap |
26
|
|
|
{ |
27
|
|
|
public const APP_ID = 'analytics'; |
28
|
|
|
|
29
|
|
|
/** @var IServerContainer */ |
30
|
|
|
private $server; |
31
|
|
|
|
32
|
|
|
public function __construct(array $urlParams = []) |
33
|
|
|
{ |
34
|
|
|
parent::__construct(self::APP_ID, $urlParams); |
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
public function register(IRegistrationContext $context): void |
38
|
|
|
{ |
39
|
|
|
$context->registerDashboardWidget(Widget::class); |
40
|
|
|
$this->registerNavigationEntry(); |
41
|
|
|
$this->registerNotifications(); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
protected function registerNavigationEntry(): void |
45
|
|
|
{ |
46
|
|
|
$navigationEntry = function () { |
47
|
|
|
return [ |
48
|
|
|
'id' => 'analytics', |
49
|
|
|
'order' => 6, |
50
|
|
|
'name' => \OC::$server->getL10N('analytics')->t('Analytics'), |
51
|
|
|
'href' => \OC::$server->getURLGenerator()->linkToRoute('analytics.page.index'), |
52
|
|
|
'icon' => \OC::$server->getURLGenerator()->imagePath('analytics', 'app.svg'), |
53
|
|
|
]; |
54
|
|
|
}; |
55
|
|
|
\OC::$server->getNavigationManager()->add($navigationEntry); |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
public function registerNotifications(): void |
59
|
|
|
{ |
60
|
|
|
$notificationManager = \OC::$server->getNotificationManager(); |
61
|
|
|
$notificationManager->registerNotifierService(Notifier::class); |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
public function boot(IBootContext $context): void |
65
|
|
|
{ |
66
|
|
|
|
67
|
|
|
$server = $this->getContainer()->getServer(); |
68
|
|
|
/** @var IEventDispatcher $dispatcher */ |
69
|
|
|
try { |
70
|
|
|
$dispatcher = $server->query(IEventDispatcher::class); |
71
|
|
|
} catch (QueryException $e) { |
|
|
|
|
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
Operation::register($dispatcher); |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
} |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths