Merge pull request #6449 from nextcloud/backport/6363/stable21

[stable21] Update bootstrap.rst
This commit is contained in:
Morris Jobke 2021-04-22 21:22:06 +02:00 committed by GitHub
commit 39a15f00b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,17 +54,23 @@ The class **must** extend ``OCP\AppFramework\App`` and may optionally implement
use OCA\MyApp\Listeners\UserDeletedListener;
use OCA\MyApp\Notifications\Notifier;
use OCP\AppFramework\App;
use OCP\AppFramework\Bootstrap\IBootContext;
use OCP\AppFramework\Bootstrap\IBootstrap;
use OCP\AppFramework\Bootstrap\IRegistrationContext;
use OCP\Notification\IManager;
use OCP\User\Events;
class Application extends App implements IBootstrap {
public function __construct() {
parent::__construct('myapp');
}
public function register(IRegistrationContext $context): void {
// ... registration logic goes here ...
// Register the composer autoloader for packages shipped by this app, if applicable
include_once __DIR__ . '/../../vendor/autoload.php'
include_once __DIR__ . '/../../vendor/autoload.php';
$context->registerEventListener(
BeforeUserDeletedEvent::class,