Log function
implement log() function.
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
namespace Friendica\Protocol;
|
||||
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Content\Text\HTML;
|
||||
use Friendica\Core\Protocol;
|
||||
|
||||
@@ -28,12 +29,12 @@ class Email
|
||||
|
||||
$errors = imap_errors();
|
||||
if (!empty($errors)) {
|
||||
logger('IMAP Errors occured: ' . json_encode($errors));
|
||||
Logger::log('IMAP Errors occured: ' . json_encode($errors));
|
||||
}
|
||||
|
||||
$alerts = imap_alerts();
|
||||
if (!empty($alerts)) {
|
||||
logger('IMAP Alerts occured: ' . json_encode($alerts));
|
||||
Logger::log('IMAP Alerts occured: ' . json_encode($alerts));
|
||||
}
|
||||
|
||||
return $mbox;
|
||||
@@ -54,21 +55,21 @@ class Email
|
||||
if (!$search1) {
|
||||
$search1 = [];
|
||||
} else {
|
||||
logger("Found mails from ".$email_addr, LOGGER_DEBUG);
|
||||
Logger::log("Found mails from ".$email_addr, LOGGER_DEBUG);
|
||||
}
|
||||
|
||||
$search2 = @imap_search($mbox, 'TO "' . $email_addr . '"', SE_UID);
|
||||
if (!$search2) {
|
||||
$search2 = [];
|
||||
} else {
|
||||
logger("Found mails to ".$email_addr, LOGGER_DEBUG);
|
||||
Logger::log("Found mails to ".$email_addr, LOGGER_DEBUG);
|
||||
}
|
||||
|
||||
$search3 = @imap_search($mbox, 'CC "' . $email_addr . '"', SE_UID);
|
||||
if (!$search3) {
|
||||
$search3 = [];
|
||||
} else {
|
||||
logger("Found mails cc ".$email_addr, LOGGER_DEBUG);
|
||||
Logger::log("Found mails cc ".$email_addr, LOGGER_DEBUG);
|
||||
}
|
||||
|
||||
$res = array_unique(array_merge($search1, $search2, $search3));
|
||||
@@ -351,7 +352,7 @@ class Email
|
||||
|
||||
//$message = '<html><body>' . $html . '</body></html>';
|
||||
//$message = html2plain($html);
|
||||
logger('notifier: email delivery to ' . $addr);
|
||||
Logger::log('notifier: email delivery to ' . $addr);
|
||||
mail($addr, $subject, $body, $headers);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user