HEX
Server: Apache
System: Linux www3.pit.tblive.com 5.14.0-687.38.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Aug 12 17:19:12 EDT 2026 x86_64
User: awaldron (1020)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/awaldron/_domains/api.alanwaldron.com/index.php
<?php
require_once 'stripe/init.php';
require_once 'v1/_globals.php';


define('E_FATAL',  E_ERROR | E_USER_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_RECOVERABLE_ERROR);
define('ENV', 'production');
define('DISPLAY_ERRORS', TRUE);
define('ERROR_REPORTING', E_ALL & ~E_NOTICE);
define('LOG_ERRORS', FALSE);

register_shutdown_function('shut');
set_error_handler('handler');
ob_start();

// INIT VENDOR LIBRARIES
require_once 'vendor/phpmailer/phpmailer/src/Exception.php';
require_once 'vendor/phpmailer/phpmailer/src/PHPMailer.php';
require_once 'vendor/phpmailer/phpmailer/src/SMTP.php';
require_once 'vendor/autoload.php';

use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

// INCLUDE OUR ENDPOINT FILES
require_once 'v1/auth.php';
require_once 'v1/payments.php';
require_once 'v1/mail.php';
//require_once 'v1/misc.php';
require_once 'v1/members.php';

// SET CORS POLICY
cors();

// PARSE THE URL AND DATA
$method = $_SERVER['REQUEST_METHOD'];
$request = explode('/', substr($_SERVER['REQUEST_URI'],1));
$function = strtolower($method.'_'.$request[0].'_'.$request[1].'_'.$request[2]);

// remove the first 3 items from the request
array_shift($request);
array_shift($request);
array_shift($request);

// format the post body
$body = [];
$postBody = file_get_contents('php://input');
if ( strlen($postBody) > 0 ) {
    $body = json_decode( $postBody, true );
}

// Connect to the database
$db = dbconnect();

// Check the token
$auth_user = 1; //check_token( $db, $_SERVER['HTTP_AUTHORIZATION'] );

// Check if user is an Admin
$is_admin = true; 

// Call the endpoint
if (function_exists($function)) {
    call_user_func($function, $request, $body, $auth_user, $is_admin, $db);
} else {
    response( 404, ['success'=>false,'error'=>'Endpoint not found...'.$function] );
}


ob_end_flush();