X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=bin%2Fconsole.php;h=8305176157661a4dc5f5e345d95a97d9094a2dc8;hb=516018861e011865a902587876d484d6f0f42a66;hp=90e4be392856b135a54907fd06f3345b82afeb22;hpb=5e5fde0a63c57d2873bfa29404110269ca9abeee;p=friendica.git diff --git a/bin/console.php b/bin/console.php index 90e4be3928..8305176157 100755 --- a/bin/console.php +++ b/bin/console.php @@ -1,9 +1,40 @@ #!/usr/bin/env php . + * + */ -include_once dirname(__DIR__) . '/boot.php'; +use Friendica\Network\HTTPException\ForbiddenException; -$a = new Friendica\App(dirname(__DIR__)); -\Friendica\BaseObject::setApp($a); +if (php_sapi_name() !== 'cli') { + header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden'); + exit(); +} -(new Friendica\Core\Console())->execute(); +use Dice\Dice; +use Psr\Log\LoggerInterface; + +require dirname(__DIR__) . '/vendor/autoload.php'; + +$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($dice, $argv))->execute();