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