X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=bin%2Fconsole.php;h=3e588acd6dc99d16ff779ff149f4aa26c4625e4c;hb=881c4204b4d023ed559da386b5e5f2888c97abe0;hp=c39df953f287b0873748816638cd09475b82c5da;hpb=ed7bada71eb7e5d1c2953e94abb47b531781306d;p=friendica.git diff --git a/bin/console.php b/bin/console.php index c39df953f2..3e588acd6d 100755 --- a/bin/console.php +++ b/bin/console.php @@ -1,9 +1,38 @@ #!/usr/bin/env php . + * + */ + +if (php_sapi_name() !== 'cli') { + header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden'); + exit(); +} + +use Dice\Dice; +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']]); + +\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();