, array{}>
- * @throws \OCP\PreConditionNotMetException
+ * @throws PreConditionNotMetException
* @throws DoesNotExistException
*
* 200: Changes dismissed
diff --git a/core/Migrations/Version14000Date20180626223656.php b/core/Migrations/Version14000Date20180626223656.php
index 8c3e81303bc9b..3a08fb45c20d3 100644
--- a/core/Migrations/Version14000Date20180626223656.php
+++ b/core/Migrations/Version14000Date20180626223656.php
@@ -6,10 +6,11 @@
namespace OC\Core\Migrations;
use OCP\DB\ISchemaWrapper;
+use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
class Version14000Date20180626223656 extends SimpleMigrationStep {
- public function changeSchema(\OCP\Migration\IOutput $output, \Closure $schemaClosure, array $options) {
+ public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
if (!$schema->hasTable('whats_new')) {
diff --git a/core/Migrations/Version14000Date20180712153140.php b/core/Migrations/Version14000Date20180712153140.php
index d719b0f803c96..4d27a60bbb493 100644
--- a/core/Migrations/Version14000Date20180712153140.php
+++ b/core/Migrations/Version14000Date20180712153140.php
@@ -6,6 +6,7 @@
namespace OC\Core\Migrations;
use OCP\DB\ISchemaWrapper;
+use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
/**
@@ -14,7 +15,7 @@
* Class Version14000Date20180712153140
*/
class Version14000Date20180712153140 extends SimpleMigrationStep {
- public function changeSchema(\OCP\Migration\IOutput $output, \Closure $schemaClosure, array $options) {
+ public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
diff --git a/core/ajax/update.php b/core/ajax/update.php
index 0868eff72b4cd..798a81ff6ee36 100644
--- a/core/ajax/update.php
+++ b/core/ajax/update.php
@@ -6,6 +6,8 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
use OC\DB\MigratorExecuteSqlEvent;
+use OC\Installer;
+use OC\IntegrityCheck\Checker;
use OC\Repair\Events\RepairAdvanceEvent;
use OC\Repair\Events\RepairErrorEvent;
use OC\Repair\Events\RepairFinishEvent;
@@ -13,6 +15,8 @@
use OC\Repair\Events\RepairStartEvent;
use OC\Repair\Events\RepairStepEvent;
use OC\Repair\Events\RepairWarningEvent;
+use OC\SystemConfig;
+use OC\Updater;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IAppConfig;
@@ -22,6 +26,8 @@
use OCP\IL10N;
use OCP\L10N\IFactory;
use OCP\Server;
+use OCP\ServerVersion;
+use OCP\Util;
use Psr\Log\LoggerInterface;
if (!str_contains(@ini_get('disable_functions'), 'set_time_limit')) {
@@ -30,10 +36,10 @@
require_once '../../lib/base.php';
-/** @var \OCP\IL10N $l */
-$l = \OC::$server->get(IFactory::class)->get('core');
+/** @var IL10N $l */
+$l = Server::get(IFactory::class)->get('core');
-$eventSource = \OC::$server->get(IEventSourceFactory::class)->create();
+$eventSource = Server::get(IEventSourceFactory::class)->create();
// need to send an initial message to force-init the event source,
// which will then trigger its own CSRF check and produces its own CSRF error
// message
@@ -77,8 +83,8 @@ public function handleRepairFeedback(Event $event): void {
}
}
-if (\OCP\Util::needUpgrade()) {
- $config = \OC::$server->getSystemConfig();
+if (Util::needUpgrade()) {
+ $config = Server::get(SystemConfig::class);
if ($config->getValue('upgrade.disable-web', false)) {
$eventSource->send('failure', $l->t('Please use the command line updater because updating via browser is disabled in your config.php.'));
$eventSource->close();
@@ -90,19 +96,19 @@ public function handleRepairFeedback(Event $event): void {
\OC_User::setIncognitoMode(true);
$config = Server::get(IConfig::class);
- $updater = new \OC\Updater(
- Server::get(\OCP\ServerVersion::class),
+ $updater = new Updater(
+ Server::get(ServerVersion::class),
$config,
Server::get(IAppConfig::class),
- \OC::$server->getIntegrityCodeChecker(),
+ Server::get(Checker::class),
Server::get(LoggerInterface::class),
- Server::get(\OC\Installer::class)
+ Server::get(Installer::class)
);
$incompatibleApps = [];
$incompatibleOverwrites = $config->getSystemValue('app_install_overwrite', []);
/** @var IEventDispatcher $dispatcher */
- $dispatcher = \OC::$server->get(IEventDispatcher::class);
+ $dispatcher = Server::get(IEventDispatcher::class);
$dispatcher->addListener(
MigratorExecuteSqlEvent::class,
function (MigratorExecuteSqlEvent $event) use ($eventSource, $l): void {
@@ -118,50 +124,50 @@ function (MigratorExecuteSqlEvent $event) use ($eventSource, $l): void {
$dispatcher->addListener(RepairWarningEvent::class, [$feedBack, 'handleRepairFeedback']);
$dispatcher->addListener(RepairErrorEvent::class, [$feedBack, 'handleRepairFeedback']);
- $updater->listen('\OC\Updater', 'maintenanceEnabled', function () use ($eventSource, $l) {
+ $updater->listen('\OC\Updater', 'maintenanceEnabled', function () use ($eventSource, $l): void {
$eventSource->send('success', $l->t('Turned on maintenance mode'));
});
- $updater->listen('\OC\Updater', 'maintenanceDisabled', function () use ($eventSource, $l) {
+ $updater->listen('\OC\Updater', 'maintenanceDisabled', function () use ($eventSource, $l): void {
$eventSource->send('success', $l->t('Turned off maintenance mode'));
});
- $updater->listen('\OC\Updater', 'maintenanceActive', function () use ($eventSource, $l) {
+ $updater->listen('\OC\Updater', 'maintenanceActive', function () use ($eventSource, $l): void {
$eventSource->send('success', $l->t('Maintenance mode is kept active'));
});
- $updater->listen('\OC\Updater', 'dbUpgradeBefore', function () use ($eventSource, $l) {
+ $updater->listen('\OC\Updater', 'dbUpgradeBefore', function () use ($eventSource, $l): void {
$eventSource->send('success', $l->t('Updating database schema'));
});
- $updater->listen('\OC\Updater', 'dbUpgrade', function () use ($eventSource, $l) {
+ $updater->listen('\OC\Updater', 'dbUpgrade', function () use ($eventSource, $l): void {
$eventSource->send('success', $l->t('Updated database'));
});
- $updater->listen('\OC\Updater', 'upgradeAppStoreApp', function ($app) use ($eventSource, $l) {
+ $updater->listen('\OC\Updater', 'upgradeAppStoreApp', function ($app) use ($eventSource, $l): void {
$eventSource->send('success', $l->t('Update app "%s" from App Store', [$app]));
});
- $updater->listen('\OC\Updater', 'appSimulateUpdate', function ($app) use ($eventSource, $l) {
+ $updater->listen('\OC\Updater', 'appSimulateUpdate', function ($app) use ($eventSource, $l): void {
$eventSource->send('success', $l->t('Checking whether the database schema for %s can be updated (this can take a long time depending on the database size)', [$app]));
});
- $updater->listen('\OC\Updater', 'appUpgrade', function ($app, $version) use ($eventSource, $l) {
+ $updater->listen('\OC\Updater', 'appUpgrade', function ($app, $version) use ($eventSource, $l): void {
$eventSource->send('success', $l->t('Updated "%1$s" to %2$s', [$app, $version]));
});
- $updater->listen('\OC\Updater', 'incompatibleAppDisabled', function ($app) use (&$incompatibleApps, &$incompatibleOverwrites) {
+ $updater->listen('\OC\Updater', 'incompatibleAppDisabled', function ($app) use (&$incompatibleApps, &$incompatibleOverwrites): void {
if (!in_array($app, $incompatibleOverwrites)) {
$incompatibleApps[] = $app;
}
});
- $updater->listen('\OC\Updater', 'failure', function ($message) use ($eventSource, $config) {
+ $updater->listen('\OC\Updater', 'failure', function ($message) use ($eventSource, $config): void {
$eventSource->send('failure', $message);
$eventSource->close();
$config->setSystemValue('maintenance', false);
});
- $updater->listen('\OC\Updater', 'setDebugLogLevel', function ($logLevel, $logLevelName) use ($eventSource, $l) {
+ $updater->listen('\OC\Updater', 'setDebugLogLevel', function ($logLevel, $logLevelName) use ($eventSource, $l): void {
$eventSource->send('success', $l->t('Set log level to debug'));
});
- $updater->listen('\OC\Updater', 'resetLogLevel', function ($logLevel, $logLevelName) use ($eventSource, $l) {
+ $updater->listen('\OC\Updater', 'resetLogLevel', function ($logLevel, $logLevelName) use ($eventSource, $l): void {
$eventSource->send('success', $l->t('Reset log level'));
});
- $updater->listen('\OC\Updater', 'startCheckCodeIntegrity', function () use ($eventSource, $l) {
+ $updater->listen('\OC\Updater', 'startCheckCodeIntegrity', function () use ($eventSource, $l): void {
$eventSource->send('success', $l->t('Starting code integrity check'));
});
- $updater->listen('\OC\Updater', 'finishedCheckCodeIntegrity', function () use ($eventSource, $l) {
+ $updater->listen('\OC\Updater', 'finishedCheckCodeIntegrity', function () use ($eventSource, $l): void {
$eventSource->send('success', $l->t('Finished code integrity check'));
});
diff --git a/core/register_command.php b/core/register_command.php
index 62305d75a30a2..a276cd58bfde4 100644
--- a/core/register_command.php
+++ b/core/register_command.php
@@ -8,150 +8,237 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
use OC\Core\Command;
+use OC\Core\Command\App\Disable;
+use OC\Core\Command\App\Enable;
+use OC\Core\Command\App\GetPath;
+use OC\Core\Command\App\Install;
+use OC\Core\Command\App\ListApps;
+use OC\Core\Command\App\Remove;
+use OC\Core\Command\App\Update;
+use OC\Core\Command\Background\Delete;
+use OC\Core\Command\Background\Job;
+use OC\Core\Command\Background\JobWorker;
+use OC\Core\Command\Background\ListCommand;
+use OC\Core\Command\Background\Mode;
+use OC\Core\Command\Broadcast\Test;
+use OC\Core\Command\Check;
+use OC\Core\Command\Config\App\DeleteConfig;
+use OC\Core\Command\Config\App\GetConfig;
+use OC\Core\Command\Config\App\SetConfig;
+use OC\Core\Command\Config\Import;
+use OC\Core\Command\Config\ListConfigs;
+use OC\Core\Command\Db\AddMissingColumns;
+use OC\Core\Command\Db\AddMissingIndices;
+use OC\Core\Command\Db\AddMissingPrimaryKeys;
+use OC\Core\Command\Db\ConvertFilecacheBigInt;
+use OC\Core\Command\Db\ConvertMysqlToMB4;
+use OC\Core\Command\Db\ConvertType;
+use OC\Core\Command\Db\ExpectedSchema;
+use OC\Core\Command\Db\ExportSchema;
+use OC\Core\Command\Db\Migrations\ExecuteCommand;
+use OC\Core\Command\Db\Migrations\GenerateCommand;
+use OC\Core\Command\Db\Migrations\GenerateMetadataCommand;
+use OC\Core\Command\Db\Migrations\MigrateCommand;
+use OC\Core\Command\Db\Migrations\PreviewCommand;
+use OC\Core\Command\Db\Migrations\StatusCommand;
+use OC\Core\Command\Encryption\ChangeKeyStorageRoot;
+use OC\Core\Command\Encryption\DecryptAll;
+use OC\Core\Command\Encryption\EncryptAll;
+use OC\Core\Command\Encryption\ListModules;
+use OC\Core\Command\Encryption\MigrateKeyStorage;
+use OC\Core\Command\Encryption\SetDefaultModule;
+use OC\Core\Command\Encryption\ShowKeyStorageRoot;
+use OC\Core\Command\FilesMetadata\Get;
+use OC\Core\Command\Group\AddUser;
+use OC\Core\Command\Group\RemoveUser;
+use OC\Core\Command\Info\File;
+use OC\Core\Command\Info\Space;
+use OC\Core\Command\Integrity\CheckApp;
+use OC\Core\Command\Integrity\CheckCore;
+use OC\Core\Command\Integrity\SignApp;
+use OC\Core\Command\Integrity\SignCore;
+use OC\Core\Command\L10n\CreateJs;
+use OC\Core\Command\Log\Manage;
+use OC\Core\Command\Maintenance\DataFingerprint;
+use OC\Core\Command\Maintenance\Mimetype\UpdateDB;
+use OC\Core\Command\Maintenance\Mimetype\UpdateJS;
+use OC\Core\Command\Maintenance\Repair;
+use OC\Core\Command\Maintenance\RepairShareOwnership;
+use OC\Core\Command\Maintenance\UpdateHtaccess;
+use OC\Core\Command\Maintenance\UpdateTheme;
+use OC\Core\Command\Memcache\RedisCommand;
+use OC\Core\Command\Preview\Generate;
+use OC\Core\Command\Preview\ResetRenderedTexts;
+use OC\Core\Command\Security\BruteforceAttempts;
+use OC\Core\Command\Security\BruteforceResetAttempts;
+use OC\Core\Command\Security\ExportCertificates;
+use OC\Core\Command\Security\ImportCertificate;
+use OC\Core\Command\Security\ListCertificates;
+use OC\Core\Command\Security\RemoveCertificate;
+use OC\Core\Command\SetupChecks;
+use OC\Core\Command\Status;
+use OC\Core\Command\SystemTag\Edit;
+use OC\Core\Command\TaskProcessing\EnabledCommand;
+use OC\Core\Command\TaskProcessing\GetCommand;
+use OC\Core\Command\TaskProcessing\Statistics;
+use OC\Core\Command\TwoFactorAuth\Cleanup;
+use OC\Core\Command\TwoFactorAuth\Enforce;
+use OC\Core\Command\TwoFactorAuth\State;
+use OC\Core\Command\Upgrade;
+use OC\Core\Command\User\Add;
+use OC\Core\Command\User\ClearGeneratedAvatarCacheCommand;
+use OC\Core\Command\User\Info;
+use OC\Core\Command\User\Keys\Verify;
+use OC\Core\Command\User\LastSeen;
+use OC\Core\Command\User\Report;
+use OC\Core\Command\User\ResetPassword;
+use OC\Core\Command\User\Setting;
+use OC\Core\Command\User\SyncAccountDataCommand;
+use OC\Core\Command\User\Welcome;
use OCP\IConfig;
use OCP\Server;
use Stecman\Component\Symfony\Console\BashCompletion\CompletionCommand;
$application->add(new CompletionCommand());
-$application->add(Server::get(Command\Status::class));
-$application->add(Server::get(Command\Check::class));
-$application->add(Server::get(Command\L10n\CreateJs::class));
-$application->add(Server::get(Command\Integrity\SignApp::class));
-$application->add(Server::get(Command\Integrity\SignCore::class));
-$application->add(Server::get(Command\Integrity\CheckApp::class));
-$application->add(Server::get(Command\Integrity\CheckCore::class));
+$application->add(Server::get(Status::class));
+$application->add(Server::get(Check::class));
+$application->add(Server::get(CreateJs::class));
+$application->add(Server::get(SignApp::class));
+$application->add(Server::get(SignCore::class));
+$application->add(Server::get(CheckApp::class));
+$application->add(Server::get(CheckCore::class));
$config = Server::get(IConfig::class);
if ($config->getSystemValueBool('installed', false)) {
- $application->add(Server::get(Command\App\Disable::class));
- $application->add(Server::get(Command\App\Enable::class));
- $application->add(Server::get(Command\App\Install::class));
- $application->add(Server::get(Command\App\GetPath::class));
- $application->add(Server::get(Command\App\ListApps::class));
- $application->add(Server::get(Command\App\Remove::class));
- $application->add(Server::get(Command\App\Update::class));
-
- $application->add(Server::get(Command\TwoFactorAuth\Cleanup::class));
- $application->add(Server::get(Command\TwoFactorAuth\Enforce::class));
+ $application->add(Server::get(Disable::class));
+ $application->add(Server::get(Enable::class));
+ $application->add(Server::get(Install::class));
+ $application->add(Server::get(GetPath::class));
+ $application->add(Server::get(ListApps::class));
+ $application->add(Server::get(Remove::class));
+ $application->add(Server::get(Update::class));
+
+ $application->add(Server::get(Cleanup::class));
+ $application->add(Server::get(Enforce::class));
$application->add(Server::get(Command\TwoFactorAuth\Enable::class));
$application->add(Server::get(Command\TwoFactorAuth\Disable::class));
- $application->add(Server::get(Command\TwoFactorAuth\State::class));
+ $application->add(Server::get(State::class));
- $application->add(Server::get(Command\Background\Mode::class));
- $application->add(Server::get(Command\Background\Job::class));
- $application->add(Server::get(Command\Background\ListCommand::class));
- $application->add(Server::get(Command\Background\Delete::class));
- $application->add(Server::get(Command\Background\JobWorker::class));
+ $application->add(Server::get(Mode::class));
+ $application->add(Server::get(Job::class));
+ $application->add(Server::get(ListCommand::class));
+ $application->add(Server::get(Delete::class));
+ $application->add(Server::get(JobWorker::class));
- $application->add(Server::get(Command\Broadcast\Test::class));
+ $application->add(Server::get(Test::class));
- $application->add(Server::get(Command\Config\App\DeleteConfig::class));
- $application->add(Server::get(Command\Config\App\GetConfig::class));
- $application->add(Server::get(Command\Config\App\SetConfig::class));
- $application->add(Server::get(Command\Config\Import::class));
- $application->add(Server::get(Command\Config\ListConfigs::class));
+ $application->add(Server::get(DeleteConfig::class));
+ $application->add(Server::get(GetConfig::class));
+ $application->add(Server::get(SetConfig::class));
+ $application->add(Server::get(Import::class));
+ $application->add(Server::get(ListConfigs::class));
$application->add(Server::get(Command\Config\System\DeleteConfig::class));
$application->add(Server::get(Command\Config\System\GetConfig::class));
$application->add(Server::get(Command\Config\System\SetConfig::class));
- $application->add(Server::get(Command\Info\File::class));
- $application->add(Server::get(Command\Info\Space::class));
+ $application->add(Server::get(File::class));
+ $application->add(Server::get(Space::class));
- $application->add(Server::get(Command\Db\ConvertType::class));
- $application->add(Server::get(Command\Db\ConvertMysqlToMB4::class));
- $application->add(Server::get(Command\Db\ConvertFilecacheBigInt::class));
- $application->add(Server::get(Command\Db\AddMissingColumns::class));
- $application->add(Server::get(Command\Db\AddMissingIndices::class));
- $application->add(Server::get(Command\Db\AddMissingPrimaryKeys::class));
- $application->add(Server::get(Command\Db\ExpectedSchema::class));
- $application->add(Server::get(Command\Db\ExportSchema::class));
+ $application->add(Server::get(ConvertType::class));
+ $application->add(Server::get(ConvertMysqlToMB4::class));
+ $application->add(Server::get(ConvertFilecacheBigInt::class));
+ $application->add(Server::get(AddMissingColumns::class));
+ $application->add(Server::get(AddMissingIndices::class));
+ $application->add(Server::get(AddMissingPrimaryKeys::class));
+ $application->add(Server::get(ExpectedSchema::class));
+ $application->add(Server::get(ExportSchema::class));
- $application->add(Server::get(Command\Db\Migrations\GenerateMetadataCommand::class));
- $application->add(Server::get(Command\Db\Migrations\PreviewCommand::class));
+ $application->add(Server::get(GenerateMetadataCommand::class));
+ $application->add(Server::get(PreviewCommand::class));
if ($config->getSystemValueBool('debug', false)) {
- $application->add(Server::get(Command\Db\Migrations\StatusCommand::class));
- $application->add(Server::get(Command\Db\Migrations\MigrateCommand::class));
- $application->add(Server::get(Command\Db\Migrations\GenerateCommand::class));
- $application->add(Server::get(Command\Db\Migrations\ExecuteCommand::class));
+ $application->add(Server::get(StatusCommand::class));
+ $application->add(Server::get(MigrateCommand::class));
+ $application->add(Server::get(GenerateCommand::class));
+ $application->add(Server::get(ExecuteCommand::class));
}
$application->add(Server::get(Command\Encryption\Disable::class));
$application->add(Server::get(Command\Encryption\Enable::class));
- $application->add(Server::get(Command\Encryption\ListModules::class));
- $application->add(Server::get(Command\Encryption\SetDefaultModule::class));
+ $application->add(Server::get(ListModules::class));
+ $application->add(Server::get(SetDefaultModule::class));
$application->add(Server::get(Command\Encryption\Status::class));
- $application->add(Server::get(Command\Encryption\EncryptAll::class));
- $application->add(Server::get(Command\Encryption\DecryptAll::class));
+ $application->add(Server::get(EncryptAll::class));
+ $application->add(Server::get(DecryptAll::class));
- $application->add(Server::get(Command\Log\Manage::class));
+ $application->add(Server::get(Manage::class));
$application->add(Server::get(Command\Log\File::class));
- $application->add(Server::get(Command\Encryption\ChangeKeyStorageRoot::class));
- $application->add(Server::get(Command\Encryption\ShowKeyStorageRoot::class));
- $application->add(Server::get(Command\Encryption\MigrateKeyStorage::class));
+ $application->add(Server::get(ChangeKeyStorageRoot::class));
+ $application->add(Server::get(ShowKeyStorageRoot::class));
+ $application->add(Server::get(MigrateKeyStorage::class));
- $application->add(Server::get(Command\Maintenance\DataFingerprint::class));
- $application->add(Server::get(Command\Maintenance\Mimetype\UpdateDB::class));
- $application->add(Server::get(Command\Maintenance\Mimetype\UpdateJS::class));
+ $application->add(Server::get(DataFingerprint::class));
+ $application->add(Server::get(UpdateDB::class));
+ $application->add(Server::get(UpdateJS::class));
$application->add(Server::get(Command\Maintenance\Mode::class));
- $application->add(Server::get(Command\Maintenance\UpdateHtaccess::class));
- $application->add(Server::get(Command\Maintenance\UpdateTheme::class));
+ $application->add(Server::get(UpdateHtaccess::class));
+ $application->add(Server::get(UpdateTheme::class));
- $application->add(Server::get(Command\Upgrade::class));
- $application->add(Server::get(Command\Maintenance\Repair::class));
- $application->add(Server::get(Command\Maintenance\RepairShareOwnership::class));
+ $application->add(Server::get(Upgrade::class));
+ $application->add(Server::get(Repair::class));
+ $application->add(Server::get(RepairShareOwnership::class));
$application->add(Server::get(Command\Preview\Cleanup::class));
- $application->add(Server::get(Command\Preview\Generate::class));
+ $application->add(Server::get(Generate::class));
$application->add(Server::get(Command\Preview\Repair::class));
- $application->add(Server::get(Command\Preview\ResetRenderedTexts::class));
+ $application->add(Server::get(ResetRenderedTexts::class));
- $application->add(Server::get(Command\User\Add::class));
+ $application->add(Server::get(Add::class));
$application->add(Server::get(Command\User\Delete::class));
$application->add(Server::get(Command\User\Disable::class));
$application->add(Server::get(Command\User\Enable::class));
- $application->add(Server::get(Command\User\LastSeen::class));
- $application->add(Server::get(Command\User\Report::class));
- $application->add(Server::get(Command\User\ResetPassword::class));
- $application->add(Server::get(Command\User\Setting::class));
+ $application->add(Server::get(LastSeen::class));
+ $application->add(Server::get(Report::class));
+ $application->add(Server::get(ResetPassword::class));
+ $application->add(Server::get(Setting::class));
$application->add(Server::get(Command\User\ListCommand::class));
- $application->add(Server::get(Command\User\ClearGeneratedAvatarCacheCommand::class));
- $application->add(Server::get(Command\User\Info::class));
- $application->add(Server::get(Command\User\SyncAccountDataCommand::class));
+ $application->add(Server::get(ClearGeneratedAvatarCacheCommand::class));
+ $application->add(Server::get(Info::class));
+ $application->add(Server::get(SyncAccountDataCommand::class));
$application->add(Server::get(Command\User\AuthTokens\Add::class));
$application->add(Server::get(Command\User\AuthTokens\ListCommand::class));
$application->add(Server::get(Command\User\AuthTokens\Delete::class));
- $application->add(Server::get(Command\User\Keys\Verify::class));
- $application->add(Server::get(Command\User\Welcome::class));
+ $application->add(Server::get(Verify::class));
+ $application->add(Server::get(Welcome::class));
$application->add(Server::get(Command\Group\Add::class));
$application->add(Server::get(Command\Group\Delete::class));
$application->add(Server::get(Command\Group\ListCommand::class));
- $application->add(Server::get(Command\Group\AddUser::class));
- $application->add(Server::get(Command\Group\RemoveUser::class));
+ $application->add(Server::get(AddUser::class));
+ $application->add(Server::get(RemoveUser::class));
$application->add(Server::get(Command\Group\Info::class));
$application->add(Server::get(Command\SystemTag\ListCommand::class));
$application->add(Server::get(Command\SystemTag\Delete::class));
$application->add(Server::get(Command\SystemTag\Add::class));
- $application->add(Server::get(Command\SystemTag\Edit::class));
-
- $application->add(Server::get(Command\Security\ListCertificates::class));
- $application->add(Server::get(Command\Security\ExportCertificates::class));
- $application->add(Server::get(Command\Security\ImportCertificate::class));
- $application->add(Server::get(Command\Security\RemoveCertificate::class));
- $application->add(Server::get(Command\Security\BruteforceAttempts::class));
- $application->add(Server::get(Command\Security\BruteforceResetAttempts::class));
- $application->add(Server::get(Command\SetupChecks::class));
- $application->add(Server::get(Command\FilesMetadata\Get::class));
-
- $application->add(Server::get(Command\TaskProcessing\GetCommand::class));
- $application->add(Server::get(Command\TaskProcessing\EnabledCommand::class));
+ $application->add(Server::get(Edit::class));
+
+ $application->add(Server::get(ListCertificates::class));
+ $application->add(Server::get(ExportCertificates::class));
+ $application->add(Server::get(ImportCertificate::class));
+ $application->add(Server::get(RemoveCertificate::class));
+ $application->add(Server::get(BruteforceAttempts::class));
+ $application->add(Server::get(BruteforceResetAttempts::class));
+ $application->add(Server::get(SetupChecks::class));
+ $application->add(Server::get(Get::class));
+
+ $application->add(Server::get(GetCommand::class));
+ $application->add(Server::get(EnabledCommand::class));
$application->add(Server::get(Command\TaskProcessing\ListCommand::class));
- $application->add(Server::get(Command\TaskProcessing\Statistics::class));
+ $application->add(Server::get(Statistics::class));
- $application->add(Server::get(Command\Memcache\RedisCommand::class));
+ $application->add(Server::get(RedisCommand::class));
} else {
$application->add(Server::get(Command\Maintenance\Install::class));
}
diff --git a/core/strings.php b/core/strings.php
index 3feab3af88859..a4bd2007b3b39 100644
--- a/core/strings.php
+++ b/core/strings.php
@@ -2,13 +2,15 @@
declare(strict_types=1);
+use OCP\Util;
+
/**
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2011-2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-only
*/
//some strings that are used in /lib but won't be translatable unless they are in /core too
-$l = \OCP\Util::getL10N('core');
+$l = Util::getL10N('core');
$l->t('Personal');
$l->t('Accounts');
$l->t('Apps');
diff --git a/core/templates/403.php b/core/templates/403.php
index 091db720b168d..17866e670afa6 100644
--- a/core/templates/403.php
+++ b/core/templates/403.php
@@ -8,7 +8,7 @@
if (!isset($_)) {//standalone page is not supported anymore - redirect to /
require_once '../../lib/base.php';
- $urlGenerator = \OC::$server->getURLGenerator();
+ $urlGenerator = \OCP\Server::get(\OCP\IURLGenerator::class);
header('Location: ' . $urlGenerator->getAbsoluteURL('/'));
exit;
}
diff --git a/core/templates/404.php b/core/templates/404.php
index d2dc10f9aa8a9..3dcce4d26d3bb 100644
--- a/core/templates/404.php
+++ b/core/templates/404.php
@@ -11,7 +11,7 @@
if (!isset($_)) {//standalone page is not supported anymore - redirect to /
require_once '../../lib/base.php';
- $urlGenerator = \OC::$server->getURLGenerator();
+ $urlGenerator = \OCP\Server::get(\OCP\IURLGenerator::class);
header('Location: ' . $urlGenerator->getAbsoluteURL('/'));
exit;
}
@@ -24,7 +24,7 @@
t('Page not found')); ?>
t('The page could not be found on the server or you may not be allowed to view it.')); ?>
-
+
t('Back to %s', [$theme->getName()])); ?>
diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php
index 2998727ee8d0a..47cced308bcbf 100644
--- a/core/templates/layout.user.php
+++ b/core/templates/layout.user.php
@@ -11,7 +11,7 @@
*/
$getUserAvatar = static function (int $size) use ($_): string {
- return \OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', [
+ return \OCP\Server::get(\OCP\IURLGenerator::class)->linkToRoute('core.avatar.getAvatar', [
'userId' => $_['user_uid'],
'size' => $size,
'v' => $_['userAvatarVersion']
diff --git a/core/templates/login.php b/core/templates/login.php
index 949916872de7f..251e4cd288e18 100644
--- a/core/templates/login.php
+++ b/core/templates/login.php
@@ -7,7 +7,7 @@
*
* @var \OCP\IL10N $l
*/
-script('core', 'login');
+\OCP\Util::addScript('core', 'login', 'core');
?>
diff --git a/core/templates/loginflow/authpicker.php b/core/templates/loginflow/authpicker.php
index 47e3113604d10..265cb04a20f43 100644
--- a/core/templates/loginflow/authpicker.php
+++ b/core/templates/loginflow/authpicker.php
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
-script('core', 'login/authpicker');
+\OCP\Util::addScript('core', 'login/authpicker', 'core');
style('core', 'login/authpicker');
/** @var array $_ */
diff --git a/core/templates/loginflow/grant.php b/core/templates/loginflow/grant.php
index 6beafccc96ece..8d092f8e0056b 100644
--- a/core/templates/loginflow/grant.php
+++ b/core/templates/loginflow/grant.php
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
-script('core', 'login/grant');
+\OCP\Util::addScript('core', 'login/grant', 'core');
style('core', 'login/authpicker');
/** @var array $_ */
diff --git a/core/templates/loginflowv2/authpicker.php b/core/templates/loginflowv2/authpicker.php
index 9c77409ed058c..c60aa81d3ea27 100644
--- a/core/templates/loginflowv2/authpicker.php
+++ b/core/templates/loginflowv2/authpicker.php
@@ -5,7 +5,7 @@
*/
style('core', 'login/authpicker');
-script('core', 'login/authpicker');
+\OCP\Util::addScript('core', 'login/authpicker', 'core');
/** @var array $_ */
/** @var \OCP\IURLGenerator $urlGenerator */
diff --git a/core/templates/loginflowv2/grant.php b/core/templates/loginflowv2/grant.php
index 2fec49942d553..dea4ed27d6c4d 100644
--- a/core/templates/loginflowv2/grant.php
+++ b/core/templates/loginflowv2/grant.php
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
-script('core', 'login/grant');
+\OCP\Util::addScript('core', 'login/grant', 'core');
style('core', 'login/authpicker');
/** @var array $_ */
diff --git a/core/templates/print_exception.php b/core/templates/print_exception.php
index 2def6d4e9d904..bb66d5abce31f 100644
--- a/core/templates/print_exception.php
+++ b/core/templates/print_exception.php
@@ -1,11 +1,13 @@
');
p($e->getTraceAsString());
print_unescaped('');
diff --git a/core/templates/print_xml_exception.php b/core/templates/print_xml_exception.php
index 94452d8ae9d3f..f103e13545f34 100644
--- a/core/templates/print_xml_exception.php
+++ b/core/templates/print_xml_exception.php
@@ -1,11 +1,13 @@
getTraceAsString());
if ($e->getPrevious() !== null) {
diff --git a/core/templates/recommendedapps.php b/core/templates/recommendedapps.php
index 3654acb317d1b..dc92694f1b0bd 100644
--- a/core/templates/recommendedapps.php
+++ b/core/templates/recommendedapps.php
@@ -5,7 +5,7 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
-script('core', 'recommendedapps');
+\OCP\Util::addScript('core', 'recommendedapps', 'core');
?>
diff --git a/core/templates/success.php b/core/templates/success.php
index 2493fe9a095ba..3d84daf3ef3b8 100644
--- a/core/templates/success.php
+++ b/core/templates/success.php
@@ -11,7 +11,7 @@
diff --git a/core/templates/twofactorselectchallenge.php b/core/templates/twofactorselectchallenge.php
index 582f45d70e873..8f31db3f15448 100644
--- a/core/templates/twofactorselectchallenge.php
+++ b/core/templates/twofactorselectchallenge.php
@@ -24,7 +24,7 @@
t('Two-factor authentication is enforced but has not been configured on your account. Contact your admin for assistance.')) ?>
t('Two-factor authentication is enforced but has not been configured on your account. Please continue to setup two-factor authentication.')) ?>
-
linkToRoute('core.TwoFactorChallenge.showChallenge',
[
'challengeProviderId' => $provider->getId(),
'redirect_url' => $_['redirect_url'],
@@ -66,7 +66,7 @@
- button primary two-factor-primarytwo-factor-secondary" href="linkToRoute('core.TwoFactorChallenge.showChallenge',
[
'challengeProviderId' => $_['backupProvider']->getId(),
'redirect_url' => $_['redirect_url'],
diff --git a/core/templates/twofactorsetupselection.php b/core/templates/twofactorsetupselection.php
index 9633e1faacbbd..2eeaa49d6af74 100644
--- a/core/templates/twofactorsetupselection.php
+++ b/core/templates/twofactorsetupselection.php
@@ -13,7 +13,7 @@
linkToRoute('core.TwoFactorChallenge.setupProvider',
[
'providerId' => $provider->getId(),
'redirect_url' => $_['redirect_url'],
diff --git a/core/templates/twofactorshowchallenge.php b/core/templates/twofactorshowchallenge.php
index 16f4390f1776e..c0286c44c9c14 100644
--- a/core/templates/twofactorshowchallenge.php
+++ b/core/templates/twofactorshowchallenge.php
@@ -28,7 +28,7 @@
-