X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=bin%2Fconsole.php;h=4d5b4c79c2894f679239bf039dda6655c711036c;hb=974f7bffc82d024a38b4709c6b250677a217f65a;hp=90e4be392856b135a54907fd06f3345b82afeb22;hpb=27d94023eef0263a3ce9750f79a73ac941a25304;p=friendica.git diff --git a/bin/console.php b/bin/console.php index 90e4be3928..4d5b4c79c2 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())->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();