Class we_util_Sys_Server

Description

utility class for various web servers

Located in /util/Sys/Server.php (line 35)

we_util_Sys
   |
   --we_util_Sys_Server
Direct descendents
Class Description
we_util_Sys_Server_Apache utility class for apache web server
Method Summary
static string getDocroot ()
static string getHost ()
static string getHostUri ([string $url = ''])
static integer getPort ()
static string getProtocol ()
static bool isApache ([string $version = ""])
static bool isIIS ()
static string product ()
Methods
static method getDocroot (line 167)

identify docroot, either via $_SERVER["DOCUMENT_ROOT"] or path reproduction

  • return: complete path of the servers docroot without a trailing slash
  • author: Alexander Lindenstruth
  • access: public
static string getDocroot ()
static method getHost (line 112)

Retrieve Hostname for current request

  • access: public
static string getHost ()
static method getHostUri (line 145)

Retrieve complete URI for host and appends an url if set

  • access: public
static string getHostUri ([string $url = ''])
  • string $url: url to append. If empty a uri only with hostname is returned
static method getPort (line 134)

Retrieve Port for current request

  • access: public
static integer getPort ()
static method getProtocol (line 124)

Retrieve Protocol for current request

  • access: public
static string getProtocol ()
static method isApache (line 72)

checks if this is an apache web server

  • return: true/false
  • access: public
static bool isApache ([string $version = ""])
  • string $version: optional parameter to check for a specific apache version. this method checks the part of the version string that comes after "Apache/" i.e. "Apache/1.3" in "Apache/1.3.29 (Unix) PHP/4.3.4" This depends on settings in httpd.conf ServerTokens, possible return values are: ServerTokens Full - Apache/1.3.29 (Unix) PHP/4.3.4 ServerTokens Full - Apache/2.0.55 (Win32) DAV/2 ServerTokens OS - Apache/2.0.55 (Win32) ServerTokens Minor - Apache/2.0 ServerTokens Minimal - Apache/2.0.55 ServerTokens Major - Apache/2 ServerTokens Prod - Apache
static method isIIS (line 97)

checks if this is a Microsoft IIS

  • return: true/false
  • access: public
static bool isIIS ()
static method product (line 44)

tries to identify the web server and return its product name.

The product name return to the caller is the name used for these classes.

  • return: product name or false, if the server product is unknown.
  • access: public
static string product ()

Inherited Methods

Inherited From we_util_Sys

we_util_Sys::_versionCompare()

Documentation generated on Mon, 01 Sep 2008 11:35:43 +0200 by phpDocumentor 1.4.0