X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=bin%2Fconsole.php;h=e1bc6b498547f4e15e368ad429c489333a474bd9;hb=378e7365ffb23634bdb97fcc5e8680ad4c5fdf11;hp=c39df953f287b0873748816638cd09475b82c5da;hpb=2f49c4a0586610c3a89b6342a90b916b95719d10;p=friendica.git diff --git a/bin/console.php b/bin/console.php index c39df953f2..e1bc6b4985 100755 --- a/bin/console.php +++ b/bin/console.php @@ -1,9 +1,41 @@ #!/usr/bin/env php . + * + */ + +if (php_sapi_name() !== 'cli') { + header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden'); + exit(); +} + +use Dice\Dice; +use Friendica\DI; +use Psr\Log\LoggerInterface; require dirname(__DIR__) . '/vendor/autoload.php'; -$a = new Friendica\App(dirname(__DIR__)); -\Friendica\BaseObject::setApp($a); +$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php'); +$dice = $dice->addRule(LoggerInterface::class,['constructParams' => ['console']]); + +/// @fixme Necessary until Hooks inside the Logger can get loaded without the DI-class +DI::init($dice); +\Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class)); -(new Friendica\Core\Console($argv))->execute(); +(new Friendica\Core\Console($dice, $argv))->execute();