friendica-github/bin/jetstream.php

34 lines
832 B
PHP
Executable file

#!/usr/bin/env php
<?php
/**
* Copyright (C) 2010-2024, the Friendica project
* SPDX-FileCopyrightText: 2010-2024 the Friendica project
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*
*/
use Dice\Dice;
use Friendica\Core\Addon;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Database\DBA;
use Friendica\DI;
use Psr\Log\LoggerInterface;
use Friendica\Protocol\ATProtocol\Jetstream;
if (php_sapi_name() !== 'cli') {
header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden');
exit();
}
// Ensure that Jetstream.php is executed from the base path of the installation
chdir(dirname(__DIR__));
require dirname(__DIR__) . '/vendor/autoload.php';
$dice = (new Dice())->addRules(require(dirname(__DIR__) . '/static/dependencies.config.php'));
$app = \Friendica\App::fromDice($dice);
$app->processJetstream();