2018-03-18 17:26:51 +00:00
|
|
|
#!/usr/bin/env php
|
2018-03-18 09:12:39 +00:00
|
|
|
<?php
|
2020-02-09 15:34:23 +00:00
|
|
|
/**
|
2023-01-01 14:36:24 +00:00
|
|
|
* @copyright Copyright (C) 2010-2023, the Friendica project
|
2020-02-09 15:34:23 +00:00
|
|
|
*
|
|
|
|
* @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 09:12:39 +00:00
|
|
|
|
2020-09-07 09:51:26 +00:00
|
|
|
if (php_sapi_name() !== 'cli') {
|
|
|
|
header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden');
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
2019-08-05 07:02:55 +00:00
|
|
|
use Dice\Dice;
|
2023-07-23 01:21:41 +00:00
|
|
|
use Friendica\Core\Logger\Capability\LogChannel;
|
2022-10-17 19:25:04 +00:00
|
|
|
use Friendica\DI;
|
2019-09-17 14:47:00 +00:00
|
|
|
use Psr\Log\LoggerInterface;
|
2019-08-05 07:02:55 +00:00
|
|
|
|
2018-12-24 14:56:48 +00:00
|
|
|
require dirname(__DIR__) . '/vendor/autoload.php';
|
2018-03-18 09:12:39 +00:00
|
|
|
|
2019-08-05 07:02:55 +00:00
|
|
|
$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php');
|
2023-07-23 01:21:41 +00:00
|
|
|
/** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */
|
|
|
|
$addonLoader = $dice->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class);
|
2023-07-02 21:56:56 +00:00
|
|
|
$dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies'));
|
|
|
|
$dice = $dice->addRule(LoggerInterface::class, ['constructParams' => [LogChannel::CONSOLE]]);
|
2019-07-20 23:22:10 +00:00
|
|
|
|
2022-10-17 19:25:04 +00:00
|
|
|
/// @fixme Necessary until Hooks inside the Logger can get loaded without the DI-class
|
|
|
|
DI::init($dice);
|
2021-10-23 18:46:17 +00:00
|
|
|
\Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class));
|
|
|
|
|
2019-07-28 20:06:33 +00:00
|
|
|
(new Friendica\Core\Console($dice, $argv))->execute();
|