remove missed manual Application instance constructions

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2019-11-04 19:25:00 +01:00
parent 5ca27085fc
commit ef2fb51065
No known key found for this signature in database
GPG Key ID: 42B69D8A64526EFB
12 changed files with 61 additions and 14 deletions

View File

@ -22,10 +22,12 @@ declare (strict_types = 1);
*
*/
$app = new \OCA\Accessibility\AppInfo\Application();
use OCA\Accessibility\AppInfo\Application;
$app = \OC::$server->query(Application::class);
// Separate from the constructor since the route are not initialized before that
// 1. create the app
// 2. generate css route and inject
$app->injectCss();
$app->injectJavascript();
$app->injectJavascript();

View File

@ -19,4 +19,6 @@
*
*/
$app = new \OCA\CloudFederationAPI\AppInfo\Application();
use OCA\CloudFederationAPI\AppInfo\Application;
\OC::$server->query(Application::class);

View File

@ -24,8 +24,9 @@
*/
use OCA\FederatedFileSharing\Notifier;
use OCA\FederatedFileSharing\AppInfo\Application;
$app = new \OCA\FederatedFileSharing\AppInfo\Application();
$app = \OC::$server->query(Application::class);
$eventDispatcher = \OC::$server->getEventDispatcher();
$manager = \OC::$server->getNotificationManager();

View File

@ -29,13 +29,14 @@
use OCA\Files_Sharing\ShareBackend\File;
use OCA\Files_Sharing\ShareBackend\Folder;
use OCA\Files_Sharing\AppInfo\Application;
\OCA\Files_Sharing\Helper::registerHooks();
\OC\Share\Share::registerBackend('file', File::class);
\OC\Share\Share::registerBackend('folder', Folder::class, 'file');
$application = new \OCA\Files_Sharing\AppInfo\Application();
$application = \OC::$server->query(Application::class);
$application->registerMountProviders();
$eventDispatcher = \OC::$server->getEventDispatcher();

View File

@ -19,5 +19,7 @@
*
*/
$app = new \OCA\LookupServerConnector\AppInfo\Application();
use OCA\LookupServerConnector\AppInfo\Application;
$app = \OC::$server->query(Application::class);
$app->register();

View File

@ -19,4 +19,6 @@
*
*/
$app = new \OCA\ShareByMail\AppInfo\Application();
use OCA\ShareByMail\AppInfo\Application;
$app = \OC::$server->query(Application::class);

View File

@ -39,9 +39,8 @@ $eventDispatcher->addListener(
);
$managerListener = function(ManagerEvent $event) {
$application = new \OCP\AppFramework\App('systemtags');
/** @var \OCA\SystemTags\Activity\Listener $listener */
$listener = $application->getContainer()->query(Listener::class);
$listener = \OC::$server->query(Listener::class);
$listener->event($event);
};
@ -52,7 +51,7 @@ $eventDispatcher->addListener(ManagerEvent::EVENT_UPDATE, $managerListener);
$mapperListener = function(MapperEvent $event) {
$application = new \OCP\AppFramework\App('systemtags');
/** @var \OCA\SystemTags\Activity\Listener $listener */
$listener = $application->getContainer()->query(Listener::class);
$listener = \OC::$server->query(Listener::class);
$listener->mapperEvent($event);
};

View File

@ -25,7 +25,9 @@
*
*/
$app = new \OCP\AppFramework\App('theming');
use OCA\Theming\AppInfo\Application;
$app = \OC::$server->query(Application::class);
$app->getContainer()->registerCapability(\OCA\Theming\Capabilities::class);
$linkToCSS = \OC::$server->getURLGenerator()->linkToRoute(

View File

@ -0,0 +1,28 @@
<?php
/**
* @copyright Copyright (c) 2019 Robin Appelman <robin@icewind.nl>
*
* @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/>.
*
*/
namespace OCA\Theming\AppInfo;
class Application extends \OCP\AppFramework\App {
public function __construct() {
parent::__construct('theming', []);
}
}

View File

@ -21,5 +21,7 @@
*
*/
$app = new \OCA\TwoFactorBackupCodes\AppInfo\Application();
use OCA\TwoFactorBackupCodes\AppInfo\Application;
$app = \OC::$server->query(Application::class);
$app->register();

View File

@ -21,5 +21,8 @@
*
*/
$app = new \OCA\UpdateNotification\AppInfo\Application();
use \OCA\UpdateNotification\AppInfo\Application;
/** @var Application $app */
$app = \OC::$server->query(Application::class);
$app->register();

View File

@ -19,6 +19,9 @@
*
*/
$application = new \OCA\WorkflowEngine\AppInfo\Application();
use \OCA\WorkflowEngine\AppInfo\Application;
/** @var Application $application */
$application = \OC::$server->query(Application::class);
$application->registerHooksAndListeners();
$application->registerRuleListeners();