public static function ParseCoreVersion($Path) {
      $fp = fopen($Path, 'rb');
      $Application = FALSE;
      $Version = FALSE;

      while (($Line = fgets($fp)) !== FALSE) {
         if (preg_match("`define\\('(.*?)', '(.*?)'\\);`", $Line, $Matches)) {
            $Name = $Matches[1];
            $Value = $Matches[2];
            switch ($Name) {
               case 'APPLICATION':
                  $Application = $Value;
                  break;
               case 'APPLICATION_VERSION':
                  $Version = $Value;
            }
         }

         if ($Application !== FALSE && $Version !== FALSE)
            break;
      }
      fclose($fp);
      return $Version;
   }