X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=bin%2Fconsole.php;h=3e588acd6dc99d16ff779ff149f4aa26c4625e4c;hb=55db2670d1662b32c6faa820c60c44e16cffab20;hp=9c25279d37222a77acb62a186b556761251dd6f6;hpb=4724c7de72cd7bf40af52f0ca07fdf8313b922f4;p=friendica.git diff --git a/bin/console.php b/bin/console.php index 9c25279d37..3e588acd6d 100755 --- a/bin/console.php +++ b/bin/console.php @@ -1,9 +1,38 @@ #!/usr/bin/env php . + * + */ -include_once dirname(__DIR__) . '/boot.php'; +if (php_sapi_name() !== 'cli') { + header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden'); + exit(); +} -$a = new Friendica\App(dirname(__DIR__)); -\Friendica\BaseObject::setApp($a); +use Dice\Dice; +use Psr\Log\LoggerInterface; -(new Friendica\Core\Console($argv))->execute(); +require dirname(__DIR__) . '/vendor/autoload.php'; + +$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php'); +$dice = $dice->addRule(LoggerInterface::class,['constructParams' => ['console']]); + +\Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class)); + +(new Friendica\Core\Console($dice, $argv))->execute();