annotate pseudo.php @ 556:80796ff2ae66 Dev_main

Actually the previous commit was broken. This contains a working and more elegant way of checking for the input file length. If the input file is empty, no error is triggered.
author Giulio Moro <giuliomoro@yahoo.it>
date Tue, 23 Feb 2016 14:39:06 +0000
parents 1fc9f982b778
children
rev   line source
n@493 1 <?php
n@493 2 header('Access-Control-Allow-Origin: *');
n@493 3 header("Content-type: text/xml");
n@493 4 $files = glob('saves/' . '*.xml');
n@493 5 $numsaves = 0;
n@493 6 if ( $files !== false )
n@493 7 {
n@493 8 $numsaves = count( $files );
n@493 9 }
n@493 10
n@493 11 $files = glob('pseudo/' . '*.xml');
n@493 12 $numtests = 0;
n@493 13 if ( $numtests !== false )
n@493 14 {
n@493 15 $numtests = count( $files );
n@493 16 }
n@493 17
n@493 18 $testID = ($numsaves % $numtests)-1;
n@493 19
n@493 20 readfile($files[$testID]);
n@493 21 ?>