diff --git a/CHANGELOG b/CHANGELOG index e8a5184..680c245 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,12 @@ THIS CHANGELOG IS AN ATTEMPT TO DOCUMENT CHANGES TO THIS PROJECT. SUPER MINOR REVISION NUMBERS WON'T SHOW UP IN GITHUB BUT IT'LL HELP ME ORGANIZE WHEN I MADE A SET OF FIXES +DET-v0.9.0 (Aug. 24, 2012) + - FIX: updated Modernizr to 2.6.1 + - FIX: trimmed down the config + - FIX: the test build page now waits for the onload event before building the cookie & redirecting. should address race conditions with a few tests. + - ADD: added per-session tests that existed in Modernizr feature-detects that I wanted for v1.0 of Detector (see http://bit.ly/O14wcZ for full list) + DET-v0.8.5 (Aug. 14, 2012) - FIX: commmented out call to addToUAList() to increase performance - ADD: now throwing profiles into directories based on the first two characters of the hash. performance tweak because IE 7+8 create profiles an amazing number of profiles diff --git a/lib/Detector/Detector.php b/lib/Detector/Detector.php index b310115..31f2b64 100644 --- a/lib/Detector/Detector.php +++ b/lib/Detector/Detector.php @@ -15,28 +15,33 @@ class Detector { - private static $debug = false; // gets overwritten by the config so changing this won't do anything for you... + private static $debug = false; // gets overwritten by the config so changing this won't do anything for you... public static $ua; public static $accept; - - private static $coreVersion; - private static $extendedVersion; - - public static $foundIn; // this is just for the demo. won't ever really be needed i don't think - + private static $uaHash; private static $sessionID; private static $cookieID; - private static $uaFeaturesMaxJS; // all the default Modernizr Tests - private static $uaFeaturesMinJS; // NO default tests except media queries, meant to run those in the perrequest folder - private static $uaFeaturesCore; - private static $uaFeaturesExtended; - private static $uaFeaturesPerSession; - private static $uaFeaturesPerRequest; + + // version number so that profiles can be rebuilt if necessary + private static $coreVersion = "0.95"; + private static $extendedVersion; + + // where to find the modernizr scripts + private static $uaFeaturesMaxJS = "lib/modernizr/modernizr.full.js"; // all the default Modernizr Tests + private static $uaFeaturesMinJS = "lib/modernizr/modernizr.slim.js"; // NO default tests except media queries, meant to run those in the perrequest folder + + // where to find the tests that should be run against browsers + private static $uaFeaturesCore = "tests/core/"; + private static $uaFeaturesExtended = "tests/extended/"; + private static $uaFeaturesPerSession = "tests/persession/"; + private static $uaFeaturesPerRequest = "tests/perrequest/"; + + // where to find the user agent profiles + private static $uaDirCore = "user-agents/core/"; + private static $uaDirExtended = "user-agents/extended/"; - private static $uaDirCore; - private static $uaDirExtended; private static $featuresScriptWebPath; @@ -48,6 +53,8 @@ class Detector { public static $noJSDefaultFamily; public static $noCookieFamily; + public static $foundIn; // this is just for the demo. won't ever really be needed i don't think + /** * Configures the shared variables in Detector so that they can be used in functions that might not need to run Detector::build(); * @@ -312,6 +319,12 @@ public static function build() { // unset the cookie that held the vast amount of test data setcookie(self::$cookieID,""); + setcookie(self::$cookieID,"",time()-3600); + + unset($jsonTemplateCore); + unset($jsonTemplateExtended); + unset($cookiePerSession); + unset($cookiePerRequest); // add our collected data to the session for use in future requests, also add the per request data if (isset($_SESSION)) { @@ -361,6 +374,7 @@ public static function persession() { readfile(__DIR__ . '/' . self::$uaFeaturesMinJS); self::readDirFiles(self::$uaFeaturesPerSession); self::readDirFiles(self::$uaFeaturesPerRequest); + readfile(__DIR__. '/lib/modernizr/onload.js'); print self::_mer() . "