X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=bin%2Fconsole.php;h=0684f240e2113b8fe782f69f4ff536faeaf049e7;hb=57ac1e5b927bee679260089165eedc6af2610490;hp=3a64d1d2a05060ae51b808225290be9b86582bfd;hpb=e9f0c4dbfb4a7c8732e7c4408b10941ae9efa2c9;p=friendica.git diff --git a/bin/console.php b/bin/console.php index 3a64d1d2a0..0684f240e2 100755 --- a/bin/console.php +++ b/bin/console.php @@ -1,9 +1,36 @@ #!/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'; -$dice = new \Dice\Dice(); -$dice = $dice->addRules(include __DIR__ . '/../static/dependencies.config.php'); +$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php'); +$dice = $dice->addRule(LoggerInterface::class,['constructParams' => ['console']]); (new Friendica\Core\Console($dice, $argv))->execute();