X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=bin%2Fconsole.php;h=0684f240e2113b8fe782f69f4ff536faeaf049e7;hb=57ac1e5b927bee679260089165eedc6af2610490;hp=d783e1159f7a273a1e6e350537ae2cbc83c022bc;hpb=fe8f0e00454919e3ee1150a2e75badb55a273c3a;p=friendica.git diff --git a/bin/console.php b/bin/console.php index d783e1159f..0684f240e2 100755 --- a/bin/console.php +++ b/bin/console.php @@ -1,13 +1,36 @@ #!/usr/bin/env php . + * + */ -require dirname(__DIR__) . '/vendor/autoload.php'; +if (php_sapi_name() !== 'cli') { + header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden'); + exit(); +} -use Friendica\Core\Logger; +use Dice\Dice; +use Psr\Log\LoggerInterface; -$logger = Logger::create('console'); +require dirname(__DIR__) . '/vendor/autoload.php'; -$a = new Friendica\App(dirname(__DIR__), $logger); -\Friendica\BaseObject::setApp($a); +$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php'); +$dice = $dice->addRule(LoggerInterface::class,['constructParams' => ['console']]); -(new Friendica\Core\Console($argv))->execute(); +(new Friendica\Core\Console($dice, $argv))->execute();