<?php
/**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
class Storage extends BaseAdmin
{
- public static function post()
+ protected function post(array $request = [])
{
self::checkAdminAccess();
self::checkFormSecurityTokenRedirectOnError('/admin/storage', 'admin_storage');
- $storagebackend = trim(static::$parameters['name'] ?? '');
+ $storagebackend = trim($this->parameters['name'] ?? '');
try {
/** @var ICanConfigureStorage|false $newStorageConfig */
$newStorageConfig = DI::storageManager()->getConfigurationByName($storagebackend);
} catch (InvalidClassStorageException $storageException) {
- notice(DI::l10n()->t('Storage backend, %s is invalid.', $storagebackend));
+ DI::sysmsg()->addNotice(DI::l10n()->t('Storage backend, %s is invalid.', $storagebackend));
DI::baseUrl()->redirect('admin/storage');
}
$storage_form_errors = $newStorageConfig->saveOptions($storage_opts_data);
if (count($storage_form_errors)) {
foreach ($storage_form_errors as $name => $err) {
- notice(DI::l10n()->t('Storage backend %s error: %s', $storage_opts[$name][1], $err));
+ DI::sysmsg()->addNotice(DI::l10n()->t('Storage backend %s error: %s', $storage_opts[$name][1], $err));
}
DI::baseUrl()->redirect('admin/storage');
}
$newstorage = DI::storageManager()->getWritableStorageByName($storagebackend);
if (!DI::storageManager()->setBackend($newstorage)) {
- notice(DI::l10n()->t('Invalid storage backend setting value.'));
+ DI::sysmsg()->addNotice(DI::l10n()->t('Invalid storage backend setting value.'));
}
} catch (InvalidClassStorageException $storageException) {
- notice(DI::l10n()->t('Invalid storage backend setting value.'));
+ DI::sysmsg()->addNotice(DI::l10n()->t('Invalid storage backend setting value.'));
}
}
DI::baseUrl()->redirect('admin/storage');
}
- public static function content()
+ protected function content(array $request = []): string
{
parent::content();