/** * @access private * @param string $errorDesc */ function _setError($errorDesc, $line = null) { $this->_error = $this->_error ? $this->_error : $errorDesc; $file = __FILE__; $line = $line !== null ? ' (~' . $line . ')' : ''; $this->_log->WriteLine('WMSERVER Error: ' . $file . $line . CRLFCHARS . $errorDesc); }
function setGlobalErrorAndWriteLog() { if (strlen($this->error) > 0) { setGlobalError($this->error); $this->_log->WriteLine('POP3 Error: ' . $this->error); } }
/** * @access private * @param string $errorDesc */ function _setError($errorDesc, $line = null) { $this->_error = $this->_error ? $this->_error : $errorDesc; if ($this->_log->Enabled) { $file = __FILE__; $line = $line !== null ? ' (~' . $line . ')' : ''; $this->_log->WriteLine('WMSERVER Error: ' . $file . $line . CRLFCHARS . $errorDesc, LOG_LEVEL_ERROR); } }
/** * @access private * @param resource $link * @param CLog $log * @return bool */ function IsSuccess(&$link, &$log, &$out, $isLog = true) { $out = ''; $line = ''; $result = true; do { $line = @fgets($link, 1024); if ($isLog) { $log->WriteLine('[SMTP] <<: ' . trim($line)); } if ($line === false) { $result = false; setGlobalError('[SMTP] Error: IsSuccess fgets error'); break; } else { $out .= $line; $line = str_replace("\r", '', str_replace("\n", '', str_replace(CRLF, '', $line))); if (substr($line, 0, 1) != '2' && substr($line, 0, 1) != '3') { $result = false; $error = '[SMTP] Error <<: ' . $line; setGlobalError($error); //setGlobalError(substr($line, 3)); break; } } } while (substr($line, 3, 1) == '-'); if (!$result && $log->Enabled) { $log->WriteLine(getGlobalError(), LOG_LEVEL_ERROR); } return $result; }
/** * this functiuon is to send the command to server * * @param string $msg * @return bool */ function put_line($msg = '') { $this->_log->WriteLine('IMAP4 >>: ' . $msg); return @fputs($this->connection, $msg . "\r\n"); }
/** * @access private * @param string $logMsg * @return void */ function _error($logMsg) { if (!is_null($this->_logger)) { $this->_logger->WriteLine($logMsg, LOG_LEVEL_ERROR); } }
/** * @param string $string */ function _log($string, $logLevel = LOG_LEVEL_DEBUG) { if ($this->_log->Enabled) { $this->_log->WriteLine('XMail: ' . $string, $logLevel); } }
/** * @access private * @param resource $link * @param CLog $log * @return bool */ function IsSuccess(&$link, &$log) { $result = true; do { $line = @fgets($link, 1024); if ($line === false) { $result = false; setGlobalError('SMTP IsSuccess fgets error'); break; } else { $line = str_replace("\r", '', str_replace("\n", '', str_replace(CRLF, '', $line))); if (substr($line, 0, 1) != '2' && substr($line, 0, 1) != '3') { $result = false; $error = '[SMTP] Error <<: ' . $line; setGlobalError($error); break; } } } while (substr($line, 3, 1) == '-'); if (!$result) { $log->WriteLine(getGlobalError()); } return $result; }
/** * @access private * @param unknown_type $string */ function _log($string) { $this->_log->WriteLine('Xmail: ' . $string); }