Bulk substitution across all PHP files in src/, build.php, worker.php, and web/frontend/. Updates composer.json's package name and PSR-4 autoload root accordingly. Casing matches the existing IndifferentKetchup\Codex package's namespace convention (capital K). Strictly a namespace rename. Aternos\Codex\* imports remain in place; those get re-pointed in a follow-up commit when the codex Composer dependency itself is swapped. Filename renames (docker/mclogs.ini, web/public/css/mclogs.css), README walk-through, env-var prefix changes, and visible-text branding land in subsequent commits.
37 lines
979 B
PHP
37 lines
979 B
PHP
<?php
|
|
|
|
use IndifferentKetchup\Iblogs\Api\ApiRouter;
|
|
use IndifferentKetchup\Iblogs\Config\Config;
|
|
use IndifferentKetchup\Iblogs\Config\ConfigKey;
|
|
use IndifferentKetchup\Iblogs\Frontend\FrontendRouter;
|
|
use IndifferentKetchup\Iblogs\Storage\MongoDBClient;
|
|
use IndifferentKetchup\Iblogs\Util\URL;
|
|
|
|
require_once __DIR__ . '/vendor/autoload.php';
|
|
|
|
try {
|
|
MongoDBClient::getInstance()->ensureIndexes();
|
|
} catch (Exception $e) {
|
|
error_log("Failed to ensure MongoDB indexes: " . $e->getMessage());
|
|
}
|
|
|
|
$requestCount = 0;
|
|
$maxRequests = Config::getInstance()->get(ConfigKey::WORKER_REQUESTS);
|
|
|
|
do {
|
|
$running = \frankenphp_handle_request(function () {
|
|
|
|
MongoDBClient::getInstance()->reset();
|
|
URL::clear();
|
|
|
|
if (URL::isApi()) {
|
|
ApiRouter::getInstance()->run();
|
|
} else {
|
|
FrontendRouter::getInstance()->run();
|
|
}
|
|
});
|
|
|
|
gc_collect_cycles();
|
|
|
|
$requestCount++;
|
|
} while ($running && $requestCount < $maxRequests); |