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