use Dice\Dice;
use Friendica\App\Mode;
-use Friendica\Core\Logger\Capabilities\LogChannel;
+use Friendica\Core\Logger\Capability\LogChannel;
use Friendica\Security\ExAuth;
use Psr\Log\LoggerInterface;
require dirname(__DIR__) . '/vendor/autoload.php';
$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php');
-/** @var \Friendica\Core\Addon\Capabilities\ICanLoadAddons $addonLoader */
-$addonLoader = $dice->create(\Friendica\Core\Addon\Capabilities\ICanLoadAddons::class);
+/** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */
+$addonLoader = $dice->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class);
$dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies'));
$dice = $dice->addRule(LoggerInterface::class,['constructParams' => [LogChannel::AUTH_JABBERED]]);
}
use Dice\Dice;
-use Friendica\Core\Logger\Capabilities\LogChannel;
+use Friendica\Core\Logger\Capability\LogChannel;
use Friendica\DI;
use Psr\Log\LoggerInterface;
require dirname(__DIR__) . '/vendor/autoload.php';
$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php');
-/** @var \Friendica\Core\Addon\Capabilities\ICanLoadAddons $addonLoader */
-$addonLoader = $dice->create(\Friendica\Core\Addon\Capabilities\ICanLoadAddons::class);
+/** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */
+$addonLoader = $dice->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class);
$dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies'));
$dice = $dice->addRule(LoggerInterface::class, ['constructParams' => [LogChannel::CONSOLE]]);
require dirname(__DIR__) . '/vendor/autoload.php';
$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php');
-/** @var \Friendica\Core\Addon\Capabilities\ICanLoadAddons $addonLoader */
-$addonLoader = $dice->create(\Friendica\Core\Addon\Capabilities\ICanLoadAddons::class);
+/** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */
+$addonLoader = $dice->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class);
$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);
\Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class));
use Dice\Dice;
use Friendica\App;
use Friendica\App\Mode;
-use Friendica\Core\Logger\Capabilities\LogChannel;
+use Friendica\Core\Logger\Capability\LogChannel;
use Friendica\Core\Update;
use Friendica\Core\Worker;
use Friendica\DI;
require dirname(__DIR__) . '/vendor/autoload.php';
$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php');
-/** @var \Friendica\Core\Addon\Capabilities\ICanLoadAddons $addonLoader */
-$addonLoader = $dice->create(\Friendica\Core\Addon\Capabilities\ICanLoadAddons::class);
+/** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */
+$addonLoader = $dice->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class);
$dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies'));
$dice = $dice->addRule(LoggerInterface::class, ['constructParams' => [LogChannel::WORKER]]);
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`.
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, ...
}
}
-/** @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, ConcreteClassB::class, 'B');
-/** @var \Friendica\Core\Hooks\Capabilities\ICanCreateInstances $instanceManager */
+/** @var \Friendica\Core\Hooks\Capability\ICanCreateInstances $instanceManager */
/** @var ConcreteClassA $concreteClass */
$concreteClass = $instanceManager->create(ExampleInterface::class, 'A');
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.
### Example
```php
-use Friendica\Core\Hooks\Capabilities\BehavioralHookType as H;
+use Friendica\Core\Hooks\Capability\BehavioralHookType as H;
return [
H::STRATEGY => [
require __DIR__ . '/vendor/autoload.php';
$dice = (new Dice())->addRules(include __DIR__ . '/static/dependencies.config.php');
-/** @var \Friendica\Core\Addon\Capabilities\ICanLoadAddons $addonLoader */
-$addonLoader = $dice->create(\Friendica\Core\Addon\Capabilities\ICanLoadAddons::class);
+/** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */
+$addonLoader = $dice->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class);
$dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies'));
$dice = $dice->addRule(Friendica\App\Mode::class, ['call' => [['determineRunMode', [false, $_SERVER], Dice::CHAIN_CALL]]]);
namespace Friendica\Console;
use Friendica\App;
-use Friendica\Core\KeyValueStorage\Capabilities\IManageKeyValuePairs;
+use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs;
use Friendica\Core\L10n;
use Friendica\Core\Update;
unset($item['owner-name']);
unset($item['owner-avatar']);
}
-
+
$item['postopts'] = '';
}
+++ /dev/null
-<?php
-/**
- * @copyright Copyright (C) 2010-2023, the Friendica project
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
- *
- */
-
-namespace Friendica\Core\Addon\Capabilities;
-
-/**
- * Interface for loading Addons specific content
- */
-interface ICanLoadAddons
-{
- /**
- * Returns a merged config array of all active addons for a given config-name
- *
- * @param string $configName The config-name (config-file at the static directory, like 'hooks' => '{addon}/static/hooks.config.php)
- *
- * @return array the merged array
- */
- public function getActiveAddonConfig(string $configName): array;
-}
--- /dev/null
+<?php
+/**
+ * @copyright Copyright (C) 2010-2023, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace Friendica\Core\Addon\Capability;
+
+/**
+ * Interface for loading Addons specific content
+ */
+interface ICanLoadAddons
+{
+ /**
+ * Returns a merged config array of all active addons for a given config-name
+ *
+ * @param string $configName The config-name (config-file at the static directory, like 'hooks' => '{addon}/static/hooks.config.php)
+ *
+ * @return array the merged array
+ */
+ public function getActiveAddonConfig(string $configName): array;
+}
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\Config\Capability\IManageConfigValues;
use Friendica\Util\Strings;
use Friendica\Core\Cache\Exception\InvalidCacheDriverException;
use Friendica\Core\Cache\Type;
use Friendica\Core\Config\Capability\IManageConfigValues;
-use Friendica\Core\Hooks\Capabilities\ICanCreateInstances;
+use Friendica\Core\Hooks\Capability\ICanCreateInstances;
use Friendica\Util\Profiler;
/**
+++ /dev/null
-<?php
-/**
- * @copyright Copyright (C) 2010-2023, the Friendica project
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
- *
- */
-
-namespace Friendica\Core\Hooks\Capabilities;
-
-/**
- * An enum of hook types, based on behavioral design patterns
- * @see https://refactoring.guru/design-patterns/behavioral-patterns
- */
-interface BehavioralHookType
-{
- /**
- * Defines the key for the list of strategy-hooks.
- *
- * @see https://refactoring.guru/design-patterns/strategy
- */
- const STRATEGY = 'strategy';
- const EVENT = 'event';
-}
+++ /dev/null
-<?php
-/**
- * @copyright Copyright (C) 2010-2023, the Friendica project
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
- *
- */
-
-namespace Friendica\Core\Hooks\Capabilities;
-
-/**
- * creates special instances for given classes
- */
-interface ICanCreateInstances
-{
- /**
- * Returns a new instance of a given class for the corresponding name
- *
- * The instance will be build based on the registered strategy and the (unique) name
- *
- * @param string $class The fully-qualified name of the given class or interface which will get returned
- * @param string $strategy An arbitrary identifier to find a concrete instance strategy.
- * @param array $arguments Additional arguments, which can be passed to the constructor of "$class" at runtime
- *
- * @return object The concrete instance of the type "$class"
- */
- public function create(string $class, string $strategy, array $arguments = []): object;
-}
+++ /dev/null
-<?php
-/**
- * @copyright Copyright (C) 2010-2023, the Friendica project
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
- *
- */
-
-namespace Friendica\Core\Hooks\Capabilities;
-
-use Friendica\Core\Hooks\Exceptions\HookRegisterArgumentException;
-
-/**
- * Register strategies for given classes
- */
-interface ICanRegisterStrategies
-{
- /**
- * Register a class(strategy) for a given interface with a unique name.
- *
- * @see https://refactoring.guru/design-patterns/strategy
- *
- * @param string $interface The interface, which the given class implements
- * @param string $class The fully-qualified given class name
- * A placeholder for dependencies is possible as well
- * @param ?string $name An arbitrary identifier for the given strategy, which will be used for factories, dependency injections etc.
- *
- * @return $this This interface for chain-calls
- *
- * @throws HookRegisterArgumentException in case the given class for the interface isn't valid or already set
- */
- public function registerStrategy(string $interface, string $class, ?string $name = null): self;
-}
--- /dev/null
+<?php
+/**
+ * @copyright Copyright (C) 2010-2023, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace Friendica\Core\Hooks\Capability;
+
+/**
+ * An enum of hook types, based on behavioral design patterns
+ * @see https://refactoring.guru/design-patterns/behavioral-patterns
+ */
+interface BehavioralHookType
+{
+ /**
+ * Defines the key for the list of strategy-hooks.
+ *
+ * @see https://refactoring.guru/design-patterns/strategy
+ */
+ const STRATEGY = 'strategy';
+ const EVENT = 'event';
+}
--- /dev/null
+<?php
+/**
+ * @copyright Copyright (C) 2010-2023, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace Friendica\Core\Hooks\Capability;
+
+/**
+ * creates special instances for given classes
+ */
+interface ICanCreateInstances
+{
+ /**
+ * Returns a new instance of a given class for the corresponding name
+ *
+ * The instance will be build based on the registered strategy and the (unique) name
+ *
+ * @param string $class The fully-qualified name of the given class or interface which will get returned
+ * @param string $strategy An arbitrary identifier to find a concrete instance strategy.
+ * @param array $arguments Additional arguments, which can be passed to the constructor of "$class" at runtime
+ *
+ * @return object The concrete instance of the type "$class"
+ */
+ public function create(string $class, string $strategy, array $arguments = []): object;
+}
--- /dev/null
+<?php
+/**
+ * @copyright Copyright (C) 2010-2023, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace Friendica\Core\Hooks\Capability;
+
+use Friendica\Core\Hooks\Exceptions\HookRegisterArgumentException;
+
+/**
+ * Register strategies for given classes
+ */
+interface ICanRegisterStrategies
+{
+ /**
+ * Register a class(strategy) for a given interface with a unique name.
+ *
+ * @see https://refactoring.guru/design-patterns/strategy
+ *
+ * @param string $interface The interface, which the given class implements
+ * @param string $class The fully-qualified given class name
+ * A placeholder for dependencies is possible as well
+ * @param ?string $name An arbitrary identifier for the given strategy, which will be used for factories, dependency injections etc.
+ *
+ * @return $this This interface for chain-calls
+ *
+ * @throws HookRegisterArgumentException in case the given class for the interface isn't valid or already set
+ */
+ public function registerStrategy(string $interface, string $class, ?string $name = null): self;
+}
namespace Friendica\Core\Hooks\Model;
use Dice\Dice;
-use Friendica\Core\Hooks\Capabilities\ICanCreateInstances;
-use Friendica\Core\Hooks\Capabilities\ICanRegisterStrategies;
+use Friendica\Core\Hooks\Capability\ICanCreateInstances;
+use Friendica\Core\Hooks\Capability\ICanRegisterStrategies;
use Friendica\Core\Hooks\Exceptions\HookInstanceException;
use Friendica\Core\Hooks\Exceptions\HookRegisterArgumentException;
use Friendica\Core\Hooks\Util\StrategiesFileManager;
namespace Friendica\Core\Hooks\Util;
-use Friendica\Core\Addon\Capabilities\ICanLoadAddons;
-use Friendica\Core\Hooks\Capabilities\ICanRegisterStrategies;
+use Friendica\Core\Addon\Capability\ICanLoadAddons;
+use Friendica\Core\Hooks\Capability\ICanRegisterStrategies;
use Friendica\Core\Hooks\Exceptions\HookConfigException;
/**
+++ /dev/null
-<?php
-/**
- * @copyright Copyright (C) 2010-2023, the Friendica project
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
- *
- */
-
-namespace Friendica\Core\KeyValueStorage\Capabilities;
-
-use Friendica\Core\KeyValueStorage\Exceptions\KeyValueStoragePersistenceException;
-
-/**
- * Interface for Friendica specific Key-Value pair storage
- */
-interface IManageKeyValuePairs extends \ArrayAccess
-{
- /**
- * Get a particular value from the KeyValue Storage
- *
- * @param string $key The key to query
- *
- * @return mixed Stored value or null if it does not exist
- *
- * @throws KeyValueStoragePersistenceException In case the persistence layer throws errors
- *
- */
- public function get(string $key);
-
- /**
- * Sets a value for a given key
- *
- * Note: Please do not store booleans - convert to 0/1 integer values!
- *
- * @param string $key The configuration key to set
- * @param mixed $value The value to store
- *
- * @throws KeyValueStoragePersistenceException In case the persistence layer throws errors
- */
- public function set(string $key, $value): void;
-
- /**
- * Deletes the given key.
- *
- * @param string $key The configuration key to delete
- *
- * @throws KeyValueStoragePersistenceException In case the persistence layer throws errors
- *
- */
- public function delete(string $key): void;
-}
--- /dev/null
+<?php
+/**
+ * @copyright Copyright (C) 2010-2023, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace Friendica\Core\KeyValueStorage\Capability;
+
+use Friendica\Core\KeyValueStorage\Exceptions\KeyValueStoragePersistenceException;
+
+/**
+ * Interface for Friendica specific Key-Value pair storage
+ */
+interface IManageKeyValuePairs extends \ArrayAccess
+{
+ /**
+ * Get a particular value from the KeyValue Storage
+ *
+ * @param string $key The key to query
+ *
+ * @return mixed Stored value or null if it does not exist
+ *
+ * @throws KeyValueStoragePersistenceException In case the persistence layer throws errors
+ *
+ */
+ public function get(string $key);
+
+ /**
+ * Sets a value for a given key
+ *
+ * Note: Please do not store booleans - convert to 0/1 integer values!
+ *
+ * @param string $key The configuration key to set
+ * @param mixed $value The value to store
+ *
+ * @throws KeyValueStoragePersistenceException In case the persistence layer throws errors
+ */
+ public function set(string $key, $value): void;
+
+ /**
+ * Deletes the given key.
+ *
+ * @param string $key The configuration key to delete
+ *
+ * @throws KeyValueStoragePersistenceException In case the persistence layer throws errors
+ *
+ */
+ public function delete(string $key): void;
+}
namespace Friendica\Core\KeyValueStorage\Factory;
-use Friendica\Core\Hooks\Capabilities\ICanCreateInstances;
-use Friendica\Core\KeyValueStorage\Capabilities\IManageKeyValuePairs;
+use Friendica\Core\Hooks\Capability\ICanCreateInstances;
+use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs;
class KeyValueStorage
{
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
+++ /dev/null
-<?php
-/**
- * @copyright Copyright (C) 2010-2023, the Friendica project
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
- *
- */
-
-namespace Friendica\Core\Logger\Capabilities;
-
-/**
- * Whenever a logging specific check is necessary, use this interface to encapsulate and centralize this logic
- */
-interface ICheckLoggerSettings
-{
- /**
- * Checks if the logfile is set and usable
- *
- * @return string|null null in case everything is ok, otherwise returns the error
- */
- public function checkLogfile(): ?string;
-
- /**
- * Checks if the debugging logfile is usable in case it is set!
- *
- * @return string|null null in case everything is ok, otherwise returns the error
- */
- public function checkDebugLogfile(): ?string;
-}
+++ /dev/null
-<?php
-/**
- * @copyright Copyright (C) 2010-2023, the Friendica project
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
- *
- */
-
-namespace Friendica\Core\Logger\Capabilities;
-
-interface IHaveCallIntrospections
-{
- /**
- * A list of classes, which shouldn't get logged
- *
- * @var string[]
- */
- public const IGNORE_CLASS_LIST = [
- \Friendica\Core\Logger::class,
- \Friendica\Core\Logger\Factory\Logger::class,
- 'Friendica\\Core\\Logger\\Type',
- \Friendica\Util\Profiler::class,
- ];
-
- /**
- * Adds new classes to get skipped
- *
- * @param array $classNames
- */
- public function addClasses(array $classNames): void;
-
- /**
- * Returns the introspection record of the current call
- *
- * @return array
- */
- public function getRecord(): array;
-}
+++ /dev/null
-<?php
-/**
- * @copyright Copyright (C) 2010-2023, the Friendica project
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
- *
- */
-
-namespace Friendica\Core\Logger\Capabilities;
-
-/**
- * An enum class for the Log channels
- */
-interface LogChannel
-{
- /** @var string channel for the auth_ejabbered script */
- public const AUTH_JABBERED = 'auth_ejabberd';
- /** @var string Default channel in case it isn't set explicit */
- public const DEFAULT = self::APP;
- /** @var string channel for console execution */
- public const CONSOLE = 'console';
- /** @var string channel for developer focused logging */
- public const DEV = 'dev';
- /** @var string channel for daemon executions */
- public const DAEMON = 'daemon';
- /** @var string channel for worker execution */
- public const WORKER = 'worker';
- /** @var string channel for frontend app executions */
- public const APP = 'app';
-}
--- /dev/null
+<?php
+/**
+ * @copyright Copyright (C) 2010-2023, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace Friendica\Core\Logger\Capability;
+
+/**
+ * Whenever a logging specific check is necessary, use this interface to encapsulate and centralize this logic
+ */
+interface ICheckLoggerSettings
+{
+ /**
+ * Checks if the logfile is set and usable
+ *
+ * @return string|null null in case everything is ok, otherwise returns the error
+ */
+ public function checkLogfile(): ?string;
+
+ /**
+ * Checks if the debugging logfile is usable in case it is set!
+ *
+ * @return string|null null in case everything is ok, otherwise returns the error
+ */
+ public function checkDebugLogfile(): ?string;
+}
--- /dev/null
+<?php
+/**
+ * @copyright Copyright (C) 2010-2023, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace Friendica\Core\Logger\Capability;
+
+interface IHaveCallIntrospections
+{
+ /**
+ * A list of classes, which shouldn't get logged
+ *
+ * @var string[]
+ */
+ public const IGNORE_CLASS_LIST = [
+ \Friendica\Core\Logger::class,
+ \Friendica\Core\Logger\Factory\Logger::class,
+ 'Friendica\\Core\\Logger\\Type',
+ \Friendica\Util\Profiler::class,
+ ];
+
+ /**
+ * Adds new classes to get skipped
+ *
+ * @param array $classNames
+ */
+ public function addClasses(array $classNames): void;
+
+ /**
+ * Returns the introspection record of the current call
+ *
+ * @return array
+ */
+ public function getRecord(): array;
+}
--- /dev/null
+<?php
+/**
+ * @copyright Copyright (C) 2010-2023, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace Friendica\Core\Logger\Capability;
+
+/**
+ * An enum class for the Log channels
+ */
+interface LogChannel
+{
+ /** @var string channel for the auth_ejabbered script */
+ public const AUTH_JABBERED = 'auth_ejabberd';
+ /** @var string Default channel in case it isn't set explicit */
+ public const DEFAULT = self::APP;
+ /** @var string channel for console execution */
+ public const CONSOLE = 'console';
+ /** @var string channel for developer focused logging */
+ public const DEV = 'dev';
+ /** @var string channel for daemon executions */
+ public const DAEMON = 'daemon';
+ /** @var string channel for worker execution */
+ public const WORKER = 'worker';
+ /** @var string channel for frontend app executions */
+ public const APP = 'app';
+}
namespace Friendica\Core\Logger\Factory;
-use Friendica\Core\Logger\Capabilities\IHaveCallIntrospections;
+use Friendica\Core\Logger\Capability\IHaveCallIntrospections;
use Psr\Log\LogLevel;
/**
namespace Friendica\Core\Logger\Factory;
use Friendica\Core\Config\Capability\IManageConfigValues;
-use Friendica\Core\Hooks\Capabilities\ICanCreateInstances;
-use Friendica\Core\Logger\Capabilities\LogChannel;
+use Friendica\Core\Hooks\Capability\ICanCreateInstances;
+use Friendica\Core\Logger\Capability\LogChannel;
use Friendica\Core\Logger\Type\ProfilerLogger as ProfilerLoggerClass;
use Friendica\Util\Profiler;
use Psr\Log\LoggerInterface;
namespace Friendica\Core\Logger\Factory;
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\LoggerException;
use Friendica\Core\Logger\Exception\LogLevelException;
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\Util\Strings;
use Psr\Log\LoggerInterface;
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\LogLevelException;
use Friendica\Util\DateTimeFormat;
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\LogLevelException;
use Psr\Log\LogLevel;
namespace Friendica\Core\Logger\Util;
use Friendica\App\Request;
-use Friendica\Core\Logger\Capabilities\IHaveCallIntrospections;
+use Friendica\Core\Logger\Capability\IHaveCallIntrospections;
/**
* Get Introspection information about the current call
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\L10n;
-use Friendica\Core\Logger\Capabilities\ICheckLoggerSettings;
+use Friendica\Core\Logger\Capability\ICheckLoggerSettings;
use Friendica\Core\Logger\Exception\LoggerUnusableException;
/** {@inheritDoc} */
namespace Friendica\Core\PConfig\Factory;
use Friendica\Core\Config\Capability\IManageConfigValues;
-use Friendica\Core\Hooks\Capabilities\ICanCreateInstances;
+use Friendica\Core\Hooks\Capability\ICanCreateInstances;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
class PConfig
namespace Friendica;
use Dice\Dice;
-use Friendica\Core\Logger\Capabilities\ICheckLoggerSettings;
+use Friendica\Core\Logger\Capability\ICheckLoggerSettings;
use Friendica\Core\Logger\Util\LoggerSettingsCheck;
use Friendica\Core\Session\Capability\IHandleSessions;
use Friendica\Core\Session\Capability\IHandleUserSessions;
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);
}
/**
use Friendica\Core\Addon;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\Hook;
-use Friendica\Core\KeyValueStorage\Capabilities\IManageKeyValuePairs;
+use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs;
use Friendica\Core\L10n;
use Friendica\Core\Renderer;
use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\BaseModule;
use Friendica\Core\Addon;
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\System;
use Friendica\Network\HTTPException\NotFoundException;
protected $config;
/** @var IManageKeyValuePairs */
protected $keyValue;
-
+
public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, IManageConfigValues $config, IManageKeyValuePairs $keyValue, Response $response, array $server, array $parameters = [])
{
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
use Friendica\App;
use Friendica\Core\Cache;
use Friendica\Core\Config;
-use Friendica\Core\Hooks\Capabilities\ICanCreateInstances;
-use Friendica\Core\Hooks\Capabilities\ICanRegisterStrategies;
+use Friendica\Core\Hooks\Capability\ICanCreateInstances;
+use Friendica\Core\Hooks\Capability\ICanRegisterStrategies;
use Friendica\Core\Hooks\Model\DiceInstanceManager;
use Friendica\Core\PConfig;
use Friendica\Core\L10n;
// one instance for the whole execution
'shared' => true,
],
- \Friendica\Core\Addon\Capabilities\ICanLoadAddons::class => [
+ \Friendica\Core\Addon\Capability\ICanLoadAddons::class => [
'instanceOf' => \Friendica\Core\Addon\Model\AddonLoader::class,
'constructParams' => [
[Dice::INSTANCE => '$basepath'],
['create', [], Dice::CHAIN_CALL],
],
],
- \Friendica\Core\Logger\Capabilities\IHaveCallIntrospections::class => [
+ \Friendica\Core\Logger\Capability\IHaveCallIntrospections::class => [
'instanceOf' => \Friendica\Core\Logger\Util\Introspection::class,
'constructParams' => [
- \Friendica\Core\Logger\Capabilities\IHaveCallIntrospections::IGNORE_CLASS_LIST,
+ \Friendica\Core\Logger\Capability\IHaveCallIntrospections::IGNORE_CLASS_LIST,
],
],
'$devLogger' => [
['getBackend', [], Dice::CHAIN_CALL],
],
],
- \Friendica\Core\KeyValueStorage\Capabilities\IManageKeyValuePairs::class => [
+ \Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs::class => [
'instanceOf' => \Friendica\Core\KeyValueStorage\Factory\KeyValueStorage::class,
'call' => [
['create', [], Dice::CHAIN_CALL],
Cache\Type\MemcachedCache::class => ['memcached'],
Cache\Type\RedisCache::class => ['redis'],
],
- KeyValueStorage\Capabilities\IManageKeyValuePairs::class => [
+ KeyValueStorage\Capability\IManageKeyValuePairs::class => [
KeyValueStorage\Type\DBKeyValueStorage::class => ['database', ''],
],
PConfig\Capability\IManagePersonalConfigValues::class => [
- PConfig\Type\JitPConfig::class => ['jit'],
+ PConfig\Type\JitPConfig::class => ['jit'],
PConfig\Type\PreloadPConfig::class => ['preload', ''],
],
];
<?php
return [
- \Friendica\Core\Hooks\Capabilities\BehavioralHookType::STRATEGY => [
+ \Friendica\Core\Hooks\Capability\BehavioralHookType::STRATEGY => [
\Psr\Log\LoggerInterface::class => [
\Psr\Log\NullLogger::class => [''],
],
'addon/testaddon1/static/hooks.config.php' => $this->content,
],
'assertion' => [
- \Friendica\Core\Hooks\Capabilities\BehavioralHookType::STRATEGY => [
+ \Friendica\Core\Hooks\Capability\BehavioralHookType::STRATEGY => [
\Psr\Log\LoggerInterface::class => [
\Psr\Log\NullLogger::class => [''],
],
'addon/testaddon2/static/hooks.config.php' => $this->content,
],
'assertion' => [
- \Friendica\Core\Hooks\Capabilities\BehavioralHookType::STRATEGY => [
+ \Friendica\Core\Hooks\Capability\BehavioralHookType::STRATEGY => [
\Psr\Log\LoggerInterface::class => [
\Psr\Log\NullLogger::class => ['', ''],
],
'addon/testaddon2/static/hooks.config.php' => $this->content,
],
'assertion' => [
- \Friendica\Core\Hooks\Capabilities\BehavioralHookType::STRATEGY => [
+ \Friendica\Core\Hooks\Capability\BehavioralHookType::STRATEGY => [
\Psr\Log\LoggerInterface::class => [
\Psr\Log\NullLogger::class => [''],
],
namespace Friendica\Test\src\Core\Hooks\Util;
-use Friendica\Core\Addon\Capabilities\ICanLoadAddons;
-use Friendica\Core\Hooks\Capabilities\ICanRegisterStrategies;
+use Friendica\Core\Addon\Capability\ICanLoadAddons;
+use Friendica\Core\Hooks\Capability\ICanRegisterStrategies;
use Friendica\Core\Hooks\Exceptions\HookConfigException;
use Friendica\Core\Hooks\Util\StrategiesFileManager;
use Friendica\Test\MockedTest;
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\Database\Database;
use Friendica\Test\Util\CreateDatabaseTrait;
namespace Friendica\Test\src\Core\KeyValueStorage;
-use Friendica\Core\KeyValueStorage\Capabilities\IManageKeyValuePairs;
+use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs;
use Friendica\Test\MockedTest;
abstract class KeyValueStorageTest extends MockedTest
namespace Friendica\Test\src\Core\Logger;
-use Friendica\Core\Logger\Capabilities\IHaveCallIntrospections;
+use Friendica\Core\Logger\Capability\IHaveCallIntrospections;
use Friendica\Core\Logger\Type\SyslogLogger;
/**