Apache – get the user which the webserver is running with
To get the user which the apache runs on: $> ps aux | egrep ‘(apache|httpd)’
To get the user which the apache runs on: $> ps aux | egrep ‘(apache|httpd)’
This little snippet tries to get the IP-Address of the user: private function _detectIP(){ //Mage::log(‘_detectIP’, null, __CLASS__.’.log’, true); if (getenv(‘HTTP_CLIENT_IP’)) { $this->_ip = getenv(‘HTTP_CLIENT_IP’); Mage::log(‘Detected IP (getenv(\’HTTP_CLIENT_IP\’)):’, null, __CLASS__.’.log’, true); Mage::log($this->_ip, null, __CLASS__.’.log’, true); } elseif (getenv(‘HTTP_X_FORWARDED_FOR’)) { $ips = explode(‘,’, getenv(‘HTTP_X_FORWARDED_FOR’)); $this->_ip = (string)trim($ips[0]); } elseif (getenv(‘HTTP_X_FORWARDED’)) { $ips = explode(‘,’, getenv(‘HTTP_X_FORWARDED’)); $this->_ip = […]
Hence nl2br does NOT really replace newlines with <br /> tags (it only inserts a <br /> tag before each \n → newlines themselves are preserved), you can use this function to get it right (realNl2Br): /** * @param $string – string with * @param bool $xhtml – deliver xhtml confom br’s or not (<br […]