view php/pseudo.php @ 2226:43ab418ba4b8

Separation of tests and media into specific subdirs. The tests directory is scanned and will be used by the php/python for pseudo-random tests.
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Thu, 14 Apr 2016 15:58:52 +0100
parents 760719986df3
children 17d8ac94b284
line wrap: on
line source
<?php
    header('Access-Control-Allow-Origin: *');
	header("Content-type: text/xml");
    $files = glob('../saves/' . '*.xml');
    $numsaves = 0;
    if ( $files !== false )
    {
        $numsaves = count( $files );
    }

    $files = glob('tests/' . '*.xml');
    $numtests = 0;
    if ( $numtests !== false )
    {
        $numtests = count( $files );
    }

    $testID = ($numsaves % $numtests)-1;

	readfile($files[$testID]);
?>