mirror of
https://github.com/friendica/friendica
synced 2024-11-09 16:22:56 +00:00
Unify "Capability"
This commit is contained in:
parent
8ed94037d5
commit
9f18222a06
41 changed files with 72 additions and 72 deletions
|
@ -58,7 +58,7 @@ if (php_sapi_name() !== 'cli') {
|
||||||
|
|
||||||
use Dice\Dice;
|
use Dice\Dice;
|
||||||
use Friendica\App\Mode;
|
use Friendica\App\Mode;
|
||||||
use Friendica\Core\Logger\Capabilities\LogChannel;
|
use Friendica\Core\Logger\Capability\LogChannel;
|
||||||
use Friendica\Security\ExAuth;
|
use Friendica\Security\ExAuth;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
|
@ -79,8 +79,8 @@ chdir($directory);
|
||||||
require dirname(__DIR__) . '/vendor/autoload.php';
|
require dirname(__DIR__) . '/vendor/autoload.php';
|
||||||
|
|
||||||
$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php');
|
$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php');
|
||||||
/** @var \Friendica\Core\Addon\Capabilities\ICanLoadAddons $addonLoader */
|
/** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */
|
||||||
$addonLoader = $dice->create(\Friendica\Core\Addon\Capabilities\ICanLoadAddons::class);
|
$addonLoader = $dice->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class);
|
||||||
$dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies'));
|
$dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies'));
|
||||||
$dice = $dice->addRule(LoggerInterface::class,['constructParams' => [LogChannel::AUTH_JABBERED]]);
|
$dice = $dice->addRule(LoggerInterface::class,['constructParams' => [LogChannel::AUTH_JABBERED]]);
|
||||||
|
|
||||||
|
|
|
@ -26,15 +26,15 @@ if (php_sapi_name() !== 'cli') {
|
||||||
}
|
}
|
||||||
|
|
||||||
use Dice\Dice;
|
use Dice\Dice;
|
||||||
use Friendica\Core\Logger\Capabilities\LogChannel;
|
use Friendica\Core\Logger\Capability\LogChannel;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
require dirname(__DIR__) . '/vendor/autoload.php';
|
require dirname(__DIR__) . '/vendor/autoload.php';
|
||||||
|
|
||||||
$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php');
|
$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php');
|
||||||
/** @var \Friendica\Core\Addon\Capabilities\ICanLoadAddons $addonLoader */
|
/** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */
|
||||||
$addonLoader = $dice->create(\Friendica\Core\Addon\Capabilities\ICanLoadAddons::class);
|
$addonLoader = $dice->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class);
|
||||||
$dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies'));
|
$dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies'));
|
||||||
$dice = $dice->addRule(LoggerInterface::class, ['constructParams' => [LogChannel::CONSOLE]]);
|
$dice = $dice->addRule(LoggerInterface::class, ['constructParams' => [LogChannel::CONSOLE]]);
|
||||||
|
|
||||||
|
|
|
@ -60,10 +60,10 @@ if (!file_exists('index.php') && (sizeof($_SERVER['argv']) != 0)) {
|
||||||
require dirname(__DIR__) . '/vendor/autoload.php';
|
require dirname(__DIR__) . '/vendor/autoload.php';
|
||||||
|
|
||||||
$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php');
|
$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php');
|
||||||
/** @var \Friendica\Core\Addon\Capabilities\ICanLoadAddons $addonLoader */
|
/** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */
|
||||||
$addonLoader = $dice->create(\Friendica\Core\Addon\Capabilities\ICanLoadAddons::class);
|
$addonLoader = $dice->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class);
|
||||||
$dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies'));
|
$dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies'));
|
||||||
$dice = $dice->addRule(LoggerInterface::class, ['constructParams' => [Logger\Capabilities\LogChannel::DAEMON]]);
|
$dice = $dice->addRule(LoggerInterface::class, ['constructParams' => [Logger\Capability\LogChannel::DAEMON]]);
|
||||||
|
|
||||||
DI::init($dice);
|
DI::init($dice);
|
||||||
\Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class));
|
\Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class));
|
||||||
|
|
|
@ -29,7 +29,7 @@ if (php_sapi_name() !== 'cli') {
|
||||||
use Dice\Dice;
|
use Dice\Dice;
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\App\Mode;
|
use Friendica\App\Mode;
|
||||||
use Friendica\Core\Logger\Capabilities\LogChannel;
|
use Friendica\Core\Logger\Capability\LogChannel;
|
||||||
use Friendica\Core\Update;
|
use Friendica\Core\Update;
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
@ -55,8 +55,8 @@ if (!file_exists("index.php") && (sizeof($_SERVER["argv"]) != 0)) {
|
||||||
require dirname(__DIR__) . '/vendor/autoload.php';
|
require dirname(__DIR__) . '/vendor/autoload.php';
|
||||||
|
|
||||||
$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php');
|
$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php');
|
||||||
/** @var \Friendica\Core\Addon\Capabilities\ICanLoadAddons $addonLoader */
|
/** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */
|
||||||
$addonLoader = $dice->create(\Friendica\Core\Addon\Capabilities\ICanLoadAddons::class);
|
$addonLoader = $dice->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class);
|
||||||
$dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies'));
|
$dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies'));
|
||||||
$dice = $dice->addRule(LoggerInterface::class, ['constructParams' => [LogChannel::WORKER]]);
|
$dice = $dice->addRule(LoggerInterface::class, ['constructParams' => [LogChannel::WORKER]]);
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,9 @@ This type of hook is based on the [Strategy Design Pattern](https://refactoring.
|
||||||
A strategy class defines a possible implementation of a given interface based on a unique name.
|
A strategy class defines a possible implementation of a given interface based on a unique name.
|
||||||
Every name is possible as long as it's unique and not `null`.
|
Every name is possible as long as it's unique and not `null`.
|
||||||
Using an empty name (`''`) is possible as well and should be used as the "default" implementation.
|
Using an empty name (`''`) is possible as well and should be used as the "default" implementation.
|
||||||
To register a strategy, use the [`ICanRegisterInstance`](../src/Core/Hooks/Capabilities/ICanRegisterInstances.php) interface.
|
To register a strategy, use the [`ICanRegisterInstance`](../src/Core/Hooks/Capability/ICanRegisterInstances.php) interface.
|
||||||
|
|
||||||
After registration, a caller can automatically create this instance with the [`ICanCreateInstances`](../src/Core/Hooks/Capabilities/ICanCreateInstances.php) interface and the chosen name.
|
After registration, a caller can automatically create this instance with the [`ICanCreateInstances`](../src/Core/Hooks/Capability/ICanCreateInstances.php) interface and the chosen name.
|
||||||
|
|
||||||
This is useful in case there are different, possible implementations for the same purpose, like for logging, locking, caching, ...
|
This is useful in case there are different, possible implementations for the same purpose, like for logging, locking, caching, ...
|
||||||
|
|
||||||
|
@ -43,11 +43,11 @@ public class ConcreteClassB implements ExampleInterface
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var \Friendica\Core\Hooks\Capabilities\ICanRegisterStrategies $instanceRegister */
|
/** @var \Friendica\Core\Hooks\Capability\ICanRegisterStrategies $instanceRegister */
|
||||||
$instanceRegister->registerStrategy(ExampleInterface::class, ConcreteClassA::class, 'A');
|
$instanceRegister->registerStrategy(ExampleInterface::class, ConcreteClassA::class, 'A');
|
||||||
$instanceRegister->registerStrategy(ExampleInterface::class, ConcreteClassB::class, 'B');
|
$instanceRegister->registerStrategy(ExampleInterface::class, ConcreteClassB::class, 'B');
|
||||||
|
|
||||||
/** @var \Friendica\Core\Hooks\Capabilities\ICanCreateInstances $instanceManager */
|
/** @var \Friendica\Core\Hooks\Capability\ICanCreateInstances $instanceManager */
|
||||||
/** @var ConcreteClassA $concreteClass */
|
/** @var ConcreteClassA $concreteClass */
|
||||||
$concreteClass = $instanceManager->create(ExampleInterface::class, 'A');
|
$concreteClass = $instanceManager->create(ExampleInterface::class, 'A');
|
||||||
|
|
||||||
|
@ -62,14 +62,14 @@ To avoid registering all strategies manually inside the code, Friendica introduc
|
||||||
|
|
||||||
There, you can register all kind of strategies in one file.
|
There, you can register all kind of strategies in one file.
|
||||||
|
|
||||||
### [`HookType::STRATEGY`](../src/Core/Hooks/Capabilities/HookType.php)
|
### [`HookType::STRATEGY`](../src/Core/Hooks/Capability/HookType.php)
|
||||||
|
|
||||||
For each given interface, a list of key-value pairs can be set, where the key is the concrete implementation class and the value is an array of unique names.
|
For each given interface, a list of key-value pairs can be set, where the key is the concrete implementation class and the value is an array of unique names.
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
```php
|
```php
|
||||||
use Friendica\Core\Hooks\Capabilities\BehavioralHookType as H;
|
use Friendica\Core\Hooks\Capability\BehavioralHookType as H;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
H::STRATEGY => [
|
H::STRATEGY => [
|
||||||
|
|
|
@ -30,8 +30,8 @@ if (!file_exists(__DIR__ . '/vendor/autoload.php')) {
|
||||||
require __DIR__ . '/vendor/autoload.php';
|
require __DIR__ . '/vendor/autoload.php';
|
||||||
|
|
||||||
$dice = (new Dice())->addRules(include __DIR__ . '/static/dependencies.config.php');
|
$dice = (new Dice())->addRules(include __DIR__ . '/static/dependencies.config.php');
|
||||||
/** @var \Friendica\Core\Addon\Capabilities\ICanLoadAddons $addonLoader */
|
/** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */
|
||||||
$addonLoader = $dice->create(\Friendica\Core\Addon\Capabilities\ICanLoadAddons::class);
|
$addonLoader = $dice->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class);
|
||||||
$dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies'));
|
$dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies'));
|
||||||
$dice = $dice->addRule(Friendica\App\Mode::class, ['call' => [['determineRunMode', [false, $_SERVER], Dice::CHAIN_CALL]]]);
|
$dice = $dice->addRule(Friendica\App\Mode::class, ['call' => [['determineRunMode', [false, $_SERVER], Dice::CHAIN_CALL]]]);
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
namespace Friendica\Console;
|
namespace Friendica\Console;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Core\KeyValueStorage\Capabilities\IManageKeyValuePairs;
|
use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Update;
|
use Friendica\Core\Update;
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Friendica\Core\Addon\Capabilities;
|
namespace Friendica\Core\Addon\Capability;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for loading Addons specific content
|
* Interface for loading Addons specific content
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
namespace Friendica\Core\Addon\Model;
|
namespace Friendica\Core\Addon\Model;
|
||||||
|
|
||||||
use Friendica\Core\Addon\Capabilities\ICanLoadAddons;
|
use Friendica\Core\Addon\Capability\ICanLoadAddons;
|
||||||
use Friendica\Core\Addon\Exception\AddonInvalidConfigFileException;
|
use Friendica\Core\Addon\Exception\AddonInvalidConfigFileException;
|
||||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
use Friendica\Util\Strings;
|
use Friendica\Util\Strings;
|
||||||
|
|
|
@ -27,7 +27,7 @@ use Friendica\Core\Cache\Exception\CachePersistenceException;
|
||||||
use Friendica\Core\Cache\Exception\InvalidCacheDriverException;
|
use Friendica\Core\Cache\Exception\InvalidCacheDriverException;
|
||||||
use Friendica\Core\Cache\Type;
|
use Friendica\Core\Cache\Type;
|
||||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
use Friendica\Core\Hooks\Capabilities\ICanCreateInstances;
|
use Friendica\Core\Hooks\Capability\ICanCreateInstances;
|
||||||
use Friendica\Util\Profiler;
|
use Friendica\Util\Profiler;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Friendica\Core\Hooks\Capabilities;
|
namespace Friendica\Core\Hooks\Capability;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An enum of hook types, based on behavioral design patterns
|
* An enum of hook types, based on behavioral design patterns
|
|
@ -19,7 +19,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Friendica\Core\Hooks\Capabilities;
|
namespace Friendica\Core\Hooks\Capability;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* creates special instances for given classes
|
* creates special instances for given classes
|
|
@ -19,7 +19,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Friendica\Core\Hooks\Capabilities;
|
namespace Friendica\Core\Hooks\Capability;
|
||||||
|
|
||||||
use Friendica\Core\Hooks\Exceptions\HookRegisterArgumentException;
|
use Friendica\Core\Hooks\Exceptions\HookRegisterArgumentException;
|
||||||
|
|
|
@ -22,8 +22,8 @@
|
||||||
namespace Friendica\Core\Hooks\Model;
|
namespace Friendica\Core\Hooks\Model;
|
||||||
|
|
||||||
use Dice\Dice;
|
use Dice\Dice;
|
||||||
use Friendica\Core\Hooks\Capabilities\ICanCreateInstances;
|
use Friendica\Core\Hooks\Capability\ICanCreateInstances;
|
||||||
use Friendica\Core\Hooks\Capabilities\ICanRegisterStrategies;
|
use Friendica\Core\Hooks\Capability\ICanRegisterStrategies;
|
||||||
use Friendica\Core\Hooks\Exceptions\HookInstanceException;
|
use Friendica\Core\Hooks\Exceptions\HookInstanceException;
|
||||||
use Friendica\Core\Hooks\Exceptions\HookRegisterArgumentException;
|
use Friendica\Core\Hooks\Exceptions\HookRegisterArgumentException;
|
||||||
use Friendica\Core\Hooks\Util\StrategiesFileManager;
|
use Friendica\Core\Hooks\Util\StrategiesFileManager;
|
||||||
|
|
|
@ -21,8 +21,8 @@
|
||||||
|
|
||||||
namespace Friendica\Core\Hooks\Util;
|
namespace Friendica\Core\Hooks\Util;
|
||||||
|
|
||||||
use Friendica\Core\Addon\Capabilities\ICanLoadAddons;
|
use Friendica\Core\Addon\Capability\ICanLoadAddons;
|
||||||
use Friendica\Core\Hooks\Capabilities\ICanRegisterStrategies;
|
use Friendica\Core\Hooks\Capability\ICanRegisterStrategies;
|
||||||
use Friendica\Core\Hooks\Exceptions\HookConfigException;
|
use Friendica\Core\Hooks\Exceptions\HookConfigException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Friendica\Core\KeyValueStorage\Capabilities;
|
namespace Friendica\Core\KeyValueStorage\Capability;
|
||||||
|
|
||||||
use Friendica\Core\KeyValueStorage\Exceptions\KeyValueStoragePersistenceException;
|
use Friendica\Core\KeyValueStorage\Exceptions\KeyValueStoragePersistenceException;
|
||||||
|
|
|
@ -21,8 +21,8 @@
|
||||||
|
|
||||||
namespace Friendica\Core\KeyValueStorage\Factory;
|
namespace Friendica\Core\KeyValueStorage\Factory;
|
||||||
|
|
||||||
use Friendica\Core\Hooks\Capabilities\ICanCreateInstances;
|
use Friendica\Core\Hooks\Capability\ICanCreateInstances;
|
||||||
use Friendica\Core\KeyValueStorage\Capabilities\IManageKeyValuePairs;
|
use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs;
|
||||||
|
|
||||||
class KeyValueStorage
|
class KeyValueStorage
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
namespace Friendica\Core\KeyValueStorage\Type;
|
namespace Friendica\Core\KeyValueStorage\Type;
|
||||||
|
|
||||||
use Friendica\Core\KeyValueStorage\Capabilities\IManageKeyValuePairs;
|
use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An abstract helper class for Key-Value storage classes
|
* An abstract helper class for Key-Value storage classes
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Friendica\Core\Logger\Capabilities;
|
namespace Friendica\Core\Logger\Capability;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whenever a logging specific check is necessary, use this interface to encapsulate and centralize this logic
|
* Whenever a logging specific check is necessary, use this interface to encapsulate and centralize this logic
|
|
@ -19,7 +19,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Friendica\Core\Logger\Capabilities;
|
namespace Friendica\Core\Logger\Capability;
|
||||||
|
|
||||||
interface IHaveCallIntrospections
|
interface IHaveCallIntrospections
|
||||||
{
|
{
|
|
@ -19,7 +19,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Friendica\Core\Logger\Capabilities;
|
namespace Friendica\Core\Logger\Capability;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An enum class for the Log channels
|
* An enum class for the Log channels
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
namespace Friendica\Core\Logger\Factory;
|
namespace Friendica\Core\Logger\Factory;
|
||||||
|
|
||||||
use Friendica\Core\Logger\Capabilities\IHaveCallIntrospections;
|
use Friendica\Core\Logger\Capability\IHaveCallIntrospections;
|
||||||
use Psr\Log\LogLevel;
|
use Psr\Log\LogLevel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -22,8 +22,8 @@
|
||||||
namespace Friendica\Core\Logger\Factory;
|
namespace Friendica\Core\Logger\Factory;
|
||||||
|
|
||||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
use Friendica\Core\Hooks\Capabilities\ICanCreateInstances;
|
use Friendica\Core\Hooks\Capability\ICanCreateInstances;
|
||||||
use Friendica\Core\Logger\Capabilities\LogChannel;
|
use Friendica\Core\Logger\Capability\LogChannel;
|
||||||
use Friendica\Core\Logger\Type\ProfilerLogger as ProfilerLoggerClass;
|
use Friendica\Core\Logger\Type\ProfilerLogger as ProfilerLoggerClass;
|
||||||
use Friendica\Util\Profiler;
|
use Friendica\Util\Profiler;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
namespace Friendica\Core\Logger\Factory;
|
namespace Friendica\Core\Logger\Factory;
|
||||||
|
|
||||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
use Friendica\Core\Logger\Capabilities\LogChannel;
|
use Friendica\Core\Logger\Capability\LogChannel;
|
||||||
use Friendica\Core\Logger\Exception\LoggerArgumentException;
|
use Friendica\Core\Logger\Exception\LoggerArgumentException;
|
||||||
use Friendica\Core\Logger\Exception\LoggerException;
|
use Friendica\Core\Logger\Exception\LoggerException;
|
||||||
use Friendica\Core\Logger\Exception\LogLevelException;
|
use Friendica\Core\Logger\Exception\LogLevelException;
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
namespace Friendica\Core\Logger\Type;
|
namespace Friendica\Core\Logger\Type;
|
||||||
|
|
||||||
use Friendica\Core\Logger\Capabilities\IHaveCallIntrospections;
|
use Friendica\Core\Logger\Capability\IHaveCallIntrospections;
|
||||||
use Friendica\Core\Logger\Exception\LoggerException;
|
use Friendica\Core\Logger\Exception\LoggerException;
|
||||||
use Friendica\Util\Strings;
|
use Friendica\Util\Strings;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
namespace Friendica\Core\Logger\Type;
|
namespace Friendica\Core\Logger\Type;
|
||||||
|
|
||||||
use Friendica\Core\Logger\Capabilities\IHaveCallIntrospections;
|
use Friendica\Core\Logger\Capability\IHaveCallIntrospections;
|
||||||
use Friendica\Core\Logger\Exception\LoggerException;
|
use Friendica\Core\Logger\Exception\LoggerException;
|
||||||
use Friendica\Core\Logger\Exception\LogLevelException;
|
use Friendica\Core\Logger\Exception\LogLevelException;
|
||||||
use Friendica\Util\DateTimeFormat;
|
use Friendica\Util\DateTimeFormat;
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
namespace Friendica\Core\Logger\Type;
|
namespace Friendica\Core\Logger\Type;
|
||||||
|
|
||||||
use Friendica\Core\Logger\Capabilities\IHaveCallIntrospections;
|
use Friendica\Core\Logger\Capability\IHaveCallIntrospections;
|
||||||
use Friendica\Core\Logger\Exception\LoggerException;
|
use Friendica\Core\Logger\Exception\LoggerException;
|
||||||
use Friendica\Core\Logger\Exception\LogLevelException;
|
use Friendica\Core\Logger\Exception\LogLevelException;
|
||||||
use Psr\Log\LogLevel;
|
use Psr\Log\LogLevel;
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
namespace Friendica\Core\Logger\Util;
|
namespace Friendica\Core\Logger\Util;
|
||||||
|
|
||||||
use Friendica\App\Request;
|
use Friendica\App\Request;
|
||||||
use Friendica\Core\Logger\Capabilities\IHaveCallIntrospections;
|
use Friendica\Core\Logger\Capability\IHaveCallIntrospections;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Introspection information about the current call
|
* Get Introspection information about the current call
|
||||||
|
|
|
@ -23,7 +23,7 @@ namespace Friendica\Core\Logger\Util;
|
||||||
|
|
||||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Logger\Capabilities\ICheckLoggerSettings;
|
use Friendica\Core\Logger\Capability\ICheckLoggerSettings;
|
||||||
use Friendica\Core\Logger\Exception\LoggerUnusableException;
|
use Friendica\Core\Logger\Exception\LoggerUnusableException;
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
namespace Friendica\Core\PConfig\Factory;
|
namespace Friendica\Core\PConfig\Factory;
|
||||||
|
|
||||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
use Friendica\Core\Hooks\Capabilities\ICanCreateInstances;
|
use Friendica\Core\Hooks\Capability\ICanCreateInstances;
|
||||||
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
|
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
|
||||||
|
|
||||||
class PConfig
|
class PConfig
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
namespace Friendica;
|
namespace Friendica;
|
||||||
|
|
||||||
use Dice\Dice;
|
use Dice\Dice;
|
||||||
use Friendica\Core\Logger\Capabilities\ICheckLoggerSettings;
|
use Friendica\Core\Logger\Capability\ICheckLoggerSettings;
|
||||||
use Friendica\Core\Logger\Util\LoggerSettingsCheck;
|
use Friendica\Core\Logger\Util\LoggerSettingsCheck;
|
||||||
use Friendica\Core\Session\Capability\IHandleSessions;
|
use Friendica\Core\Session\Capability\IHandleSessions;
|
||||||
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
||||||
|
@ -210,9 +210,9 @@ abstract class DI
|
||||||
return self::$dice->create(Core\Config\Util\ConfigFileManager::class);
|
return self::$dice->create(Core\Config\Util\ConfigFileManager::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function keyValue(): Core\KeyValueStorage\Capabilities\IManageKeyValuePairs
|
public static function keyValue(): Core\KeyValueStorage\Capability\IManageKeyValuePairs
|
||||||
{
|
{
|
||||||
return self::$dice->create(Core\KeyValueStorage\Capabilities\IManageKeyValuePairs::class);
|
return self::$dice->create(Core\KeyValueStorage\Capability\IManageKeyValuePairs::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -26,7 +26,7 @@ use Friendica\BaseModule;
|
||||||
use Friendica\Core\Addon;
|
use Friendica\Core\Addon;
|
||||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\KeyValueStorage\Capabilities\IManageKeyValuePairs;
|
use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
||||||
|
|
|
@ -25,7 +25,7 @@ use Friendica\App;
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
use Friendica\Core\Addon;
|
use Friendica\Core\Addon;
|
||||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
use Friendica\Core\KeyValueStorage\Capabilities\IManageKeyValuePairs;
|
use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Network\HTTPException\NotFoundException;
|
use Friendica\Network\HTTPException\NotFoundException;
|
||||||
|
|
|
@ -37,8 +37,8 @@ use Dice\Dice;
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Core\Cache;
|
use Friendica\Core\Cache;
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
use Friendica\Core\Hooks\Capabilities\ICanCreateInstances;
|
use Friendica\Core\Hooks\Capability\ICanCreateInstances;
|
||||||
use Friendica\Core\Hooks\Capabilities\ICanRegisterStrategies;
|
use Friendica\Core\Hooks\Capability\ICanRegisterStrategies;
|
||||||
use Friendica\Core\Hooks\Model\DiceInstanceManager;
|
use Friendica\Core\Hooks\Model\DiceInstanceManager;
|
||||||
use Friendica\Core\PConfig;
|
use Friendica\Core\PConfig;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
|
@ -63,7 +63,7 @@ return [
|
||||||
// one instance for the whole execution
|
// one instance for the whole execution
|
||||||
'shared' => true,
|
'shared' => true,
|
||||||
],
|
],
|
||||||
\Friendica\Core\Addon\Capabilities\ICanLoadAddons::class => [
|
\Friendica\Core\Addon\Capability\ICanLoadAddons::class => [
|
||||||
'instanceOf' => \Friendica\Core\Addon\Model\AddonLoader::class,
|
'instanceOf' => \Friendica\Core\Addon\Model\AddonLoader::class,
|
||||||
'constructParams' => [
|
'constructParams' => [
|
||||||
[Dice::INSTANCE => '$basepath'],
|
[Dice::INSTANCE => '$basepath'],
|
||||||
|
@ -215,10 +215,10 @@ return [
|
||||||
['create', [], Dice::CHAIN_CALL],
|
['create', [], Dice::CHAIN_CALL],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
\Friendica\Core\Logger\Capabilities\IHaveCallIntrospections::class => [
|
\Friendica\Core\Logger\Capability\IHaveCallIntrospections::class => [
|
||||||
'instanceOf' => \Friendica\Core\Logger\Util\Introspection::class,
|
'instanceOf' => \Friendica\Core\Logger\Util\Introspection::class,
|
||||||
'constructParams' => [
|
'constructParams' => [
|
||||||
\Friendica\Core\Logger\Capabilities\IHaveCallIntrospections::IGNORE_CLASS_LIST,
|
\Friendica\Core\Logger\Capability\IHaveCallIntrospections::IGNORE_CLASS_LIST,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'$devLogger' => [
|
'$devLogger' => [
|
||||||
|
@ -290,7 +290,7 @@ return [
|
||||||
['getBackend', [], Dice::CHAIN_CALL],
|
['getBackend', [], Dice::CHAIN_CALL],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
\Friendica\Core\KeyValueStorage\Capabilities\IManageKeyValuePairs::class => [
|
\Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs::class => [
|
||||||
'instanceOf' => \Friendica\Core\KeyValueStorage\Factory\KeyValueStorage::class,
|
'instanceOf' => \Friendica\Core\KeyValueStorage\Factory\KeyValueStorage::class,
|
||||||
'call' => [
|
'call' => [
|
||||||
['create', [], Dice::CHAIN_CALL],
|
['create', [], Dice::CHAIN_CALL],
|
||||||
|
|
|
@ -38,7 +38,7 @@ return [
|
||||||
Cache\Type\MemcachedCache::class => ['memcached'],
|
Cache\Type\MemcachedCache::class => ['memcached'],
|
||||||
Cache\Type\RedisCache::class => ['redis'],
|
Cache\Type\RedisCache::class => ['redis'],
|
||||||
],
|
],
|
||||||
KeyValueStorage\Capabilities\IManageKeyValuePairs::class => [
|
KeyValueStorage\Capability\IManageKeyValuePairs::class => [
|
||||||
KeyValueStorage\Type\DBKeyValueStorage::class => ['database', ''],
|
KeyValueStorage\Type\DBKeyValueStorage::class => ['database', ''],
|
||||||
],
|
],
|
||||||
PConfig\Capability\IManagePersonalConfigValues::class => [
|
PConfig\Capability\IManagePersonalConfigValues::class => [
|
||||||
|
|
|
@ -54,7 +54,7 @@ class AddonLoaderTest extends MockedTest
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
return [
|
return [
|
||||||
\Friendica\Core\Hooks\Capabilities\BehavioralHookType::STRATEGY => [
|
\Friendica\Core\Hooks\Capability\BehavioralHookType::STRATEGY => [
|
||||||
\Psr\Log\LoggerInterface::class => [
|
\Psr\Log\LoggerInterface::class => [
|
||||||
\Psr\Log\NullLogger::class => [''],
|
\Psr\Log\NullLogger::class => [''],
|
||||||
],
|
],
|
||||||
|
@ -79,7 +79,7 @@ EOF;
|
||||||
'addon/testaddon1/static/hooks.config.php' => $this->content,
|
'addon/testaddon1/static/hooks.config.php' => $this->content,
|
||||||
],
|
],
|
||||||
'assertion' => [
|
'assertion' => [
|
||||||
\Friendica\Core\Hooks\Capabilities\BehavioralHookType::STRATEGY => [
|
\Friendica\Core\Hooks\Capability\BehavioralHookType::STRATEGY => [
|
||||||
\Psr\Log\LoggerInterface::class => [
|
\Psr\Log\LoggerInterface::class => [
|
||||||
\Psr\Log\NullLogger::class => [''],
|
\Psr\Log\NullLogger::class => [''],
|
||||||
],
|
],
|
||||||
|
@ -94,7 +94,7 @@ EOF;
|
||||||
'addon/testaddon2/static/hooks.config.php' => $this->content,
|
'addon/testaddon2/static/hooks.config.php' => $this->content,
|
||||||
],
|
],
|
||||||
'assertion' => [
|
'assertion' => [
|
||||||
\Friendica\Core\Hooks\Capabilities\BehavioralHookType::STRATEGY => [
|
\Friendica\Core\Hooks\Capability\BehavioralHookType::STRATEGY => [
|
||||||
\Psr\Log\LoggerInterface::class => [
|
\Psr\Log\LoggerInterface::class => [
|
||||||
\Psr\Log\NullLogger::class => ['', ''],
|
\Psr\Log\NullLogger::class => ['', ''],
|
||||||
],
|
],
|
||||||
|
@ -118,7 +118,7 @@ EOF;
|
||||||
'addon/testaddon2/static/hooks.config.php' => $this->content,
|
'addon/testaddon2/static/hooks.config.php' => $this->content,
|
||||||
],
|
],
|
||||||
'assertion' => [
|
'assertion' => [
|
||||||
\Friendica\Core\Hooks\Capabilities\BehavioralHookType::STRATEGY => [
|
\Friendica\Core\Hooks\Capability\BehavioralHookType::STRATEGY => [
|
||||||
\Psr\Log\LoggerInterface::class => [
|
\Psr\Log\LoggerInterface::class => [
|
||||||
\Psr\Log\NullLogger::class => [''],
|
\Psr\Log\NullLogger::class => [''],
|
||||||
],
|
],
|
||||||
|
|
|
@ -21,8 +21,8 @@
|
||||||
|
|
||||||
namespace Friendica\Test\src\Core\Hooks\Util;
|
namespace Friendica\Test\src\Core\Hooks\Util;
|
||||||
|
|
||||||
use Friendica\Core\Addon\Capabilities\ICanLoadAddons;
|
use Friendica\Core\Addon\Capability\ICanLoadAddons;
|
||||||
use Friendica\Core\Hooks\Capabilities\ICanRegisterStrategies;
|
use Friendica\Core\Hooks\Capability\ICanRegisterStrategies;
|
||||||
use Friendica\Core\Hooks\Exceptions\HookConfigException;
|
use Friendica\Core\Hooks\Exceptions\HookConfigException;
|
||||||
use Friendica\Core\Hooks\Util\StrategiesFileManager;
|
use Friendica\Core\Hooks\Util\StrategiesFileManager;
|
||||||
use Friendica\Test\MockedTest;
|
use Friendica\Test\MockedTest;
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
namespace Friendica\Test\src\Core\KeyValueStorage;
|
namespace Friendica\Test\src\Core\KeyValueStorage;
|
||||||
|
|
||||||
use Friendica\Core\KeyValueStorage\Capabilities\IManageKeyValuePairs;
|
use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs;
|
||||||
use Friendica\Core\KeyValueStorage\Type\DBKeyValueStorage;
|
use Friendica\Core\KeyValueStorage\Type\DBKeyValueStorage;
|
||||||
use Friendica\Database\Database;
|
use Friendica\Database\Database;
|
||||||
use Friendica\Test\Util\CreateDatabaseTrait;
|
use Friendica\Test\Util\CreateDatabaseTrait;
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
namespace Friendica\Test\src\Core\KeyValueStorage;
|
namespace Friendica\Test\src\Core\KeyValueStorage;
|
||||||
|
|
||||||
use Friendica\Core\KeyValueStorage\Capabilities\IManageKeyValuePairs;
|
use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs;
|
||||||
use Friendica\Test\MockedTest;
|
use Friendica\Test\MockedTest;
|
||||||
|
|
||||||
abstract class KeyValueStorageTest extends MockedTest
|
abstract class KeyValueStorageTest extends MockedTest
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
namespace Friendica\Test\src\Core\Logger;
|
namespace Friendica\Test\src\Core\Logger;
|
||||||
|
|
||||||
use Friendica\Core\Logger\Capabilities\IHaveCallIntrospections;
|
use Friendica\Core\Logger\Capability\IHaveCallIntrospections;
|
||||||
use Friendica\Core\Logger\Type\SyslogLogger;
|
use Friendica\Core\Logger\Type\SyslogLogger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue