|
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\FlowOperation; |
|
16
|
|
|
use OCA\Analytics\Listener\LoadAdditionalScripts; |
|
17
|
|
|
use OCA\Analytics\Notification\Notifier; |
|
18
|
|
|
use OCA\Analytics\Search\Provider; |
|
19
|
|
|
use OCA\Files\Event\LoadAdditionalScriptsEvent; |
|
|
|
|
|
|
20
|
|
|
use OCP\AppFramework\App; |
|
21
|
|
|
use OCP\AppFramework\Bootstrap\IBootContext; |
|
22
|
|
|
use OCP\AppFramework\Bootstrap\IBootstrap; |
|
23
|
|
|
use OCP\AppFramework\Bootstrap\IRegistrationContext; |
|
24
|
|
|
|
|
25
|
|
|
class Application extends App implements IBootstrap |
|
26
|
|
|
{ |
|
27
|
|
|
public const APP_ID = 'analytics'; |
|
28
|
|
|
|
|
29
|
|
|
public function __construct(array $urlParams = []) |
|
30
|
|
|
{ |
|
31
|
|
|
parent::__construct(self::APP_ID, $urlParams); |
|
32
|
|
|
} |
|
33
|
|
|
|
|
34
|
|
|
public function register(IRegistrationContext $context): void |
|
35
|
|
|
{ |
|
36
|
|
|
$context->registerDashboardWidget(Widget::class); |
|
37
|
|
|
$context->registerEventListener(LoadAdditionalScriptsEvent::class, LoadAdditionalScripts::class); |
|
38
|
|
|
$context->registerSearchProvider(Provider::class); |
|
39
|
|
|
$this->registerNavigationEntry(); |
|
40
|
|
|
$this->registerNotifications(); |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
public function boot(IBootContext $context): void |
|
44
|
|
|
{ |
|
45
|
|
|
$this->getContainer()->query(FlowOperation::class)->register(); |
|
|
|
|
|
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
protected function registerNotifications(): void |
|
49
|
|
|
{ |
|
50
|
|
|
$notificationManager = \OC::$server->getNotificationManager(); |
|
51
|
|
|
$notificationManager->registerNotifierService(Notifier::class); |
|
52
|
|
|
} |
|
53
|
|
|
|
|
54
|
|
|
protected function registerNavigationEntry(): void |
|
55
|
|
|
{ |
|
56
|
|
|
$navigationEntry = function () { |
|
57
|
|
|
return [ |
|
58
|
|
|
'id' => 'analytics', |
|
59
|
|
|
'order' => 6, |
|
60
|
|
|
'name' => \OC::$server->getL10N('analytics')->t('Analytics'), |
|
61
|
|
|
'href' => \OC::$server->getURLGenerator()->linkToRoute('analytics.page.index'), |
|
62
|
|
|
'icon' => \OC::$server->getURLGenerator()->imagePath('analytics', 'app.svg'), |
|
63
|
|
|
]; |
|
64
|
|
|
}; |
|
65
|
|
|
\OC::$server->getNavigationManager()->add($navigationEntry); |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
|
|
} |
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