public function getOptions();
public function saveOptions(array $data);
public function __toString();
- public static function getName();
+ public static function getName();
}
```
use Friendica\Model\Storage\IStorage;
-use Friendica\Core\Config;
+use Friendica\Core\Config\IConfig;
use Friendica\Core\L10n;
class SampleStorageBackend implements IStorage
{
const NAME = 'Sample Storage';
- /** @var Config\IConfiguration */
+ /** @var IConfig */
private $config;
- /** @var L10n\L10n */
+ /** @var L10n */
private $l10n;
/**
* SampleStorageBackend constructor.
- * @param Config\IConfiguration $config The configuration of Friendica
+ * @param IConfig $config The configuration of Friendica
*
* You can add here every dynamic class as dependency you like and add them to a private field
* Friendica automatically creates these classes and passes them as argument to the constructor
*/
- public function __construct(Config\IConfiguration $config, L10n\L10n $l10n)
+ public function __construct(IConfig $config, L10n $l10n)
{
$this->config = $config;
$this->l10n = $l10n;
// 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
- DI::facStorage()->register(SampleStorageBackend::class);
+ DI::storageManager()->register(SampleStorageBackend::class);
}
function samplestorage_unistall()
{
// when the plugin is uninstalled, we unregister the backend.
- DI::facStorage()->unregister(SampleStorageBackend::class);
+ DI::storageManager()->unregister(SampleStorageBackend::class);
}
function samplestorage_storage_instance(\Friendica\App $a, array $data)