diff --git a/bin/daemon.php b/bin/daemon.php index 25f902eacd..162a92948f 100755 --- a/bin/daemon.php +++ b/bin/daemon.php @@ -6,7 +6,7 @@ * * SPDX-License-Identifier: AGPL-3.0-or-later * - * @deprecated 2025.02 use bin/console.php daemon instead + * @deprecated 2025.02 use `bin/console.php daemon` instead */ /** @@ -24,6 +24,8 @@ chdir(dirname(__DIR__)); require dirname(__DIR__) . '/vendor/autoload.php'; +fwrite(STDOUT, '`bin/daemon.php` is deprecated since 2024.02 and will be removed in 5 months, please use `bin/console.php daemon` instead.' . \PHP_EOL); + // BC: Add console command as second argument $argv = $_SERVER['argv'] ?? []; array_splice($argv, 1, 0, "daemon"); diff --git a/bin/jetstream.php b/bin/jetstream.php index b96dfa0e51..c97557dbb0 100755 --- a/bin/jetstream.php +++ b/bin/jetstream.php @@ -6,7 +6,7 @@ * * SPDX-License-Identifier: AGPL-3.0-or-later * - * @deprecated 2025.02 use bin/console.php jetstream instead + * @deprecated 2025.02 use `bin/console.php jetstream` instead */ if (php_sapi_name() !== 'cli') { @@ -19,6 +19,8 @@ chdir(dirname(__DIR__)); require dirname(__DIR__) . '/vendor/autoload.php'; +fwrite(STDOUT, '`bin/jetstream.php` is deprecated since 2024.02 and will be removed in 5 months, please use `bin/console.php jetstream` instead.' . \PHP_EOL); + // BC: Add console command as second argument $argv = $_SERVER['argv'] ?? []; array_splice($argv, 1, 0, "jetstream"); diff --git a/bin/worker.php b/bin/worker.php index b72a8e2514..f319bd766f 100755 --- a/bin/worker.php +++ b/bin/worker.php @@ -8,7 +8,7 @@ * * Starts the background processing * - * @deprecated 2025.02 use bin/console.php worker instead + * @deprecated 2025.02 use `bin/console.php worker` instead */ if (php_sapi_name() !== 'cli') { @@ -21,6 +21,8 @@ chdir(dirname(__DIR__)); require dirname(__DIR__) . '/vendor/autoload.php'; +fwrite(STDOUT, '`bin/worker.php` is deprecated since 2024.02 and will be removed in 5 months, please use `bin/console.php worker` instead.' . \PHP_EOL); + // BC: Add console command as second argument $argv = $_SERVER['argv'] ?? []; array_splice($argv, 1, 0, "worker"); diff --git a/src/App.php b/src/App.php index 564da764f9..5623f9a413 100644 --- a/src/App.php +++ b/src/App.php @@ -57,6 +57,7 @@ use Psr\Log\LoggerInterface; * and anything else that might need to be passed around * before we spit the page out. * + * @final */ class App { @@ -64,6 +65,9 @@ class App const CODENAME = 'Interrupted Fern'; const VERSION = '2025.02-dev'; + /** + * @internal + */ public static function fromContainer(Container $container): self { return new self($container); @@ -130,6 +134,9 @@ class App $this->container = $container; } + /** + * @internal + */ public function processRequest(ServerRequestInterface $request, float $start_time): void { $this->container->addRule(Mode::class, [ @@ -180,7 +187,9 @@ class App ); } - + /** + * @internal + */ public function processConsole(array $serverParams): void { $argv = $serverParams['argv'] ?? []; @@ -208,6 +217,9 @@ class App (\Friendica\Core\Console::create($this->container, $argv))->execute(); } + /** + * @internal + */ public function processEjabberd(array $serverParams): void { $this->setupContainerForAddons(); diff --git a/src/AppLegacy.php b/src/AppLegacy.php index 4aa3f25e4c..8ec6b0aabc 100644 --- a/src/AppLegacy.php +++ b/src/AppLegacy.php @@ -32,6 +32,7 @@ use Friendica\Util\Strings; * and anything else that might need to be passed around * before we spit the page out. * + * @internal */ final class AppLegacy implements AppHelper { diff --git a/src/Console/AbstractConsole.php b/src/Console/AbstractConsole.php deleted file mode 100644 index 0b8c1d6eb8..0000000000 --- a/src/Console/AbstractConsole.php +++ /dev/null @@ -1,39 +0,0 @@ -executable, -strlen(CoreConsole::getDefaultExecutable())) !== CoreConsole::getDefaultExecutable()) { - $this->out(sprintf("'%s' is deprecated and will removed. Please use 'bin/console.php %s' instead", $this->executable, $command)); - } - } -} diff --git a/src/Console/Daemon.php b/src/Console/Daemon.php index c8165a1d9b..a21ff26fc6 100644 --- a/src/Console/Daemon.php +++ b/src/Console/Daemon.php @@ -10,10 +10,10 @@ declare(strict_types=1); namespace Friendica\Console; use Asika\SimpleConsole\CommandArgsException; +use Asika\SimpleConsole\Console; use Friendica\App\Mode; use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs; -use Friendica\Core\Logger\Capability\LogChannel; use Friendica\Core\System; use Friendica\Core\Update; use Friendica\Core\Worker; @@ -27,10 +27,8 @@ use RuntimeException; /** * Console command for interacting with the daemon */ -final class Daemon extends AbstractConsole +final class Daemon extends Console { - public const LOG_CHANNEL = LogChannel::DAEMON; - private Mode $mode; private IManageConfigValues $config; private IManageKeyValuePairs $keyValue; @@ -93,8 +91,6 @@ HELP; protected function doExecute() { - $this->checkDeprecated('daemon'); - if ($this->mode->isInstall()) { throw new RuntimeException("Friendica isn't properly installed yet"); } diff --git a/src/Console/JetstreamDaemon.php b/src/Console/JetstreamDaemon.php index d34e5780c2..8bb1e7e106 100644 --- a/src/Console/JetstreamDaemon.php +++ b/src/Console/JetstreamDaemon.php @@ -9,12 +9,12 @@ declare(strict_types=1); namespace Friendica\Console; +use Asika\SimpleConsole\Console; use Friendica\App\Mode; use Friendica\Core\Addon; use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Hook; use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs; -use Friendica\Core\Logger\Capability\LogChannel; use Friendica\Protocol\ATProtocol\Jetstream; use Friendica\System\Daemon as SysDaemon; use RuntimeException; @@ -22,10 +22,8 @@ use RuntimeException; /** * Console command for interacting with the daemon */ -final class JetstreamDaemon extends AbstractConsole +final class JetstreamDaemon extends Console { - public const LOG_CHANNEL = LogChannel::DAEMON; - private Mode $mode; private IManageConfigValues $config; private IManageKeyValuePairs $keyValue; @@ -79,8 +77,6 @@ HELP; protected function doExecute() { - $this->checkDeprecated('jetstream'); - if ($this->mode->isInstall()) { throw new RuntimeException("Friendica isn't properly installed yet"); } diff --git a/src/Console/Worker.php b/src/Console/Worker.php index 1c7eeae002..97b7160d03 100644 --- a/src/Console/Worker.php +++ b/src/Console/Worker.php @@ -9,8 +9,8 @@ declare(strict_types=1); namespace Friendica\Console; +use Asika\SimpleConsole\Console; use Friendica\App\Mode; -use Friendica\Core\Logger\Capability\LogChannel; use Friendica\Core\Update; use Friendica\Core\Worker as CoreWorker; use Friendica\Core\Worker\Repository\Process as ProcessRepository; @@ -19,10 +19,8 @@ use Friendica\Util\BasePath; /** * Console command for starting worker */ -final class Worker extends AbstractConsole +final class Worker extends Console { - public const LOG_CHANNEL = LogChannel::WORKER; - private Mode $mode; private BasePath $basePath; private ProcessRepository $processRepo; @@ -69,8 +67,6 @@ HELP; protected function doExecute() { - $this->checkDeprecated('worker'); - $this->mode->setExecutor(Mode::WORKER); // Check the database structure and possibly fixes it diff --git a/src/Core/Container.php b/src/Core/Container.php index 1017590a85..55e0826122 100644 --- a/src/Core/Container.php +++ b/src/Core/Container.php @@ -11,6 +11,8 @@ namespace Friendica\Core; /** * Dependency Injection Container + * + * @internal */ interface Container { diff --git a/src/Core/DiceContainer.php b/src/Core/DiceContainer.php index 304c1e411d..bd1eaf8043 100644 --- a/src/Core/DiceContainer.php +++ b/src/Core/DiceContainer.php @@ -13,6 +13,8 @@ use Dice\Dice; /** * Wrapper for the Dice class to make some basic setups + * + * @internal */ final class DiceContainer implements Container { diff --git a/src/Core/Logger/Factory/LegacyLoggerFactory.php b/src/Core/Logger/Factory/LegacyLoggerFactory.php index 5c91d11771..2c7b6c0237 100644 --- a/src/Core/Logger/Factory/LegacyLoggerFactory.php +++ b/src/Core/Logger/Factory/LegacyLoggerFactory.php @@ -26,6 +26,8 @@ use Psr\Log\LoggerInterface; * * @see \Friendica\Core\Logger\Factory\StreamLogger * @see \Friendica\Core\Logger\Factory\SyslogLogger + * + * @internal */ final class LegacyLoggerFactory implements LoggerFactory { diff --git a/src/Core/Logger/LoggerManager.php b/src/Core/Logger/LoggerManager.php index 697756099d..8379c91995 100644 --- a/src/Core/Logger/LoggerManager.php +++ b/src/Core/Logger/LoggerManager.php @@ -21,6 +21,8 @@ use Psr\Log\NullLogger; /** * Manager for the core logging instances + * + * @internal */ final class LoggerManager { diff --git a/src/DI.php b/src/DI.php index 7d1114ac5c..c9c973f722 100644 --- a/src/DI.php +++ b/src/DI.php @@ -60,7 +60,8 @@ abstract class DI /** * Returns a clone of the current dice instance - * This useful for overloading the current instance with mocked methods during tests + * + * @internal This useful for overloading the current instance with mocked methods during tests * * @return Dice */