X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=bin%2Fconsole.php;h=41e0172489e672657e1ce56d1fcabbae36192e92;hb=23a8245fb066d2b64ced49b50dd10f40ffabba1e;hp=90e4be392856b135a54907fd06f3345b82afeb22;hpb=c9f02d534e2016acf18d7fa18db193d056495841;p=friendica.git diff --git a/bin/console.php b/bin/console.php index 90e4be3928..41e0172489 100755 --- a/bin/console.php +++ b/bin/console.php @@ -1,9 +1,41 @@ #!/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 Friendica\DI; +use Psr\Log\LoggerInterface; -(new Friendica\Core\Console())->execute(); +require dirname(__DIR__) . '/vendor/autoload.php'; + +$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php'); +$dice = $dice->addRule(LoggerInterface::class,['constructParams' => ['console']]); + +/// @fixme Necessary until Hooks inside the Logger can get loaded without the DI-class +DI::init($dice); +\Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class)); + +(new Friendica\Core\Console($dice, $argv))->execute();