mirror of
https://github.com/friendica/friendica
synced 2025-04-25 19:50:12 +00:00
Implement Hook::callAll('storage_instance') call for addons and add a description for it.
- Remove implicit Dice usage - Add concrete instance creating - Adding Hook call for addon instance creating - Updating doc for Hook - Updating tests
This commit is contained in:
parent
5d8e6c33ef
commit
bfae6766bf
8 changed files with 155 additions and 62 deletions
|
@ -2,9 +2,12 @@
|
|||
|
||||
namespace Friendica\Test\Util;
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Model\Storage\IStorage;
|
||||
|
||||
use Friendica\Core\L10n\L10n;
|
||||
use Mockery\MockInterface;
|
||||
|
||||
/**
|
||||
* A backend storage example class
|
||||
|
@ -91,4 +94,13 @@ class SampleStorageBackend implements IStorage
|
|||
{
|
||||
return self::NAME;
|
||||
}
|
||||
|
||||
/**
|
||||
* This one is a hack to register this class to the hook
|
||||
*/
|
||||
public static function registerHook()
|
||||
{
|
||||
Hook::register('storage_instance', __DIR__ . '/SampleStorageBackendInstance.php', 'create_instance');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue