[ Index ]
 

Code source de LifeType 1.2.4

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/class/misc/ -> osdetect.class.php (source)

   1  <?php
   2  
   3      
   4  
   5      /**
   6       * \ingroup Misc
   7       *
   8       * Operating system detection functions. This class provides a bunch of functions in order to detect
   9       * on which operating system our php parser is running. Please bear in mind that this has not been
  10       * thoroughly tested and that at the moment it only provides detection for windows and linux.
  11       */
  12      class OsDetect  
  13      {
  14  
  15          /**
  16           * Returns the OS string returned by php_uname
  17           *
  18           * @return The OS string.
  19           * @static
  20           */
  21          function getOsString()
  22          {
  23              return PHP_OS;
  24          }
  25  
  26          /**
  27           * Returns true if we are running windows.
  28           *
  29           * @return True if we are running windows, false otherwise.
  30           * @static
  31           */
  32          function isWindows()
  33          {
  34              $os = OsDetect::getOsString();
  35  
  36              if(eregi("win", $os))
  37                  return true;
  38              else
  39                  return false;
  40          }
  41  
  42          /**
  43           * Returns true if we are running windows.
  44           *
  45           * @return True if we are running windows, false otherwise.
  46           * @static
  47           */
  48          function isLinux()
  49          {
  50              $os = OsDetect::getOsString();
  51  
  52              if(eregi("linux", $os))
  53                  return true;
  54              else
  55                  return false;
  56          }
  57      }
  58  ?>


Généré le : Mon Nov 26 21:04:15 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics