X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=bin%2Fconsole.php;h=4d5b4c79c2894f679239bf039dda6655c711036c;hb=686bf6b32f32852a24286f053feb1c293361e3b6;hp=9c25279d37222a77acb62a186b556761251dd6f6;hpb=3b81c6615029752bfddf80dc6c097dff1ce5c424;p=friendica.git diff --git a/bin/console.php b/bin/console.php index 9c25279d37..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($argv))->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();