From 2ca4be349d96e9fe442fe8de46b03d45d97dd3b6 Mon Sep 17 00:00:00 2001 From: Michael Larabel Date: Thu, 11 Sep 2008 20:55:02 -0400 Subject: pts-core: Add test type caching support --- pts-core/functions/pts-functions.php | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'pts-core/functions') diff --git a/pts-core/functions/pts-functions.php b/pts-core/functions/pts-functions.php index 88ebb08..a1dfdb0 100644 --- a/pts-core/functions/pts-functions.php +++ b/pts-core/functions/pts-functions.php @@ -68,14 +68,22 @@ if(function_exists("pts_module_start_process")) function pts_test_type($identifier) { // Determine type of test based on identifier - - $test_type = false; - if(!empty($identifier)) + if(isset($GLOBALS["PTS_VAR_CACHE"]["TEST_TYPE"][$identifier])) + { + $test_type = $GLOBALS["PTS_VAR_CACHE"]["TEST_TYPE"][$identifier]; + } + else { - if(is_file(XML_PROFILE_DIR . $identifier . ".xml")) - $test_type = TYPE_TEST; - else if(is_file(XML_SUITE_DIR . $identifier . ".xml")) - $test_type = TYPE_TEST_SUITE; + $test_type = false; + if(!empty($identifier)) + { + if(is_file(XML_PROFILE_DIR . $identifier . ".xml")) + $test_type = TYPE_TEST; + else if(is_file(XML_SUITE_DIR . $identifier . ".xml")) + $test_type = TYPE_TEST_SUITE; + + $GLOBALS["PTS_VAR_CACHE"]["TEST_TYPE"][$identifier] = $test_type; + } } return $test_type; -- cgit