modified: xbotcontrol.php
This commit is contained in:
@@ -7,35 +7,33 @@ require __DIR__ . '/vendor/autoload.php';
|
||||
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
|
||||
$dotenv->load();
|
||||
$_ENV['APP_DIR'] = __DIR__;
|
||||
$_ENV['X_LISTEN'] = '0.0.0.0:7500';
|
||||
|
||||
|
||||
|
||||
|
||||
XBotControl\InitTables::create();
|
||||
$app = new FrameworkX\App();
|
||||
|
||||
$app->get(
|
||||
'/mirror',
|
||||
$app->any(
|
||||
'/mirror[/{original_uri:.*}]',
|
||||
function (Psr\Http\Message\ServerRequestInterface $request) {
|
||||
return XBotControl\Request::save($request);
|
||||
}
|
||||
);
|
||||
|
||||
$app->get('/mirror1', function () {
|
||||
return React\Http\Message\Response::plaintext(
|
||||
"Hello wörld!\n"
|
||||
);
|
||||
});
|
||||
$app->any('/', XBotControl\Controllers\IndexController::class);
|
||||
|
||||
$app->any('/api/{action}/{resource}', XBotControl\Controllers\APIController::class);
|
||||
|
||||
|
||||
XBotControl\Classes\Schedule::run();
|
||||
|
||||
$app->get('/cp', function (Psr\Http\Message\ServerRequestInterface $request) {
|
||||
return React\Http\Message\Response::plaintext(
|
||||
"Hello " . $request->getAttribute('name') . "!\n"
|
||||
);
|
||||
});
|
||||
|
||||
$app->run();
|
||||
|
||||
XBotControl\Storage::getInstance()->db->query('PRAGMA main.wal_checkpoint;')
|
||||
XBotControl\Storage::getInstance()->db->query('VACUUM;')
|
||||
->then(function () {
|
||||
XBotControl\Storage::getInstance()->db->query('PRAGMA main.wal_checkpoint;');
|
||||
})->then(function () {
|
||||
XBotControl\Storage::getInstance()->db->quit();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user