Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.2.0

Request #21033 PHP warning depreciated
Submitted: 2016-02-27 16:42 UTC
From: canaillou2k5 Assigned: ashnazg
Status: Closed Package: Auth_SASL (version 1.0.6)
PHP Version: 5.6.17 OS: Debian 8 stable
Roadmaps: (Not assigned)    
Subscription  


 [2016-02-27 16:42 UTC] canaillou2k5 (Eliott Trotebas)
Description: ------------ In the file SASL.php (/usr/share/php/Auth/SASL.php) Line 61: replace "function &factory($type)" by "static function &factory($type)" Adding static solve the error. Test script: --------------- <?php require_once "Mail.php"; $from = "xxx"; $to = "xxx"; $subject = "test email"; $message ="mail apache 2.4 ok"; $host = "xxx"; $port = "587"; $username = "webmaster@servergamers.net";$password = "xxx"; $headers = array ('From' => 'Servergamers<'.$from.'>','To' => $to, 'Content-type' => "text/html; charset=UTF-8", 'MIME-Version' => "1.0", 'Subject' => utf8_decode($subject), ); $smtp = Mail::factory('smtp', array ('host' => $host, 'port' => $port,'auth' => true,'username' => $username,'password' => $password)); $mail = $smtp->send($to, $headers, utf8_decode($message)); if (PEAR::isError($mail)) echo $mail->getMessage(); else echo "ok"; ?> Expected result: ---------------- OK Actual result: -------------- Deprecated: Non-static method Auth_SASL::factory() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 756

Comments

 [2017-03-07 14:03 UTC] ashnazg (Chuck Burgess)
-Assigned To: +Assigned To: ashnazg
 [2017-03-07 14:35 UTC] ashnazg (Chuck Burgess)
-Status: Assigned +Status: Closed
Fixed in upcoming v1.1.0.