X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=bin%2Fconsole.php;h=0684f240e2113b8fe782f69f4ff536faeaf049e7;hb=bf81f21001cead41585ecd549a98afe4e2797840;hp=410eabda094639db0d3d06a9a8eb41ec92220464;hpb=4375edd63e44b71913bd45bf25a4a554582b581e;p=friendica.git diff --git a/bin/console.php b/bin/console.php index 410eabda09..0684f240e2 100755 --- a/bin/console.php +++ b/bin/console.php @@ -1,11 +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 Dice\Dice; +use Psr\Log\LoggerInterface; -use Friendica\Factory; +require dirname(__DIR__) . '/vendor/autoload.php'; -$a = Factory\DependencyFactory::setUp('console', dirname(__DIR__)); -\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();