1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-23 07:34:55 +00:00
Arsse/arsse.php

32 lines
967 B
PHP
Raw Normal View History

<?php
/** @license MIT
* Copyright 2017 J. King, Dustin Wilson et al.
* See LICENSE and AUTHORS files for details */
2020-03-01 20:16:50 +00:00
declare(strict_types=1);
namespace JKingWeb\Arsse;
2017-08-29 14:50:31 +00:00
const BASE = __DIR__.DIRECTORY_SEPARATOR;
const NS_BASE = __NAMESPACE__."\\";
require_once BASE."vendor".DIRECTORY_SEPARATOR."autoload.php";
ignore_user_abort(true);
ini_set("memory_limit", "-1");
ini_set("max_execution_time", "0");
if (\PHP_SAPI === "cli") {
// initialize the CLI; this automatically handles --help and --version
$cli = new CLI;
// handle other CLI requests; some do not require configuration
$exitStatus = $cli->dispatch();
exit($exitStatus);
} else {
// load configuration
2018-06-18 14:09:43 +00:00
$conf = file_exists(BASE."config.php") ? new Conf(BASE."config.php") : new Conf;
Arsse::load($conf);
// handle Web requests
$emitter = new \Laminas\HttpHandlerRunner\Emitter\SapiEmitter;
$response = (new REST)->dispatch();
$emitter->emit($response);
2017-08-29 14:50:31 +00:00
}