getPlatform() public method

Returns the currently matched platform.
public getPlatform ( ) : string
return string The user's platform.
Esempio n. 1
0
File: Base.php Progetto: horde/horde
 /**
  * Tries to determine the expected newline character based on the
  * platform information passed by the browser's agent header.
  *
  * @return string  The guessed expected newline characters, either \n, \r
  *                 or \r\n.
  */
 public function getNewline()
 {
     if (!isset($this->_browser)) {
         throw new LogicException('Missing browser parameter.');
     }
     switch ($this->_browser->getPlatform()) {
         case 'win':
             return "\r\n";
         case 'mac':
             return "\r";
         case 'unix':
         default:
             return "\n";
     }
 }