本文整理匯總了PHP中DevblocksPlatform::parseStringAsRegExp方法的典型用法代碼示例。如果您正苦於以下問題:PHP DevblocksPlatform::parseStringAsRegExp方法的具體用法?PHP DevblocksPlatform::parseStringAsRegExp怎麽用?PHP DevblocksPlatform::parseStringAsRegExp使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DevblocksPlatform
的用法示例。
在下文中一共展示了DevblocksPlatform::parseStringAsRegExp方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: parseMessage
//.........這裏部分代碼省略.........
}
}
// [JAS] It's important to not set the group_id on the ticket until the messages exist
// or inbox filters will just abort.
$fields = array(DAO_Ticket::MASK => $sMask, DAO_Ticket::SUBJECT => $sSubject, DAO_Ticket::IS_CLOSED => 0, DAO_Ticket::FIRST_WROTE_ID => intval($fromAddressInst->id), DAO_Ticket::LAST_WROTE_ID => intval($fromAddressInst->id), DAO_Ticket::CREATED_DATE => $iDate, DAO_Ticket::UPDATED_DATE => $iDate, DAO_Ticket::LAST_ACTION_CODE => CerberusTicketActionCode::TICKET_OPENED);
$id = DAO_Ticket::createTicket($fields);
// Apply routing actions to our new ticket ID
if (isset($routing_rules) && is_array($routing_rules)) {
foreach ($routing_rules as $rule) {
$rule->run($id);
}
}
}
// [JAS]: Add requesters to the ticket
if (!empty($fromAddressInst->id) && !empty($id)) {
// Don't add a requester if the sender is a helpdesk address
if (isset($helpdesk_senders[$fromAddressInst->email])) {
$logger->info("[Parser] Not adding ourselves as a requester: " . $fromAddressInst->email);
} else {
DAO_Ticket::createRequester($fromAddressInst->id, $id);
}
}
// Add the other TO/CC addresses to the ticket
// [TODO] This should be cleaned up and optimized
if ($settings->get('cerberusweb.core', CerberusSettings::PARSER_AUTO_REQ, 0)) {
@($autoreq_exclude_list = $settings->get('cerberusweb.core', CerberusSettings::PARSER_AUTO_REQ_EXCLUDE, ''));
$destinations = self::getDestinations($headers);
if (is_array($destinations) && !empty($destinations)) {
// Filter out any excluded requesters
if (!empty($autoreq_exclude_list)) {
@($autoreq_exclude = DevblocksPlatform::parseCrlfString($autoreq_exclude_list));
if (is_array($autoreq_exclude) && !empty($autoreq_exclude)) {
foreach ($autoreq_exclude as $excl_pattern) {
$excl_regexp = DevblocksPlatform::parseStringAsRegExp($excl_pattern);
// Check all destinations for this pattern
foreach ($destinations as $idx => $dest) {
if (@preg_match($excl_regexp, $dest)) {
unset($destinations[$idx]);
}
}
}
}
}
foreach ($destinations as $dest) {
if (null != ($destInst = CerberusApplication::hashLookupAddress($dest, true))) {
// Skip if the destination is one of our senders or the matching TO
if (isset($helpdesk_senders[$destInst->email])) {
continue;
}
DAO_Ticket::createRequester($destInst->id, $id);
}
}
}
}
$attachment_path = APP_STORAGE_PATH . '/attachments/';
// [TODO] This should allow external attachments (S3)
$fields = array(DAO_Message::TICKET_ID => $id, DAO_Message::CREATED_DATE => $iDate, DAO_Message::ADDRESS_ID => $fromAddressInst->id);
$email_id = DAO_Message::create($fields);
// Content
DAO_MessageContent::create($email_id, $message->body);
// Headers
foreach ($headers as $hk => $hv) {
DAO_MessageHeader::create($email_id, $hk, $hv);
}
// [mdf] Loop through files to insert attachment records in the db, and move temporary files
if (!empty($email_id)) {