BookReader is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. BookReader is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with BookReader. If not, see . */ require_once('../datanode/BookReaderImages.inc.php'); try { switch ($_REQUEST['test']) { case 'pageparse': $bri = new BookReaderImages(); ok('text/javascript'); print( json_encode($bri->parsePageRequest($_REQUEST['value'], $_REQUEST['bookPrefix'])) ); break; default: ok('text/html'); print "BookReader Tests"; print ""; print "

Available tests

"; print "
";
            print "pageparse value bookPrefix";
            print "";
            print "";
            break;
    }
    
} catch (Exception $e) {
    print "Error serving request:\n";
    print "  " . $e->getMessage() . "\n\n";
    print "Debugging information:\n";
    echo $e->getTraceAsString();
}

function ok($type) {
    header('HTTP/1.0 200 OK');
    header('Content-type: ' . $type);
}

?>