Sorry, this post is pretty long...
After looking at the docs, it seems we're forgetting how constructor functions work. In your CER_CF_PARSER_TICKET class, you need to define a constructor method CER_CF_PARSER_TICKET - otherwise I guess it's not being extended. Try that.
Yeah, I saw that after trying it the first time and looking at the docs, so I added:
Code: Select all
function CER_CF_PARSER()
{
$this->CER_PARSER();
//test
$filename = "test_instantiate.txt";
$fp = fopen($filename, "a");
$string = "in cer_cf_parser constructor\n";
$write = fputs($fp, $string);
fclose($fp);
o }
.
.
.
function CER_CF_PARSER_TICKET()
{
$this->CER_PARSER_TICKET();
//test
$filename = "test_instantiate.txt";
$fp = fopen($filename, "a");
$string = "in cer_cf_parser_ticket constructor\n";
$write = fputs($fp, $string);
fclose($fp);
}
Still, nothing.
I got curious; if I added the functions back to CER_PARSER and CER_PARSER_TICKET, would get_class_methods see them there? So, I added this:
Code: Select all
function CER_PARSER()
{
$this->db = cer_Database::getInstance();
//test
$filename = "test_instantiate.txt";
$fp = fopen($filename, "a");
$string = "in cer_parser constructor\n";
$write = fputs($fp, $string);
$functions = get_class_methods('CER_PARSER');
foreach ($functions as $val)
{
fwrite($fp, $val);
fwrite($fp, "\n");
}
fwrite($fp, "\n");
fclose($fp);
}
.
.
.
function CER_PARSER_TICKET()
{
$this->db = cer_Database::getInstance();
$this->thread_handler = new cer_ThreadContentHandler();
//test
$filename = "test_instantiate.txt";
$fp = fopen($filename, "a");
$string = "in cer_parser_ticket constructor\n";
$write = fputs($fp, $string);
$functions = get_class_methods('CER_PARSER_TICKET');
foreach ($functions as $val)
{
fwrite($fp, $val);
fwrite($fp, "\n");
}
fwrite($fp, "\n");
fclose($fp);
}
And I got:
Code: Select all
in cer_parser constructor
cer_parser
check_if_merged
get_ticket_id
send_autoresponse
send_closeresponse
send_gatedresponse
proxy_email_to_requesters
send_email_to_watchers
send_email_to_address
process_mail_rules
mark_ticket_customer_replied
mark_ticket_bounced
find_ticketid_in_subject
find_ticketid_from_message_id
find_ticketid_in_body
[b]find_custom_field_in_body[/b]
_validate_ticket_id
is_banned_address
perform_war_check
in cer_parser_ticket constructor
cer_parser_ticket
load_ticket_data
_get_ticket_spam_probability
generate_unique_mask
mask_is_unique
set_requester
set_queue_address_id
find_ticket_id
reset_due_date
create_new_ticket
[b]instantiate_custom_fields[/b]
cache_ticket_requesters
save_requester_link
is_ticket_requester_address
is_ticket_requester_id
is_comment_or_email
save_thread_time_worked
add_ticket_thread
_save_thread_attachments
get_dest_queue_data
_find_address_catchall_queue
_find_to_addy_in_received
is_queue_address
is_admin_address
get_address_id
They're in there! But nothing's being printed by the stubs that are in those functions! So, again I got to thinking: what if I'm doing something wrong with either 1) my function calls, 2) my file writing stubs, or 3) Cerberus itself (is it caching the function defs somewhere?)? I decided to put dummy functions into the CER_PARSER and CER_PARSER_TICKET classes:
Code: Select all
function test_parser()
{
$filename = "test_functions.txt";
$fp = fopen($filename, "a");
$string = "in test_parser\n";
$write = fputs($fp, $string);
fclose($fp);
}
.
.
.
function test_parser_ticket()
{
$filename = "test_functions.txt";
$fp = fopen($filename, "a");
$string = "in test_parser_ticket\n";
$write = fputs($fp, $string);
fclose($fp);
}
And I get back (... means it's the same as before)
Code: Select all
in cer_parser constructor
.
.
.
[b]test_parser[/b]
.
.
.
in cer_parser_ticket constructor
.
.
.
[b]test_parser_ticket[/b]
.
.
.
But... *drumroll please*
NOTHING'S BEING PRINTED IN THE FILE THAT'S SUPPOSE TO BE WRITTEN IN THOSE FUNCTIONS!
I'm really starting to wonder if this is a Cerberus issue rather than a PHP one, but I'm not going to assume anything, especially since I'm not too familiar with PHP. What does everyone think?