Doc #19604 [Opn->WFx]: Documentation lists function which doesn't exist?

From: Date: Sat, 03 Nov 2012 19:45:15 +0000
Subject: Doc #19604 [Opn->WFx]: Documentation lists function which doesn't exist?
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-9284@lists.php.net to get a copy of this message
Edit report at https://pear.php.net/bugs/bug.php?id=19604&edit=1 ID: 19604 Updated by: till@php.net Reported By: paul dot freeman-powell at crosbysystems dot com Summary: Documentation lists function which doesn't exist? -Status: Open +Status: Wont fix Type: Documentation Problem Package: Mail_Queue Operating System: Ubuntu Server 10.04 LTS Package Version: 1.2.7 PHP Version: 5.3.6 Roadmap Versions: New Comment: -Status: Open +Status: Wont fix That's called 'pseudo code'. Previous Comments: ------------------------------------------------------------------------ [2012-09-18 15:15:16] paulfp Description: ------------ The documentation which discusses callback support for the sendMailsInQueue method provides a sample mailqueue_callback function, in which the get_mail_queue_row() function is called. However, I get a fatal error stating that this function doesn't exists, and indeed I can't find it listed in the PHP or PEAR documentation. I'm running version 1.2.0 of PEAR Mail, 1.6.1 of Net_SMTP and 1.5.5 of mail_mimeDecode. Is this an error? What do you suggest? Test script: --------------- function mailqueue_callback($args) { $row = get_mail_queue_row($args['id']); $headers = unserialize($row['headers']); $subject = $headers['Subject']; $body = unserialize($row['body']); $mail_headers = ''; foreach($headers as $key=>$value) { $mail_headers .= "$key:$value\n"; } $mail = $mail_headers . "\n" . $body; $decoder = new Mail_mimeDecode($mail); $decoded = $decoder->decode(array( 'include_bodies' => TRUE, 'decode_bodies' => TRUE, 'decode_headers' => TRUE, )); $body = $decoded->body; $esmtp_id = $args['queued_as']; if (isset($args['greeting'])) { $greeting = $args['greeting']; $greets = explode(' ', $greeting); $server = $greets[0]; } else { $server = 'localhost'; } insert_to_log(compact('server', 'esmtp_id', 'subject', 'body')); } Expected result: ---------------- The callback function should allow me to use my own customised function to insert the data into database for logging purposes. Actual result: -------------- PHP Fatal error: Call to undefined function get_mail_queue_row() ------------------------------------------------------------------------ -- Edit this bug report at https://pear.php.net/bugs/bug.php?id=19604&edit=1

« previous php.pear.bugs (#9284) next »