X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=bin%2Fconsole.php;h=4d5b4c79c2894f679239bf039dda6655c711036c;hb=686bf6b32f32852a24286f053feb1c293361e3b6;hp=6fa804fb98e3789f2596c68f9a543266abdd8810;hpb=55e2006312ed9b795e26cb9a8ad012bd3a364d6a;p=friendica.git diff --git a/bin/console.php b/bin/console.php index 6fa804fb98..4d5b4c79c2 100755 --- a/bin/console.php +++ b/bin/console.php @@ -1,14 +1,36 @@ #!/usr/bin/env php . + * + */ -require dirname(__DIR__) . '/vendor/autoload.php'; +if (php_sapi_name() !== 'cli') { + header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden'); + exit(); +} -use Friendica\Factory; +use Dice\Dice; +use Psr\Log\LoggerInterface; -$dice = new \Dice\Dice(); -$dice = $dice->addRules(include __DIR__ . '/../static/dependencies.config.php'); +require dirname(__DIR__) . '/vendor/autoload.php'; -$a = Factory\DependencyFactory::setUp('console', $dice); -\Friendica\BaseObject::setApp($a); +$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php'); +$dice = $dice->addRule(LoggerInterface::class,['constructParams' => ['console']]); -(new Friendica\Core\Console($argv))->execute(); +(new Friendica\Core\Console($dice, $argv))->execute();