X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=bin%2Fconsole.php;h=8305176157661a4dc5f5e345d95a97d9094a2dc8;hb=516018861e011865a902587876d484d6f0f42a66;hp=a6513a2e8f992bdd52d5a8bfea7ff81e5c7e94ef;hpb=f8c0f24e34e124ab782d5dcf3d2d658d70e19e5c;p=friendica.git diff --git a/bin/console.php b/bin/console.php index a6513a2e8f..8305176157 100755 --- a/bin/console.php +++ b/bin/console.php @@ -1,5 +1,31 @@ #!/usr/bin/env php . + * + */ + +use Friendica\Network\HTTPException\ForbiddenException; + +if (php_sapi_name() !== 'cli') { + header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden'); + exit(); +} use Dice\Dice; use Psr\Log\LoggerInterface; @@ -9,4 +35,6 @@ 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();