mirror of
https://github.com/friendica/friendica
synced 2025-02-21 08:46:48 +00:00
Deprecate Addon::DIRECTORY in favor of AddonHelper::getAddonPath()
This commit is contained in:
parent
9f086c40e4
commit
4c71ac643d
4 changed files with 30 additions and 0 deletions
|
@ -18,6 +18,9 @@ class Addon
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The addon sub-directory
|
* The addon sub-directory
|
||||||
|
*
|
||||||
|
* @deprecated 2025.02 Use `Friendica\Core\Addon\AddonHelper::getAddonPath()` instead
|
||||||
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
const DIRECTORY = 'addon';
|
const DIRECTORY = 'addon';
|
||||||
|
|
|
@ -14,6 +14,13 @@ namespace Friendica\Core\Addon;
|
||||||
*/
|
*/
|
||||||
interface AddonHelper
|
interface AddonHelper
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Returns the absolute path to the addon folder
|
||||||
|
*
|
||||||
|
* e.g. `/var/www/html/addon`
|
||||||
|
*/
|
||||||
|
public function getAddonPath(): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the list of available addons with their current status and info.
|
* Returns the list of available addons with their current status and info.
|
||||||
* This list is made from scanning the addon/ folder.
|
* This list is made from scanning the addon/ folder.
|
||||||
|
|
|
@ -18,6 +18,23 @@ use Friendica\Core\Addon;
|
||||||
*/
|
*/
|
||||||
final class AddonProxy implements AddonHelper
|
final class AddonProxy implements AddonHelper
|
||||||
{
|
{
|
||||||
|
private string $addonPath;
|
||||||
|
|
||||||
|
public function __construct(string $addonPath)
|
||||||
|
{
|
||||||
|
$this->addonPath = $addonPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the absolute path to the addon folder
|
||||||
|
*
|
||||||
|
* e.g. `/var/www/html/addon`
|
||||||
|
*/
|
||||||
|
public function getAddonPath(): string
|
||||||
|
{
|
||||||
|
return $this->addonPath;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the list of available addons with their current status and info.
|
* Returns the list of available addons with their current status and info.
|
||||||
* This list is made from scanning the addon/ folder.
|
* This list is made from scanning the addon/ folder.
|
||||||
|
|
|
@ -44,6 +44,9 @@ return (function(string $basepath, array $getVars, array $serverVars, array $coo
|
||||||
],
|
],
|
||||||
\Friendica\Core\Addon\AddonHelper::class => [
|
\Friendica\Core\Addon\AddonHelper::class => [
|
||||||
'instanceOf' => \Friendica\Core\Addon\AddonProxy::class,
|
'instanceOf' => \Friendica\Core\Addon\AddonProxy::class,
|
||||||
|
'constructParams' => [
|
||||||
|
$basepath . '/addon',
|
||||||
|
],
|
||||||
],
|
],
|
||||||
\Friendica\Util\BasePath::class => [
|
\Friendica\Util\BasePath::class => [
|
||||||
'constructParams' => [
|
'constructParams' => [
|
||||||
|
|
Loading…
Add table
Reference in a new issue