From 5f655f3b9fff2f41754b9612ce178b495910f4d4 Mon Sep 17 00:00:00 2001 From: emkael Date: Wed, 7 Nov 2018 22:08:03 +0100 Subject: Moving app to separate directory, scanning for PBN files in a separate directory Fixes #2 --- tdd/tdd-protocol.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tdd/tdd-protocol.php (limited to 'tdd/tdd-protocol.php') diff --git a/tdd/tdd-protocol.php b/tdd/tdd-protocol.php new file mode 100644 index 0000000..3dcc0d8 --- /dev/null +++ b/tdd/tdd-protocol.php @@ -0,0 +1,29 @@ +get_filename(); +$len = strlen($html_filename); +$request_uri_ending = substr($_SERVER['REQUEST_URI'], -$len-1); +if($request_uri_ending != '/' . $html_filename) { + die('This script cannot be called directly!'); +} +// + +$deals_by_tables = load_deals_for_tables($prefix, $round, $board); +if (count($deals_by_tables) > 0) { + foreach($deals_by_tables as $table => $deal) { + $protocol->set_deal($table, $deal); + } + echo $protocol->output(); +} +else { + readfile($html_filename); +} -- cgit v1.2.3