2022-07-03 22:41:44 +00:00
|
|
|
<?php
|
2022-07-14 20:42:37 +00:00
|
|
|
namespace Uiharu;
|
|
|
|
|
|
|
|
require_once __DIR__ . '/../uiharu.php';
|
|
|
|
|
2022-07-15 22:20:20 +00:00
|
|
|
// should be in a cron job
|
2022-07-14 20:42:37 +00:00
|
|
|
$db->execute('DELETE FROM `uih_metadata_cache` WHERE `metadata_created` < NOW() - INTERVAL 7 DAY');
|
2022-07-03 22:41:44 +00:00
|
|
|
|
2022-07-16 01:40:44 +00:00
|
|
|
$ctx->registerLookup(new \Uiharu\Lookup\EEPROMLookup('eeprom', 'eeprom.flashii.net', ['i.fii.moe', 'i.flashii.net']));
|
|
|
|
if(UIH_DEBUG)
|
|
|
|
$ctx->registerLookup(new \Uiharu\Lookup\EEPROMLookup('devrom', 'eeprom.edgii.net', ['i.edgii.net']));
|
|
|
|
|
2022-07-16 20:45:56 +00:00
|
|
|
$ctx->registerLookup(new \Uiharu\Lookup\YouTubeLookup);
|
2023-01-25 13:37:38 +00:00
|
|
|
$ctx->registerLookup(new \Uiharu\Lookup\NicoNicoLookup);
|
2022-07-16 01:40:44 +00:00
|
|
|
|
2022-07-16 23:19:25 +00:00
|
|
|
// this should always come AFTER other lookups involved http(s)
|
|
|
|
$ctx->registerLookup(new \Uiharu\Lookup\WebLookup);
|
|
|
|
|
2022-07-15 22:20:20 +00:00
|
|
|
$ctx->setupHttp();
|
2022-07-03 22:41:44 +00:00
|
|
|
|
2022-07-15 22:20:20 +00:00
|
|
|
$ctx->registerApi(new \Uiharu\Apis\v1_0($ctx));
|
|
|
|
$ctx->matchApi(filter_input(INPUT_SERVER, 'REQUEST_URI'));
|
2022-07-03 22:41:44 +00:00
|
|
|
|
2022-07-15 22:20:20 +00:00
|
|
|
$ctx->dispatchHttp();
|