本文整理汇总了PHP中QApplication::ScriptName方法的典型用法代码示例。如果您正苦于以下问题:PHP QApplication::ScriptName方法的具体用法?PHP QApplication::ScriptName怎么用?PHP QApplication::ScriptName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QApplication
的用法示例。
在下文中一共展示了QApplication::ScriptName方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: InitializeForCli
protected static function InitializeForCli()
{
// We should only run through this logic if we are specifically running
// a CLI script through the Qcodo CLI Runner Wrapper (e.g. "qcodo" or "qcodo.bat")
if (!array_key_exists('QCODO_CLI_RUNNER', $_SERVER) || !$_SERVER['QCODO_CLI_RUNNER']) {
return;
}
// Initialize autoLoad functionality for Cli specific files
spl_autoload_register(array('QCli', 'AutoloadCli'));
// Did we ask for a script to be run?
if (!array_key_exists(1, $_SERVER['argv']) || substr($_SERVER['argv'][1], 0, 1) == '-') {
$strDefaultPath = __DEVTOOLS_CLI__;
$strDefaultPath = str_replace('/html/../', '/', $strDefaultPath);
$strDefaultPath = str_replace('/docroot/../', '/', $strDefaultPath);
$strDefaultPath = str_replace('/wwwroot/../', '/', $strDefaultPath);
$strDefaultPath = str_replace('/www/../', '/', $strDefaultPath);
print "Qcodo CLI Runner v" . QCODO_VERSION . "\r\n";
print "usage: qcodo SCRIPT [SCRIPT-SPECIFIC ARGS]\r\n";
print "\r\n";
print "required parameters:\r\n";
print " SCRIPT the .cli.php script name inside the cli/scripts directory\r\n";
print " that you wish to run\r\n";
print "\r\n";
print "the following SCRIPTs are included with the Qcodo distribution:\r\n";
print " codegen Code generates your ORM-layer\r\n";
print " qcodo-updater Updates your installed Qcodo framework to a new version\r\n";
print " qpm-download Download and installs an external QPM package\r\n";
print " qpm-upload Packages custom code you wrote into a QPM package\r\n";
print " clean Cleans code generated files (only those overwritten by codegen)\r\n";
print " compilejs Minifies core qcodo javascript files, run after any changes to those files\r\n";
print "\r\n";
print "Other custom scripts can be created as well.\r\n";
print "See \"" . $strDefaultPath . "/scripts/_README.txt\" for more info";
print "\r\n";
exit(1);
}
// Find Script
if (strpos($_SERVER['argv'][1], '.cli.php') === false) {
$strScriptFilename = $_SERVER['argv'][1] . '.cli.php';
} else {
$strScriptFilename = $_SERVER['argv'][1];
}
if (file_exists($strPath = __DEVTOOLS_CLI__ . '/scripts/' . $strScriptFilename)) {
QApplication::$ScriptFilename = $strPath;
QApplication::$ScriptName = $strScriptFilename;
} else {
if (file_exists($strPath = __DEVTOOLS_CLI__ . '/scripts/_core/' . $strScriptFilename)) {
QApplication::$ScriptFilename = $strPath;
QApplication::$ScriptName = $strScriptFilename;
} else {
print "error: the script '" . $_SERVER['argv'][1] . "' does not exist.\r\n";
exit(1);
}
}
}
示例2: Initialize
/**
* This should be the first call to initialize all the static variables
* The application object also has static methods that are miscellaneous web
* development utilities, etc.
*
* @return void
*/
public static function Initialize()
{
$strCacheProviderClass = 'QCacheProviderNoCache';
if (defined('CACHE_PROVIDER_CLASS')) {
$strCacheProviderClass = CACHE_PROVIDER_CLASS;
}
if ($strCacheProviderClass) {
if (defined('CACHE_PROVIDER_OPTIONS')) {
QApplicationBase::$objCacheProvider = new $strCacheProviderClass(unserialize(CACHE_PROVIDER_OPTIONS));
} else {
QApplicationBase::$objCacheProvider = new $strCacheProviderClass();
}
}
// Are we running as CLI?
if (PHP_SAPI == 'cli') {
QApplication::$CliMode = true;
} else {
QApplication::$CliMode = false;
}
// Setup Server Address
if (array_key_exists('LOCAL_ADDR', $_SERVER)) {
QApplication::$ServerAddress = $_SERVER['LOCAL_ADDR'];
} else {
if (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER)) {
QApplication::$ServerAddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
if (array_key_exists('SERVER_ADDR', $_SERVER)) {
QApplication::$ServerAddress = $_SERVER['SERVER_ADDR'];
}
}
}
// Setup ScriptFilename and ScriptName
QApplication::$ScriptFilename = $_SERVER['SCRIPT_FILENAME'];
QApplication::$ScriptName = $_SERVER['SCRIPT_NAME'];
// Ensure both are set, or we'll have to abort
if (!QApplication::$ScriptFilename || !QApplication::$ScriptName) {
throw new Exception('Error on QApplication::Initialize() - ScriptFilename or ScriptName was not set');
}
// Setup PathInfo and QueryString (if applicable)
QApplication::$PathInfo = null;
if (array_key_exists('PATH_INFO', $_SERVER)) {
QApplication::$PathInfo = urlencode(trim($_SERVER['PATH_INFO']));
QApplication::$PathInfo = str_ireplace('%2f', '/', QApplication::$PathInfo);
}
QApplication::$QueryString = array_key_exists('QUERY_STRING', $_SERVER) ? $_SERVER['QUERY_STRING'] : null;
// Setup RequestUri
if (defined('__URL_REWRITE__')) {
switch (strtolower(__URL_REWRITE__)) {
case 'apache':
QApplication::$RequestUri = $_SERVER['REQUEST_URI'];
break;
case 'none':
QApplication::$RequestUri = sprintf('%s%s%s', QApplication::$ScriptName, QApplication::$PathInfo, QApplication::$QueryString ? sprintf('?%s', QApplication::$QueryString) : null);
break;
default:
throw new Exception('Invalid URL Rewrite type: ' . __URL_REWRITE__);
}
} else {
QApplication::$RequestUri = sprintf('%s%s%s', QApplication::$ScriptName, QApplication::$PathInfo, QApplication::$QueryString ? sprintf('?%s', QApplication::$QueryString) : null);
}
// Setup DocumentRoot
QApplication::$DocumentRoot = trim(__DOCROOT__);
// Setup Browser Type
if (array_key_exists('HTTP_USER_AGENT', $_SERVER)) {
$strUserAgent = trim(strtolower($_SERVER['HTTP_USER_AGENT']));
QApplication::$BrowserType = 0;
// INTERNET EXPLORER (supporting versions 6.0, 7.0 and eventually 8.0)
if (strpos($strUserAgent, 'msie') !== false) {
QApplication::$BrowserType = QApplication::$BrowserType | QBrowserType::InternetExplorer;
if (strpos($strUserAgent, 'msie 6.0') !== false) {
QApplication::$BrowserType = QApplication::$BrowserType | QBrowserType::InternetExplorer_6_0;
} else {
if (strpos($strUserAgent, 'msie 7.0') !== false) {
QApplication::$BrowserType = QApplication::$BrowserType | QBrowserType::InternetExplorer_7_0;
} else {
if (strpos($strUserAgent, 'msie 8.0') !== false) {
QApplication::$BrowserType = QApplication::$BrowserType | QBrowserType::InternetExplorer_8_0;
} else {
QApplication::$BrowserType = QApplication::$BrowserType | QBrowserType::Unsupported;
}
}
}
// FIREFOX (supporting versions 1.0, 1.5, 2.0 and eventually 3.0)
} else {
if (strpos($strUserAgent, 'firefox') !== false || strpos($strUserAgent, 'iceweasel') !== false) {
QApplication::$BrowserType = QApplication::$BrowserType | QBrowserType::Firefox;
$strUserAgent = str_replace('iceweasel/', 'firefox/', $strUserAgent);
if (strpos($strUserAgent, 'firefox/1.0') !== false) {
QApplication::$BrowserType = QApplication::$BrowserType | QBrowserType::Firefox_1_0;
} else {
if (strpos($strUserAgent, 'firefox/1.5') !== false) {
QApplication::$BrowserType = QApplication::$BrowserType | QBrowserType::Firefox_1_5;
} else {
//.........这里部分代码省略.........
示例3: InitializeForCli
protected static function InitializeForCli()
{
// We should only run through this logic if we are specifically running
// a CLI script through the Qcodo CLI Runner Wrapper (e.g. "qcodo" or "qcodo.bat")
if (!array_key_exists('QCODO_CLI_RUNNER', $_SERVER) || !$_SERVER['QCODO_CLI_RUNNER']) {
return;
}
// Did we ask for a script to be run?
if (!array_key_exists(1, $_SERVER['argv']) || substr($_SERVER['argv'][1], 0, 1) == '-') {
print "Qcodo CLI Runner v" . QCODO_VERSION . "\r\n";
print "usage: qcodo SCRIPT [SCRIPT-SPECIFIC ARGS]\r\n";
print "\r\n";
print "required parameters:\r\n";
print " SCRIPT the .cli.php script name inside the cli/scripts directory\r\n";
print " that you wish to run\r\n";
print "\r\n";
print "the following SCRIPTs are included with the Qcodo distribution:\r\n";
print " codegen Code generates your ORM-layer\r\n";
print " qcodo-updater Updates your installed Qcodo framework to a new version\r\n";
print " qpm-download Download and installs an external QPM package\r\n";
print " qpm-upload Packages custom code you wrote into a QPM package\r\n";
print " phpunit Run bundled PHPUnit\r\n";
print "\r\n";
print "Other custom scripts can be created as well.\r\n";
print "See \"" . realpath(__DEVTOOLS_CLI__) . "/scripts/_README.txt\" for more info";
print "\r\n";
exit(1);
}
// Find Script
if (strpos($_SERVER['argv'][1], '.cli.php') === false) {
$strScriptFilename = $_SERVER['argv'][1] . '.cli.php';
} else {
$strScriptFilename = $_SERVER['argv'][1];
}
if (file_exists($strPath = __DEVTOOLS_CLI__ . '/scripts/' . $strScriptFilename)) {
QApplication::$ScriptFilename = $strPath;
QApplication::$ScriptName = $strScriptFilename;
} else {
if (file_exists($strPath = __DEVTOOLS_CLI__ . '/scripts/_core/' . $strScriptFilename)) {
QApplication::$ScriptFilename = $strPath;
QApplication::$ScriptName = $strScriptFilename;
} else {
print "error: the script '" . $_SERVER['argv'][1] . "' does not exist.\r\n";
exit(1);
}
}
}
示例4: InitializeScriptInfo
/**
* Called by QApplication::Initialize() to initialize the various
* QApplication settings on ScriptName, DocumentRoot, etc.
* @return void
*/
protected static function InitializeScriptInfo()
{
// Setup ScriptFilename and ScriptName
QApplication::$ScriptFilename = $_SERVER['SCRIPT_FILENAME'];
QApplication::$ScriptName = $_SERVER['SCRIPT_NAME'];
// Ensure both are set, or we'll have to abort
if (!QApplication::$ScriptFilename) {
throw new Exception('Error on QApplication::Initialize() - ScriptFilename or ScriptName was not set');
}
// Setup PathInfo and QueryString (if applicable)
QApplication::$PathInfo = array_key_exists('PATH_INFO', $_SERVER) ? trim($_SERVER['PATH_INFO']) : null;
QApplication::$QueryString = array_key_exists('QUERY_STRING', $_SERVER) ? $_SERVER['QUERY_STRING'] : null;
// Setup DocumentRoot
QApplication::$DocumentRoot = trim(__DOCROOT__);
}
示例5: Initialize
/**
* This should be the first call to initialize all the static variables
* The application object also has static methods that are miscellaneous web
* development utilities, etc.
*
* @throws Exception
* @return void
*/
public static function Initialize()
{
self::$EncodingType = defined('__QAPPLICATION_ENCODING_TYPE__') ? __QAPPLICATION_ENCODING_TYPE__ : self::$EncodingType;
// Are we running as CLI?
if (PHP_SAPI == 'cli') {
QApplication::$CliMode = true;
} else {
QApplication::$CliMode = false;
}
// Setup Server Address
if (array_key_exists('LOCAL_ADDR', $_SERVER)) {
QApplication::$ServerAddress = $_SERVER['LOCAL_ADDR'];
} else {
if (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER)) {
QApplication::$ServerAddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
if (array_key_exists('SERVER_ADDR', $_SERVER)) {
QApplication::$ServerAddress = $_SERVER['SERVER_ADDR'];
}
}
}
// Setup ScriptFilename and ScriptName
QApplication::$ScriptFilename = $_SERVER['SCRIPT_FILENAME'];
QApplication::$ScriptName = $_SERVER['SCRIPT_NAME'];
// Ensure both are set, or we'll have to abort
if (!QApplication::$ScriptFilename || !QApplication::$ScriptName) {
throw new Exception('Error on QApplication::Initialize() - ScriptFilename or ScriptName was not set');
}
// Setup PathInfo and QueryString (if applicable)
QApplication::$PathInfo = null;
if (array_key_exists('PATH_INFO', $_SERVER)) {
QApplication::$PathInfo = urlencode(trim($_SERVER['PATH_INFO']));
QApplication::$PathInfo = str_ireplace('%2f', '/', QApplication::$PathInfo);
}
QApplication::$QueryString = array_key_exists('QUERY_STRING', $_SERVER) ? $_SERVER['QUERY_STRING'] : null;
// Setup RequestUri
if (defined('__URL_REWRITE__')) {
switch (strtolower(__URL_REWRITE__)) {
case 'apache':
QApplication::$RequestUri = $_SERVER['REQUEST_URI'];
break;
case 'none':
QApplication::$RequestUri = sprintf('%s%s%s', QApplication::$ScriptName, QApplication::$PathInfo, QApplication::$QueryString ? sprintf('?%s', QApplication::$QueryString) : null);
break;
default:
throw new Exception('Invalid URL Rewrite type: ' . __URL_REWRITE__);
}
} else {
QApplication::$RequestUri = sprintf('%s%s%s', QApplication::$ScriptName, QApplication::$PathInfo, QApplication::$QueryString ? sprintf('?%s', QApplication::$QueryString) : null);
}
// Setup DocumentRoot
QApplication::$DocumentRoot = trim(__DOCROOT__);
// Setup Browser Type
if (array_key_exists('HTTP_USER_AGENT', $_SERVER)) {
$strUserAgent = trim(strtolower($_SERVER['HTTP_USER_AGENT']));
QApplication::$BrowserType = 0;
// INTERNET EXPLORER (versions 6 through 10)
if (strpos($strUserAgent, 'msie') !== false) {
QApplication::$BrowserType = QApplication::$BrowserType | QBrowserType::InternetExplorer;
// just major version number. Will not see IE 10.6.
$matches = array();
preg_match('#msie\\s(.\\d)#', $strUserAgent, $matches);
if ($matches) {
QApplication::$BrowserVersion = (int) $matches[1];
}
} else {
if (strpos($strUserAgent, 'trident') !== false) {
// IE 11 significantly changes the user agent, and no longer includes 'MSIE'
QApplication::$BrowserType = QApplication::$BrowserType | QBrowserType::InternetExplorer;
$matches = array();
preg_match('/rv:(.+)\\)/', $strUserAgent, $matches);
if ($matches) {
QApplication::$BrowserVersion = (double) $matches[1];
}
// FIREFOX
} else {
if (strpos($strUserAgent, 'firefox') !== false || strpos($strUserAgent, 'iceweasel') !== false) {
QApplication::$BrowserType = QApplication::$BrowserType | QBrowserType::Firefox;
$strUserAgent = str_replace('iceweasel/', 'firefox/', $strUserAgent);
$matches = array();
preg_match('#firefox/(.+)#', $strUserAgent, $matches);
if ($matches) {
QApplication::$BrowserVersion = (double) $matches[1];
}
} elseif (strpos($strUserAgent, 'chrome') !== false) {
QApplication::$BrowserType = QApplication::$BrowserType | QBrowserType::Chrome;
// find major version number only
$matches = array();
preg_match('#chrome/(\\d+)#', $strUserAgent, $matches);
if ($matches) {
QApplication::$BrowserVersion = (int) $matches[1];
}
//.........这里部分代码省略.........
示例6: Initialize
/**
* This should be the first call to initialize all the static variables
* The application object also has static methods that are miscellaneous web
* development utilities, etc.
*
* @return void
*/
public static function Initialize()
{
// Are we running as CLI?
if (array_key_exists('SERVER_PROTOCOL', $_SERVER)) {
QApplication::$CliMode = false;
} else {
QApplication::$CliMode = true;
}
// Setup Server Address
if (array_key_exists('LOCAL_ADDR', $_SERVER)) {
QApplication::$ServerAddress = $_SERVER['LOCAL_ADDR'];
} else {
if (array_key_exists('SERVER_ADDR', $_SERVER)) {
QApplication::$ServerAddress = $_SERVER['SERVER_ADDR'];
}
}
// Setup ScriptFilename and ScriptName
QApplication::$ScriptFilename = $_SERVER['SCRIPT_FILENAME'];
QApplication::$ScriptName = $_SERVER['SCRIPT_NAME'];
// Ensure both are set, or we'll have to abort
if (!QApplication::$ScriptFilename || !QApplication::$ScriptName) {
throw new Exception('Error on QApplication::Initialize() - ScriptFilename or ScriptName was not set');
}
// Setup PathInfo and QueryString (if applicable)
QApplication::$PathInfo = array_key_exists('PATH_INFO', $_SERVER) ? trim($_SERVER['PATH_INFO']) : null;
QApplication::$QueryString = array_key_exists('QUERY_STRING', $_SERVER) ? $_SERVER['QUERY_STRING'] : null;
// Setup RequestUri
QApplication::$RequestUri = sprintf('%s%s%s', QApplication::$ScriptName, QApplication::$PathInfo, QApplication::$QueryString ? sprintf('?%s', QApplication::$QueryString) : null);
// Setup DocumentRoot
QApplication::$DocumentRoot = trim(__DOCROOT__);
// Setup Browser Type
if (array_key_exists('HTTP_USER_AGENT', $_SERVER)) {
$strUserAgent = trim(strtolower($_SERVER['HTTP_USER_AGENT']));
if (strpos($strUserAgent, 'msie') !== false) {
QApplication::$BrowserType = QBrowserType::InternetExplorer;
} else {
if (strpos($strUserAgent, 'firefox') !== false) {
QApplication::$BrowserType = QBrowserType::Firefox;
} else {
if (strpos($strUserAgent, 'safari') !== false) {
QApplication::$BrowserType = QBrowserType::Safari;
} else {
QApplication::$BrowserType = QBrowserType::Other;
}
}
}
if (strpos($strUserAgent, 'macintosh') !== false) {
QApplication::$BrowserType = QApplication::$BrowserType | QBrowserType::Macintosh;
}
}
// Preload Class Files
foreach (QApplication::$PreloadedClassFile as $strClassFile) {
require $strClassFile;
}
}
示例7: InitializeForCli
protected static function InitializeForCli()
{
// First, turn off output buffering
ob_end_clean();
// Next, did we ask for a script to be run?
if (!array_key_exists(1, $_SERVER['argv']) || substr($_SERVER['argv'][1], 0, 1) == '-') {
print "Qcodo CLI Runner v" . QCODO_VERSION . "\r\n";
print "usage: qcodo SCRIPT [ARGS]\r\n";
print "\r\n";
print "The following scripts are included with the Qcodo Distribution:\r\n";
print " codegen Code generates your ORM-layer\r\n";
print " plugin-install Installs an external Qcodo plugin\r\n";
print " plugin-package Packages custom code you wrote into a Qcodo plugin\r\n";
print " qcodo-updater Updates your installed Qcodo framework to a new version\r\n";
print "\r\n";
print "Other custom scripts can be created as well.\r\n";
print "See the _README.txt file in " . __DEVTOOLS_CLI__ . " for more information.";
print "\r\n";
exit(1);
}
// Find Script
if (strpos($_SERVER['argv'][1], '.cli.php') === false) {
$strScriptFilename = __DEVTOOLS_CLI__ . '/' . $_SERVER['argv'][1] . '.cli.php';
} else {
$strScriptFilename = __DEVTOOLS_CLI__ . '/' . $_SERVER['argv'][1];
}
if (file_exists($strScriptFilename)) {
QApplication::$ScriptFilename = $strScriptFilename;
QApplication::$ScriptName = $_SERVER['argv'][1];
} else {
print "error: the script '" . $_SERVER['argv'][1] . "' does not exist.\r\n";
exit(1);
}
}
示例8: Initialize
/**
* This should be the first call to initialize all the static variables
* The application object also has static methods that are miscellaneous web
* development utilities, etc.
*
* @return void
*/
public static function Initialize() {
// Are we running as CLI?
if (PHP_SAPI == 'cli')
QApplication::$CliMode = true;
else
QApplication::$CliMode = false;
// Setup Server Address
if (array_key_exists('LOCAL_ADDR', $_SERVER))
QApplication::$ServerAddress = $_SERVER['LOCAL_ADDR'];
else if (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER))
QApplication::$ServerAddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
else if (array_key_exists('SERVER_ADDR', $_SERVER))
QApplication::$ServerAddress = $_SERVER['SERVER_ADDR'];
// Setup ScriptFilename and ScriptName
QApplication::$ScriptFilename = $_SERVER['SCRIPT_FILENAME'];
QApplication::$ScriptName = $_SERVER['SCRIPT_NAME'];
// Ensure both are set, or we'll have to abort
if ((!QApplication::$ScriptFilename) || (!QApplication::$ScriptName)) {
throw new Exception('Error on QApplication::Initialize() - ScriptFilename or ScriptName was not set');
}
// Setup PathInfo and QueryString (if applicable)
QApplication::$PathInfo = array_key_exists('PATH_INFO', $_SERVER) ? trim($_SERVER['PATH_INFO']) : null;
QApplication::$QueryString = array_key_exists('QUERY_STRING', $_SERVER) ? $_SERVER['QUERY_STRING'] : null;
// Setup RequestUri
if (defined('__URL_REWRITE__')) {
switch (strtolower(__URL_REWRITE__)) {
case 'apache':
QApplication::$RequestUri = $_SERVER['REQUEST_URI'];
break;
case 'none':
QApplication::$RequestUri = sprintf('%s%s%s',
QApplication::$ScriptName, QApplication::$PathInfo,
(QApplication::$QueryString) ? sprintf('?%s', QApplication::$QueryString) : null);
break;
default:
throw new Exception('Invalid URL Rewrite type: ' . __URL_REWRITE__);
}
} else {
QApplication::$RequestUri = sprintf('%s%s%s',
QApplication::$ScriptName, QApplication::$PathInfo,
(QApplication::$QueryString) ? sprintf('?%s', QApplication::$QueryString) : null);
}
// Setup DocumentRoot
QApplication::$DocumentRoot = trim(__DOCROOT__);
// Setup Browser Type
if (array_key_exists('HTTP_USER_AGENT', $_SERVER)) {
$strUserAgent = trim(strtolower($_SERVER['HTTP_USER_AGENT']));
// INTERNET EXPLORER (supporting versions 6.0 and 7.0)
if (strpos($strUserAgent, 'msie') !== false) {
QApplication::$BrowserType = QBrowserType::InternetExplorer;
if (strpos($strUserAgent, 'msie 6.0') !== false)
QApplication::$BrowserType = QApplication::$BrowserType | QBrowserType::InternetExplorer_6_0;
else if (strpos($strUserAgent, 'msie 7.0') !== false)
QApplication::$BrowserType = QApplication::$BrowserType | QBrowserType::InternetExplorer_7_0;
else
QApplication::$BrowserType = QApplication::$BrowserType | QBrowserType::Unsupported;
// FIREFOX (supporting versions 1.0, 1.5 and 2.0)
} else if ((strpos($strUserAgent, 'firefox') !== false) || (strpos($strUserAgent, 'iceweasel') !== false)) {
QApplication::$BrowserType = QBrowserType::Firefox;
$strUserAgent = str_replace('iceweasel/', 'firefox/', $strUserAgent);
if (strpos($strUserAgent, 'firefox/1.0') !== false)
QApplication::$BrowserType = QApplication::$BrowserType | QBrowserType::Firefox_1_0;
else if (strpos($strUserAgent, 'firefox/1.5') !== false)
QApplication::$BrowserType = QApplication::$BrowserType | QBrowserType::Firefox_1_5;
else if (strpos($strUserAgent, 'firefox/2.0') !== false)
QApplication::$BrowserType = QApplication::$BrowserType | QBrowserType::Firefox_2_0;
else
QApplication::$BrowserType = QApplication::$BrowserType | QBrowserType::Unsupported;
// SAFARI (supporting version 2.0 and eventually 3.0)
} else if (strpos($strUserAgent, 'safari') !== false) {
QApplication::$BrowserType = QBrowserType::Safari;
if (strpos($strUserAgent, 'safari/41') !== false)
QApplication::$BrowserType = QApplication::$BrowserType | QBrowserType::Safari_2_0;
else if (strpos($strUserAgent, 'safari/52') !== false)
QApplication::$BrowserType = QApplication::$BrowserType | QBrowserType::Safari_3_0;
else
QApplication::$BrowserType = QApplication::$BrowserType | QBrowserType::Unsupported;
//.........这里部分代码省略.........