mirror of
https://github.com/friendica/friendica
synced 2025-04-23 07:10:14 +00:00
Make Storage testable & add tests
- Making StorageManager dynamic (DI::facStorage()) - Making concrete Storage dynamic (DI::storage()) - Add tests for Storage backend and failure handling - Bumping Level-2/Dice to "dev-master" until new release - Using Storage-Names instead of Storage-Classes in config (includes migration)
This commit is contained in:
parent
a5895f8623
commit
08edeae2f9
18 changed files with 744 additions and 242 deletions
|
@ -182,21 +182,21 @@ The file is `addon/samplestorage/samplestorage.php`
|
|||
* Author: Alice <https://alice.social/~alice>
|
||||
*/
|
||||
|
||||
use Friendica\Core\StorageManager;
|
||||
use Friendica\Addon\samplestorage\SampleStorageBackend;
|
||||
use Friendica\DI;
|
||||
|
||||
function samplestorage_install()
|
||||
{
|
||||
// on addon install, we register our class with name "Sample Storage".
|
||||
// note: we use `::class` property, which returns full class name as string
|
||||
// this save us the problem of correctly escape backslashes in class name
|
||||
StorageManager::register("Sample Storage", SampleStorageBackend::class);
|
||||
DI::facStorage()->register("Sample Storage", SampleStorageBackend::class);
|
||||
}
|
||||
|
||||
function samplestorage_unistall()
|
||||
{
|
||||
// when the plugin is uninstalled, we unregister the backend.
|
||||
StorageManager::unregister("Sample Storage");
|
||||
DI::facStorage()->unregister("Sample Storage");
|
||||
}
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue