X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=bin%2Fconsole.php;h=0684f240e2113b8fe782f69f4ff536faeaf049e7;hb=8357a70c4bc7a104373be2ddde6e8d918ea5721b;hp=9c25279d37222a77acb62a186b556761251dd6f6;hpb=7dd64dd465117321cdb1e7fce6de6161e92134d8;p=friendica.git diff --git a/bin/console.php b/bin/console.php index 9c25279d37..0684f240e2 100755 --- a/bin/console.php +++ b/bin/console.php @@ -1,9 +1,36 @@ #!/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']]); + +(new Friendica\Core\Console($dice, $argv))->execute();