federator/htdocs/api.php

23 lines
657 B
PHP
Raw Normal View History

2024-07-15 20:46:44 +02:00
<?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();