migrate to new Nextcloud app bootstrap
This commit is contained in:
parent
e8dc6fb93e
commit
b6a3410dcf
|
@ -1,6 +0,0 @@
|
|||
<?php
|
||||
|
||||
use OCA\Notes\Application;
|
||||
|
||||
$app = \OC::$server->query(Application::class);
|
||||
$app->register();
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace OCA\Notes\AppInfo;
|
||||
|
||||
use OCP\AppFramework\App;
|
||||
use OCP\AppFramework\Bootstrap\IBootstrap;
|
||||
use OCP\AppFramework\Bootstrap\IBootContext;
|
||||
use OCP\AppFramework\Bootstrap\IRegistrationContext;
|
||||
|
||||
class Application extends App implements IBootstrap {
|
||||
public static $API_VERSIONS = [ '0.2', '1.1' ];
|
||||
|
||||
public function __construct(array $urlParams = []) {
|
||||
parent::__construct('notes', $urlParams);
|
||||
}
|
||||
|
||||
public function register(IRegistrationContext $context): void {
|
||||
$context->registerCapability(Capabilities::class);
|
||||
}
|
||||
|
||||
public function boot(IBootContext $context): void {
|
||||
$context->getAppContainer()->get(NotesHooks::class)->register();
|
||||
}
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace OCA\Notes;
|
||||
namespace OCA\Notes\AppInfo;
|
||||
|
||||
use OCP\Capabilities\ICapability;
|
||||
use OCP\App\IAppManager;
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace OCA\Notes;
|
||||
namespace OCA\Notes\AppInfo;
|
||||
|
||||
use OCA\Notes\Service\MetaService;
|
||||
|
||||
|
@ -27,7 +27,6 @@ class NotesHooks {
|
|||
}
|
||||
|
||||
public function register() : void {
|
||||
$this->logger->error('Register NotesHooks');
|
||||
$this->listenTo(
|
||||
$this->rootFolder,
|
||||
'\OC\Files',
|
|
@ -1,21 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace OCA\Notes;
|
||||
|
||||
use OCP\AppFramework\App;
|
||||
|
||||
class Application extends App {
|
||||
public static $API_VERSIONS = [ '0.2', '1.1' ];
|
||||
|
||||
public function __construct(array $urlParams = []) {
|
||||
parent::__construct('notes', $urlParams);
|
||||
}
|
||||
|
||||
public function register() : void {
|
||||
$container = $this->getContainer();
|
||||
$container->registerCapability(Capabilities::class);
|
||||
$container->query(NotesHooks::class)->register();
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace OCA\Notes\Controller;
|
||||
|
||||
use OCA\Notes\Application;
|
||||
use OCA\Notes\AppInfo\Application;
|
||||
use OCA\Notes\Service\Util;
|
||||
|
||||
use OCP\AppFramework\Http;
|
||||
|
|
Loading…
Reference in New Issue