Use autoload following the server pattern

9780472a02/lib/private/legacy/OC_App.php (L158)

Signed-off-by: Vitor Mattos <vitor@php.rio>
This commit is contained in:
Vitor Mattos 2023-05-25 11:29:34 -03:00
parent d0a80031f0
commit 43f7de0a4d
No known key found for this signature in database
GPG key ID: B7AB4B76A7CA7318
2 changed files with 25 additions and 1 deletions

25
composer/autoload.php Normal file
View file

@ -0,0 +1,25 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2023 Vitor Mattos <vitor@php.rio>
*
* @author Vitor Mattos <vitor@php.rio>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
require_once __DIR__ . '/../vendor/autoload.php';

View file

@ -36,7 +36,6 @@ class Application extends App implements IBootstrap {
}
public function register(IRegistrationContext $context): void {
include_once __DIR__ . '/../../vendor/autoload.php';
$context->registerMiddleWare(InjectionMiddleware::class);
$context->registerEventListener(LoadSidebar::class, LoadSidebarListener::class);