/**
  * normalize helper function
  * Sets user_ip and server_ip.
  */
 protected function setIPAddresses()
 {
     if (!$this->gateway->isBatchProcessor()) {
         // Refresh the IP from something authoritative, unless we're running
         // a batch process.
         $userIp = WmfFramework::getIP();
         if ($userIp) {
             $this->setVal('user_ip', $userIp);
         }
     }
     if (array_key_exists('SERVER_ADDR', $_SERVER)) {
         $this->setVal('server_ip', $_SERVER['SERVER_ADDR']);
     } else {
         //command line?
         $this->setVal('server_ip', '127.0.0.1');
     }
 }