X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=bin%2Fconsole.php;h=35f0b5feefcf3820bfaca4739cca5eaee7e64e49;hb=214a0524ddc069f71c896eef8ccf031033125932;hp=410eabda094639db0d3d06a9a8eb41ec92220464;hpb=4375edd63e44b71913bd45bf25a4a554582b581e;p=friendica.git diff --git a/bin/console.php b/bin/console.php index 410eabda09..35f0b5feef 100755 --- a/bin/console.php +++ b/bin/console.php @@ -1,11 +1,38 @@ #!/usr/bin/env php . + * + */ + +if (php_sapi_name() !== 'cli') { + header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden'); + exit(); +} + +use Dice\Dice; +use Psr\Log\LoggerInterface; require dirname(__DIR__) . '/vendor/autoload.php'; -use Friendica\Factory; +$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php'); +$dice = $dice->addRule(LoggerInterface::class,['constructParams' => ['console']]); -$a = Factory\DependencyFactory::setUp('console', dirname(__DIR__)); -\Friendica\BaseObject::setApp($a); +\Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class)); -(new Friendica\Core\Console($argv))->execute(); +(new Friendica\Core\Console($dice, $argv))->execute();