Exemple #1
0
 function get_line($isLog = true)
 {
     $return = @fgets($this->connection, 2048);
     if ($this->_bLogEnable && $isLog) {
         $this->_log('IMAP4 < ' . ConvertUtils::ShowCRLF($return));
     }
     if (false === $return) {
         $_socket_status = @socket_get_status($this->connection);
         if (isset($_socket_status['timed_out']) && $_socket_status['timed_out']) {
             $this->error = 'Error : Socket timeout reached during IMAP4 connection.';
         }
     }
     $this->_resetTimeOut();
     return $return;
 }
Exemple #2
0
 function __fputs($sLine)
 {
     $sLine .= "\r\n";
     $this->WriteLog('> ' . ConvertUtils::ShowCRLF($sLine));
     return fputs($this->fp, $sLine);
 }
Exemple #3
0
 /**
  * @access private
  * @param string $string
  * @return bool
  */
 function _putline($string, $isLog = true)
 {
     if ($isLog && $this->_log->Enabled) {
         $this->_log->WriteLine('POP3 >>: ' . ConvertUtils::ShowCRLF($string));
     }
     $line = $string . "\r\n";
     $this->_resetTimeOut();
     if (!@fwrite($this->socket, $line, strlen($line))) {
         $this->error = 'POP3 _putline() - Error while send "' . $string . '". -- Connection closed.';
         $this->setGlobalErrorAndWriteLog();
         $this->_cleanup();
         return false;
     }
     return true;
 }