X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=bin%2Fconsole.php;h=3e588acd6dc99d16ff779ff149f4aa26c4625e4c;hb=1301a53f20a5164d484a3a83368d4eb9174523ae;hp=6fa804fb98e3789f2596c68f9a543266abdd8810;hpb=92c1cbeeeccf31ae311b532866610b48c97dccfe;p=friendica.git diff --git a/bin/console.php b/bin/console.php index 6fa804fb98..3e588acd6d 100755 --- a/bin/console.php +++ b/bin/console.php @@ -1,14 +1,38 @@ #!/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'; -$dice = new \Dice\Dice(); -$dice = $dice->addRules(include __DIR__ . '/../static/dependencies.config.php'); +$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php'); +$dice = $dice->addRule(LoggerInterface::class,['constructParams' => ['console']]); -$a = Factory\DependencyFactory::setUp('console', $dice); -\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();