1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Audioplayer |
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\audioplayer\AppInfo; |
13
|
|
|
|
14
|
|
|
use OCA\audioplayer\Listener\LoadAdditionalScripts; |
15
|
|
|
use OCA\audioplayer\Search\Provider; |
16
|
|
|
use OCA\Files\Event\LoadAdditionalScriptsEvent; |
|
|
|
|
17
|
|
|
use OCA\Files_Sharing\Event\BeforeTemplateRenderedEvent; |
|
|
|
|
18
|
|
|
use OCP\AppFramework\App; |
19
|
|
|
use OCP\AppFramework\Bootstrap\IBootContext; |
|
|
|
|
20
|
|
|
use OCP\AppFramework\Bootstrap\IBootstrap; |
|
|
|
|
21
|
|
|
use OCP\AppFramework\Bootstrap\IRegistrationContext; |
|
|
|
|
22
|
|
|
use OCP\Util; |
23
|
|
|
|
24
|
|
|
class Application extends App implements IBootstrap |
25
|
|
|
{ |
26
|
|
|
public const APP_ID = 'audioplayer'; |
27
|
|
|
|
28
|
|
|
public function __construct(array $urlParams = []) |
29
|
|
|
{ |
30
|
|
|
parent::__construct(self::APP_ID, $urlParams); |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
public function register(IRegistrationContext $context): void |
34
|
|
|
{ |
35
|
|
|
$context->registerEventListener(LoadAdditionalScriptsEvent::class, LoadAdditionalScripts::class); |
36
|
|
|
$context->registerEventListener(BeforeTemplateRenderedEvent::class, LoadAdditionalScripts::class); |
37
|
|
|
$context->registerSearchProvider(Provider::class); |
38
|
|
|
$this->registerNavigationEntry(); |
39
|
|
|
$this->registerFileHooks(); |
40
|
|
|
$this->registerUserHooks(); |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
protected function registerNavigationEntry(): void |
44
|
|
|
{ |
45
|
|
|
$navigationEntry = function () { |
46
|
|
|
return [ |
47
|
|
|
'id' => 'audioplayer', |
48
|
|
|
'order' => 6, |
49
|
|
|
'name' => \OC::$server->getL10N('audioplayer')->t('Audio Player'), |
50
|
|
|
'href' => \OC::$server->getURLGenerator()->linkToRoute('audioplayer.page.index'), |
51
|
|
|
'icon' => \OC::$server->getURLGenerator()->imagePath('audioplayer', 'app.svg'), |
52
|
|
|
]; |
53
|
|
|
}; |
54
|
|
|
\OC::$server->getNavigationManager()->add($navigationEntry); |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
protected function registerFileHooks() |
58
|
|
|
{ |
59
|
|
|
Util::connectHook( |
60
|
|
|
'OC_Filesystem', 'delete', '\OCA\audioplayer\Hooks\FileHooks', 'deleteTrack' |
61
|
|
|
); |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
protected function registerUserHooks() |
65
|
|
|
{ |
66
|
|
|
Util::connectHook( |
67
|
|
|
'OC_User', 'post_deleteUser', '\OCA\audioplayer\Hooks\UserHooks', 'deleteUser' |
68
|
|
|
); |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
public function boot(IBootContext $context): void |
72
|
|
|
{ |
73
|
|
|
} |
74
|
|
|
|
75
|
|
|
} |
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