friendica/bin/console.php

39 lines
1.3 KiB
PHP
Raw Normal View History

2018-03-18 13:26:51 -04:00
#!/usr/bin/env php
2018-03-18 05:12:39 -04:00
<?php
/**
2021-03-29 02:40:20 -04:00
* @copyright Copyright (C) 2010-2021, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
2018-03-18 05:12:39 -04:00
if (php_sapi_name() !== 'cli') {
header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden');
exit();
}
2019-08-05 03:02:55 -04:00
use Dice\Dice;
2019-09-17 10:47:00 -04:00
use Psr\Log\LoggerInterface;
2019-08-05 03:02:55 -04:00
require dirname(__DIR__) . '/vendor/autoload.php';
2018-03-18 05:12:39 -04:00
2019-08-05 03:02:55 -04:00
$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php');
2019-09-17 10:47:00 -04:00
$dice = $dice->addRule(LoggerInterface::class,['constructParams' => ['console']]);
2021-10-23 14:46:17 -04:00
\Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class));
(new Friendica\Core\Console($dice, $argv))->execute();