New Bootstrap loader to handle AJAX requests independently.
bootstrap.php
AJAX files:
More updates will follow. This was a fluke idea I had, in order to seperate my ajax scripts and not rely on the main core files outside of the directory. Completely portable.
bootstrap.php
<?
// ST AJAX Bootstrapper
require_once '../config.php';
// Autoloader
spl_autoload_register(function ($className) {
include_once '../classes/' . $className . '.php';
});
// Init objects
$account = new STAccounts;
$db = $CONFIG['db']['type'] == 'mysql' ? new MySQLConnect : new PostgreSQLConnect;
// Connect to db
$db->connect();
// Additional functions
function html_escape(string $s): ?string
{
return htmlspecialchars($s, ENT_QUOTES, 'UTF-8');
}
AJAX files:
require_once 'bootstrap.php';More updates will follow. This was a fluke idea I had, in order to seperate my ajax scripts and not rely on the main core files outside of the directory. Completely portable.
Last edited by STorrents2020 on 2021-08-09 21:57:31