예제 #1
0
             *
             * The ONLY case where you should not respond to 
             * the request is when you failed to process the data. If you are 
             * unable to process the notification then either do not respond 
             * with anything or set the success parameter to FALSE in the call 
             * to notificationResponse();
             *
             * Trustly will continue to attempt to deliver this notification 
             * until you respond to it.
             * */
            $response = $api->notificationResponse($notification, TRUE);
            print $response->json();
        }
    }
}
/* Simple dispatcher to the correct function */
$path = $_SERVER['PATH_INFO'];
if ($path == '/orders') {
    orders();
} elseif ($path == '/clear_orders') {
    clear_orders();
} elseif ($path == '/notification') {
    notification();
} elseif ($path == '/deposit') {
    deposit();
} elseif ($path == '/extensions') {
    check_extensions();
} else {
    _http_response_code(404);
}
exit(0);
예제 #2
0
function export_pleiades()
{
    global $levels_dir;
    global $lastrun_file;
    # Make sure our export folder is there
    if (!is_dir($levels_dir)) {
        passthru("mkdir -p {$levels_dir}");
    }
    if (!is_dir($levels_dir)) {
        logprint("Output directory does not exist and failed to be created.");
        exit;
    }
    # Start export
    logprint("\nExporting pleiades levels to folder '{$levels_dir}'");
    $lastrun_time = get_lastrun_date();
    $master_array = get_database_data($lastrun_time);
    $level_count = count($master_array);
    if ($level_count > 0) {
        logprint("Exporting {$level_count} updated files");
        export_to_files($master_array);
    } else {
        logprint("No new levels to export.");
    }
    # Finally udpate our lastrun file
    # And alter timestamp to match modified time
    touch("{$lastrun_file}", strtotime(date("Y-m-d H:i:s")));
}
## Start the script!
check_extensions(array('mysql'));
logprint("\nScript started on: " . date("Y-m-d H:i:s"));
export_pleiades();
예제 #3
0
function check_file($Type, $Name)
{
    check_name($Name);
    check_extensions($Type, $Name);
}