Exemplo n.º 1
0
                $replac[0] = '';
                $replac[1] = ''';
                // We don't have FlipSearchMap remap since we have our own mapping between
                // scandata.xml leaf numbers and BR indices that happens in BRSearchCallback
                echo "{$callback}('" . preg_replace($patterns, $replac, $xml) . "');";
            }
            //echo $xml;
        }
    }
    //////
    debug_msg("Done and exiting!", 2);
    exit;
    //////
} catch (Exception $e) {
    // an internal method call invoked "fatal()"...
    XML::resultMessage('error', 'internal_error', $e->getMessage());
}
function matches_terms(&$text, &$terms)
{
    foreach ($terms as $term) {
        if (preg_match("/{$term}/i", $text)) {
            return true;
        }
    }
    return false;
}
function debug_msg($msg, $level)
{
    global $debug_level;
    global $pid;
    global $format;