2017-07-15 20:44:06 +00:00
|
|
|
<?php
|
|
|
|
namespace JKingWeb\Arsse;
|
|
|
|
require_once __DIR__.DIRECTORY_SEPARATOR."bootstrap.php";
|
|
|
|
|
|
|
|
if(\PHP_SAPI=="cli") {
|
2017-07-21 21:15:43 +00:00
|
|
|
// initialize the CLI; this automatically handles --help and --version
|
|
|
|
$cli = new CLI;
|
2017-08-20 03:56:32 +00:00
|
|
|
// handle other CLI requests; some do not require configuration
|
2017-07-21 21:15:43 +00:00
|
|
|
$cli->dispatch();
|
2017-07-15 20:44:06 +00:00
|
|
|
} else {
|
2017-07-21 21:15:43 +00:00
|
|
|
// load configuration
|
|
|
|
Arsse::load(new Conf());
|
2017-08-18 03:05:08 +00:00
|
|
|
if(file_exists(BASE."config.php")) {
|
|
|
|
Arsse::$conf->importFile(BASE."config.php");
|
|
|
|
}
|
2017-07-21 21:15:43 +00:00
|
|
|
// handle Web requests
|
|
|
|
(new REST)->dispatch()->output();
|
2017-07-15 20:44:06 +00:00
|
|
|
}
|