X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=bin%2Fconsole.php;h=8305176157661a4dc5f5e345d95a97d9094a2dc8;hb=516018861e011865a902587876d484d6f0f42a66;hp=9c25279d37222a77acb62a186b556761251dd6f6;hpb=4724c7de72cd7bf40af52f0ca07fdf8313b922f4;p=friendica.git diff --git a/bin/console.php b/bin/console.php index 9c25279d37..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($argv))->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();