Exemple #1
0
function dumpEvent(&$event)
{
    // Skip 'Newexten' events - there just toooo many of 'em || For Asterisk manager 1.1 i choose to ignore another stack of events cause the log is populated with useless events
    if ($event['Event'] === 'Newexten' || $event['Event'] == 'UserEvent' || $event['Event'] == 'AGIExec' || $event['Event'] == 'Newchannel' || $event['Event'] == 'Newstate' || $event['Event'] == 'ExtensionStatus') {
        LogLine("! AMI Event '" . $event['Event'] . " surpressed.\n");
        return;
    }
    $eventType = $event['Event'];
    logLine(getTimeStamp() . "\n");
    logLine("! --- Event -----------------------------------------------------------\n");
    foreach ($event as $eventKey => $eventValue) {
        logLine(sprintf("! %20s --> %-50s\n", $eventKey, $eventValue));
    }
    logLine("! ---------------------------------------------------------------------\n");
}
Exemple #2
0
function AssertDB2LayoutHash(Reader $reader, $expectedHash, $filename = 'DB2')
{
    if ($reader->getLayoutHash() != $expectedHash) {
        LogLine("Warning: Expected {$filename} hash " . str_pad(dechex($expectedHash), 8, '0', STR_PAD_LEFT) . " but found " . str_pad(dechex($reader->getLayoutHash()), 8, '0', STR_PAD_LEFT));
        //exit(1);
    }
}
Exemple #3
0
        $species = $id;
        $creature = $creatureReader->getRecord($rec['npc']);
        if (is_null($creature)) {
            continue;
        }
        $name = $creature['name'];
        $stmt->execute();
    }
    $stmt->close();
    EchoProgress(false);
    unset($creatureReader);
    unset($battlePetReader);
    /* */
}
/* */
LogLine("Done.\n");
function LogLine($msg)
{
    if ($msg == '') {
        return;
    }
    if (substr($msg, -1, 1) == "\n") {
        $msg = substr($msg, 0, -1);
    }
    echo "\n" . date('H:i:s') . ' ' . $msg;
}
function EchoProgress($frac)
{
    static $lastStr = false;
    if ($frac === false) {
        $lastStr = false;