From: <lei...@us...> - 2008-12-09 14:36:46
|
Author: leithoff Date: Tue Dec 9 15:02:17 2008 New Revision: 26484 URL: http://www.egroupware.org/viewvc?rev=3D26484&view=3Drev Log: directing debug to error_log Modified: trunk/phpgwapi/inc/class.smtp.php Modified: trunk/phpgwapi/inc/class.smtp.php URL: http://www.egroupware.org/viewvc/trunk/phpgwapi/inc/class.smtp.php?rev= =3D26484&r1=3D26483&r2=3D26484&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- trunk/phpgwapi/inc/class.smtp.php (original) +++ trunk/phpgwapi/inc/class.smtp.php Tue Dec 9 15:02:17 2008 @@ -126,8 +126,8 @@ "errno" =3D> $errno, "errstr" =3D> $errstr); if($this->do_debug >=3D 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": $errstr ($errno)" . $this->CRLF; + error_log(__METHOD__."->"."SMTP -> ERROR: " . $this->error["error"= ] . + ": $errstr ($errno)" . $this->CRLF); } return false; } @@ -147,7 +147,7 @@ // socket_set_timeout($this->smtp_conn, 0, 100000); = if($this->do_debug >=3D 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $announce; + error_log(__METHOD__."->". "SMTP -> FROM SERVER:" . $this->CRLF . $a= nnounce); } = return true; @@ -176,7 +176,7 @@ $code =3D substr($rply,0,3); = if($this->do_debug >=3D 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + error_log(__METHOD__."->"."SMTP -> FROM SERVER:" . $this->CRLF . $rp= ly); } = if($code !=3D 220) { @@ -185,7 +185,7 @@ "smtp_code" =3D> $code, "smtp_msg" =3D> substr($rply,4)); if($this->do_debug >=3D 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $t= his->CRLF; + error_log(__METHOD__."->"."SMTP -> ERROR: " . $this->error["error"= ] . ": " . $rply . $this->CRLF); } return false; } @@ -220,8 +220,8 @@ "smtp_code" =3D> $code, "smtp_msg" =3D> substr($rply,4)); if($this->do_debug >=3D 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->". "SMTP -> ERROR: " . $this->error["error= "] . + ": " . $rply . $this->CRLF); } return false; } @@ -238,8 +238,8 @@ "smtp_code" =3D> $code, "smtp_msg" =3D> substr($rply,4)); if($this->do_debug >=3D 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->". "SMTP -> ERROR: " . $this->error["error= "] . + ": " . $rply . $this->CRLF); } return false; } @@ -256,8 +256,8 @@ "smtp_code" =3D> $code, "smtp_msg" =3D> substr($rply,4)); if($this->do_debug >=3D 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->"."SMTP -> ERROR: " . $this->error["error"= ] . + ": " . $rply . $this->CRLF); } return false; } @@ -277,8 +277,8 @@ // hmm this is an odd situation... the socket is // valid but we are not connected anymore if($this->do_debug >=3D 1) { - echo "SMTP -> NOTICE:" . $this->CRLF . - "EOF caught while checking if connected"; + error_log(__METHOD__."->". "SMTP -> NOTICE:" . $this->CRLF . + "EOF caught while checking if connected"); } $this->Close(); return false; @@ -343,7 +343,7 @@ $code =3D substr($rply,0,3); = if($this->do_debug >=3D 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + error_log(__METHOD__."->". "SMTP -> FROM SERVER:" . $this->CRLF . $r= ply); } = if($code !=3D 354) { @@ -352,8 +352,8 @@ "smtp_code" =3D> $code, "smtp_msg" =3D> substr($rply,4)); if($this->do_debug >=3D 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->"."SMTP -> ERROR: " . $this->error["error"= ] . + ": " . $rply . $this->CRLF); } return false; } @@ -452,15 +452,15 @@ "smtp_msg" =3D> "(nothing)"); = if($this->do_debug >=3D 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->". "SMTP -> ERROR: " . $this->error["err= or"] . + ": " . $rply . $this->CRLF); } return false; } $code =3D substr($rply,0,3); = if($this->do_debug >=3D 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + error_log(__METHOD__."->". "SMTP -> FROM SERVER:" . $this->CRLF . $r= ply); } = if($code !=3D 250) { @@ -469,8 +469,8 @@ "smtp_code" =3D> $code, "smtp_msg" =3D> substr($rply,4)); if($this->do_debug >=3D 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->"."SMTP -> ERROR: " . $this->error["error"= ] . + ": " . $rply . $this->CRLF); } return false; } @@ -508,7 +508,7 @@ $code =3D substr($rply,0,3); = if($this->do_debug >=3D 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + error_log(__METHOD__."->"."SMTP -> FROM SERVER:" . $this->CRLF . $rp= ly); } = if($code !=3D 250) { @@ -517,8 +517,8 @@ "smtp_code" =3D> $code, "smtp_msg" =3D> substr($rply,4)); if($this->do_debug >=3D 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->". "SMTP -> ERROR: " . $this->error["error= "] . + ": " . $rply . $this->CRLF); } return false; } @@ -583,7 +583,7 @@ $code =3D substr($rply,0,3); = if($this->do_debug >=3D 2) { - echo "SMTP -> FROM SERVER: " . $this->CRLF . $rply; + error_log(__METHOD__."->"."SMTP -> FROM SERVER: " . $this->CRLF . $r= ply); } = if($code !=3D 250) { @@ -592,8 +592,8 @@ "smtp_code" =3D> $code, "smtp_msg" =3D> substr($rply,4)); if($this->do_debug >=3D 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->". "SMTP -> ERROR: " . $this->error["error= "] . + ": " . $rply . $this->CRLF); } return false; } @@ -638,7 +638,7 @@ $code =3D substr($rply,0,3); = if($this->do_debug >=3D 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + error_log(__METHOD__."->". "SMTP -> FROM SERVER:" . $this->CRLF . $r= ply); } = if($code !=3D 211 && $code !=3D 214) { @@ -647,8 +647,8 @@ "smtp_code" =3D> $code, "smtp_msg" =3D> substr($rply,4)); if($this->do_debug >=3D 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->"."SMTP -> ERROR: " . $this->error["error"= ] . + ": " . $rply . $this->CRLF); } return false; } @@ -686,7 +686,7 @@ $code =3D substr($rply,0,3); = if($this->do_debug >=3D 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + error_log(__METHOD__."->". "SMTP -> FROM SERVER:" . $this->CRLF . $r= ply); } = if($code !=3D 250) { @@ -695,8 +695,8 @@ "smtp_code" =3D> $code, "smtp_msg" =3D> substr($rply,4)); if($this->do_debug >=3D 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->"."SMTP -> ERROR: " . $this->error["error"= ] . + ": " . $rply . $this->CRLF); } return false; } @@ -728,7 +728,7 @@ $code =3D substr($rply,0,3); = if($this->do_debug >=3D 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + error_log(__METHOD__."->"."SMTP -> FROM SERVER:" . $this->CRLF . $rp= ly); } = if($code !=3D 250) { @@ -737,8 +737,8 @@ "smtp_code" =3D> $code, "smtp_msg" =3D> substr($rply,4)); if($this->do_debug >=3D 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->". "SMTP -> ERROR: " . $this->error["error= "] . + ": " . $rply . $this->CRLF); } return false; } @@ -772,7 +772,7 @@ $byemsg =3D $this->get_lines(); = if($this->do_debug >=3D 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $byemsg; + error_log(__METHOD__."->"."SMTP -> FROM SERVER:" . $this->CRLF . $by= emsg); } = $rval =3D true; @@ -786,8 +786,8 @@ "smtp_rply" =3D> substr($byemsg,4)); $rval =3D false; if($this->do_debug >=3D 1) { - echo "SMTP -> ERROR: " . $e["error"] . ": " . - $byemsg . $this->CRLF; + error_log(__METHOD__."->"."SMTP -> ERROR: " . $e["error"] . ": " . + $byemsg . $this->CRLF); } } = @@ -825,7 +825,7 @@ $code =3D substr($rply,0,3); = if($this->do_debug >=3D 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + error_log(__METHOD__."->". "SMTP -> FROM SERVER:" . $this->CRLF . $r= ply); } = if($code !=3D 250 && $code !=3D 251) { @@ -834,8 +834,8 @@ "smtp_code" =3D> $code, "smtp_msg" =3D> substr($rply,4)); if($this->do_debug >=3D 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->"."SMTP -> ERROR: " . $this->error["error"= ] . + ": " . $rply . $this->CRLF); } return false; } @@ -869,7 +869,7 @@ $code =3D substr($rply,0,3); = if($this->do_debug >=3D 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + error_log(__METHOD__."->"."SMTP -> FROM SERVER:" . $this->CRLF . $rp= ly); } = if($code !=3D 250) { @@ -878,8 +878,8 @@ "smtp_code" =3D> $code, "smtp_msg" =3D> substr($rply,4)); if($this->do_debug >=3D 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->"."SMTP -> ERROR: " . $this->error["error"= ] . + ": " . $rply . $this->CRLF); } return false; } @@ -918,7 +918,7 @@ $code =3D substr($rply,0,3); = if($this->do_debug >=3D 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + error_log(__METHOD__."->"."SMTP -> FROM SERVER:" . $this->CRLF . $rp= ly); } = if($code !=3D 250) { @@ -927,8 +927,8 @@ "smtp_code" =3D> $code, "smtp_msg" =3D> substr($rply,4)); if($this->do_debug >=3D 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->"."SMTP -> ERROR: " . $this->error["error"= ] . + ": " . $rply . $this->CRLF); } return false; } @@ -966,7 +966,7 @@ $code =3D substr($rply,0,3); = if($this->do_debug >=3D 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + error_log(__METHOD__."->"."SMTP -> FROM SERVER:" . $this->CRLF . $rp= ly); } = if($code !=3D 250) { @@ -975,8 +975,8 @@ "smtp_code" =3D> $code, "smtp_msg" =3D> substr($rply,4)); if($this->do_debug >=3D 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->". "SMTP -> ERROR: " . $this->error["error= "] . + ": " . $rply . $this->CRLF); } return false; } @@ -1014,7 +1014,7 @@ $code =3D substr($rply,0,3); = if($this->do_debug >=3D 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + error_log(__METHOD__."->"."SMTP -> FROM SERVER:" . $this->CRLF . $rp= ly); } = if($code !=3D 250) { @@ -1023,8 +1023,8 @@ "smtp_code" =3D> $code, "smtp_msg" =3D> substr($rply,4)); if($this->do_debug >=3D 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->". "SMTP -> ERROR: " . $this->error["error= "] . + ": " . $rply . $this->CRLF); } return false; } @@ -1048,7 +1048,7 @@ $this->error =3D array("error" =3D> "This method, TURN, of the SMTP ". "is not implemented"); if($this->do_debug >=3D 1) { - echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF; + error_log(__METHOD__."->"."SMTP -> NOTICE: " . $this->error["error"]= . $this->CRLF); } return false; } @@ -1081,7 +1081,7 @@ $code =3D substr($rply,0,3); = if($this->do_debug >=3D 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + error_log(__METHOD__."->"."SMTP -> FROM SERVER:" . $this->CRLF . $rp= ly); } = if($code !=3D 250 && $code !=3D 251) { @@ -1090,8 +1090,8 @@ "smtp_code" =3D> $code, "smtp_msg" =3D> substr($rply,4)); if($this->do_debug >=3D 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->". "SMTP -> ERROR: " . $this->error["error= "] . + ": " . $rply . $this->CRLF); } return false; } @@ -1115,14 +1115,14 @@ $data =3D ""; while($str =3D @fgets($this->smtp_conn,515)) { if($this->do_debug >=3D 4) { - echo "SMTP -> get_lines(): \$data was \"$data\"" . - $this->CRLF; - echo "SMTP -> get_lines(): \$str is \"$str\"" . - $this->CRLF; + error_log(__METHOD__."->"."SMTP -> get_lines(): \$data was \"$data= \"" . + $this->CRLF); + error_log(__METHOD__."->"."SMTP -> get_lines(): \$str is \"$str\""= . + $this->CRLF); } $data .=3D $str; if($this->do_debug >=3D 4) { - echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF; + error_log(__METHOD__."->". "SMTP -> get_lines(): \$data is \"$data= \"" . $this->CRLF); } // if the 4th character is a space then we are done reading // so just break the loop |