mirror of
https://github.com/friendica/friendica
synced 2025-04-20 05:10:11 +00:00
Merge remote-tracking branch 'upstream/develop' into error-handling
This commit is contained in:
commit
516018861e
235 changed files with 10885 additions and 10716 deletions
|
@ -23,9 +23,9 @@ namespace Friendica\Module\Admin;
|
|||
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Storage\InvalidClassStorageException;
|
||||
use Friendica\Model\Storage\IStorageConfiguration;
|
||||
use Friendica\Model\Storage\IWritableStorage;
|
||||
use Friendica\Core\Storage\Exception\InvalidClassStorageException;
|
||||
use Friendica\Core\Storage\Capability\ICanConfigureStorage;
|
||||
use Friendica\Core\Storage\Capability\ICanWriteToStorage;
|
||||
use Friendica\Module\BaseAdmin;
|
||||
use Friendica\Util\Strings;
|
||||
|
||||
|
@ -40,7 +40,7 @@ class Storage extends BaseAdmin
|
|||
$storagebackend = Strings::escapeTags(trim($parameters['name'] ?? ''));
|
||||
|
||||
try {
|
||||
/** @var IStorageConfiguration|false $newStorageConfig */
|
||||
/** @var ICanConfigureStorage|false $newStorageConfig */
|
||||
$newStorageConfig = DI::storageManager()->getConfigurationByName($storagebackend);
|
||||
} catch (InvalidClassStorageException $storageException) {
|
||||
notice(DI::l10n()->t('Storage backend, %s is invalid.', $storagebackend));
|
||||
|
@ -78,7 +78,6 @@ class Storage extends BaseAdmin
|
|||
|
||||
if (!empty($_POST['submit_save_set'])) {
|
||||
try {
|
||||
/** @var IWritableStorage $newstorage */
|
||||
$newstorage = DI::storageManager()->getWritableStorageByName($storagebackend);
|
||||
|
||||
if (!DI::storageManager()->setBackend($newstorage)) {
|
||||
|
@ -129,7 +128,7 @@ class Storage extends BaseAdmin
|
|||
'name' => $name,
|
||||
'prefix' => $storage_form_prefix,
|
||||
'form' => $storage_form,
|
||||
'active' => $current_storage_backend instanceof IWritableStorage && $name === $current_storage_backend::getName(),
|
||||
'active' => $current_storage_backend instanceof ICanWriteToStorage && $name === $current_storage_backend::getName(),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -147,7 +146,7 @@ class Storage extends BaseAdmin
|
|||
'$noconfig' => DI::l10n()->t('This backend doesn\'t have custom settings'),
|
||||
'$baseurl' => DI::baseUrl()->get(true),
|
||||
'$form_security_token' => self::getFormSecurityToken("admin_storage"),
|
||||
'$storagebackend' => $current_storage_backend instanceof IWritableStorage ? $current_storage_backend::getName() : DI::l10n()->t('Database (legacy)'),
|
||||
'$storagebackend' => $current_storage_backend instanceof ICanWriteToStorage ? $current_storage_backend::getName() : DI::l10n()->t('Database (legacy)'),
|
||||
'$availablestorageforms' => $available_storage_forms,
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -22,14 +22,14 @@
|
|||
namespace Friendica\Module\Admin;
|
||||
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\Config\Cache;
|
||||
use Friendica\Core\Config\ValueObject\Cache;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\Update;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\Database\DBStructure;
|
||||
use Friendica\DI;
|
||||
use Friendica\Factory\ConfigFactory;
|
||||
use Friendica\Core\Config\Factory\Config;
|
||||
use Friendica\Model\Register;
|
||||
use Friendica\Module\BaseAdmin;
|
||||
use Friendica\Network\HTTPException\ServiceUnavailableException;
|
||||
|
@ -151,7 +151,7 @@ class Summary extends BaseAdmin
|
|||
}
|
||||
|
||||
// check legacy basepath settings
|
||||
$configLoader = (new ConfigFactory())->createConfigFileLoader($a->getBasePath(), $_SERVER);
|
||||
$configLoader = (new Config())->createConfigFileLoader($a->getBasePath(), $_SERVER);
|
||||
$configCache = new Cache();
|
||||
$configLoader->setupCache($configCache);
|
||||
$confBasepath = $configCache->get('system', 'basepath');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue