federator/htdocs/api.php
2024-07-17 00:03:39 +02:00

22 lines
657 B
PHP

<?php
/**
* SPDX-FileCopyrightText: 2024 Sascha Nitsch (grumpydeveloper) https://contentnation.net/@grumpydevelop
* SPDX-License-Identifier: GPL-3.0-or-later
*
* @author Sascha Nitsch (grumpydeveloper)
**/
if (! array_key_exists('_call', $_REQUEST)) {
http_response_code(404);
exit();
}
date_default_timezone_set("Europe/Berlin");
spl_autoload_register(function ($className) {
// strip Federator from class path
$className = str_replace('Federator\\', '', $className);
include '../php/' . str_replace("\\", "/", strtolower($className)) . '.php';
});
/// main instance
$contentnation = new \Federator\Api();
$contentnation->run();