30 lines
799 B
PHP
30 lines
799 B
PHP
<?php
|
|
// File name: server.inc.php
|
|
// Description: PHP subroutine to identify the server
|
|
// Date: 2004-03-05
|
|
// Author: imacat <imacat@pristine.com.tw>
|
|
// Copyright: Copyright (C) 2004-2007 Pristine Communications
|
|
|
|
// Set the include path
|
|
if (!defined("INCPATH_SET")) {
|
|
require_once dirname(__FILE__) . "/incpath.inc.php";
|
|
}
|
|
// Referenced subroutines
|
|
require_once "monica/cgiemu.inc.php";
|
|
|
|
// is_apache: If this server is Apache
|
|
function is_apache()
|
|
{
|
|
return array_key_exists("SERVER_SOFTWARE", $_SERVER)
|
|
&& preg_match("/^Apache\b/", $_SERVER["SERVER_SOFTWARE"]);
|
|
}
|
|
|
|
// is_iis: If this server is Microsoft IIS
|
|
function is_iis()
|
|
{
|
|
return array_key_exists("SERVER_SOFTWARE", $_SERVER)
|
|
&& preg_match("/^Microsoft-(IIS|PWS)\b/", $_SERVER["SERVER_SOFTWARE"]);
|
|
}
|
|
|
|
?>
|