diff options
author | emkael <emkael@tlen.pl> | 2018-11-14 00:02:29 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2018-11-14 00:15:51 +0100 |
commit | e80a2610d5b29b35fa7a787bb5e8ae72c856c2c8 (patch) | |
tree | f12c608e07acd7c4c52654c4a49b662f1718a1aa /tdd/tdd-bootstrap.php | |
parent | 9e6bd1bd8eeb3aa9dd3ca43dbe7f798b88c46dd0 (diff) |
Matching tournament prefixes and rounds in board DB against URI parts, not the other way around.
Fixes #1
Diffstat (limited to 'tdd/tdd-bootstrap.php')
-rw-r--r-- | tdd/tdd-bootstrap.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tdd/tdd-bootstrap.php b/tdd/tdd-bootstrap.php index 6efbf7b..03dc621 100644 --- a/tdd/tdd-bootstrap.php +++ b/tdd/tdd-bootstrap.php @@ -14,7 +14,7 @@ class Protocol { static::$translations = json_decode(file_get_contents('translations.json'), TRUE); } $this->deals_by_tables = array(); - if(!file_exists($this->get_filename())) { + if (!file_exists($this->get_filename())) { throw new Exception('file not found: ' . $this->get_filename()); } } @@ -190,8 +190,9 @@ class Deal { define('TIMESTAMP_FILE', '.tdd-timestamps.cache'); define('RECORDS_FILE', '.tdd-records.cache'); -function load_deals_for_tables($prefix, $round, $board_in_teamy) { - $db = unserialize(file_get_contents(RECORDS_FILE)); +$board_database = unserialize(file_get_contents(RECORDS_FILE)); + +function load_deals_for_tables($db, $prefix, $round, $board_in_teamy) { if (isset($db[$prefix])) { if (isset($db[$prefix][$round])) { if (isset($db[$prefix][$round][$board_in_teamy])) { @@ -214,6 +215,7 @@ function get_files_timestamps($files = array()) { } function compile_record_database($files, $dbFile) { + global $board_database; $db = array(); foreach ($files as $filename) { $filename = basename($filename); @@ -263,6 +265,7 @@ function compile_record_database($files, $dbFile) { } } file_put_contents(RECORDS_FILE, serialize($db)); + $board_database = $db; } function refresh_board_database() { |