Example #1
0
 function __construct($user, $pw, $conn_str, $ignore_connect_error = 0)
 {
     #$this->conn = oci_pconnect($user, $pw, $conn_str);
     u::info("getting connection to {$conn_str}", 1);
     $this->conn = oci_connect($user, $pw, $conn_str);
     if (!$this->conn) {
         $e = oci_error();
         $errm = htmlentities($e['message'], ENT_QUOTES);
         if ($ignore_connect_error) {
             u::p($errm);
             $this->connection_error = 1;
         } else {
             trigger_error($errm, E_USER_ERROR);
         }
     } else {
         $this->connection_error = 0;
     }
 }
Example #2
0
}
u::info("start.php", 1);
#
# Check what is being called
#
u::info("<!-- GET/POST");
$longest = 0;
foreach ($_REQUEST as $key => $val) {
    if (strlen($key) > $longest) {
        $longest = strlen($key);
    }
}
foreach ($_REQUEST as $key => $val) {
    u::info(str_pad($key, $longest) . ' = ' . $val);
}
u::info("-->");
#
# Turn warnings into errors
#
function handleError($errno, $errstr, $errfile, $errline, array $errcontext)
{
    // error was suppressed with the @-operator
    if (0 === error_reporting()) {
        return false;
    }
    throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
}
set_error_handler('handleError');
#
# Constants
#
Example #3
0
 static function inc($file)
 {
     extract($GLOBALS, EXTR_REFS);
     u::info('<!-- ' . $file . ' -->');
     u::$info_tabs++;
     include $file;
     u::$info_tabs--;
     u::info('<!-- END : ' . $file . ' -->');
 }
Example #4
0
    u::start_tag('tr', $class_str);
    $sid_cell = "<div " . highlight_js_str($rec->SID) . ">" . drilldown_links($rec->SID, $db, '', $snaps_table) . "</div>";
    u::td($sid_cell, '', 1);
    u::td($rec->USERNAME, '', 1);
    #
    # Covert seconds to % for plotting
    #
    $values = array($rec->SECONDS_ON_CPU, $rec->SECONDS_USER_IO, $rec->SECONDS_SYSTEM_IO, $rec->SECONDS_BLOCKED, $rec->SECONDS_OTHER);
    foreach ($values as $key => $value) {
        $values[$key] = round($value * 100 / ($mins_hist * 60));
    }
    u::start_tag('td', 'style="padding:0;"');
    #
    # Draw percentages as a bar chart
    #
    u::info('Draw Bar chart', 1);
    include 'bar_chart.php';
    u::info('Draw Bar chart - Done', 1);
    u::end_tag('td');
    $highlight_graph_str = "onmouseover=\"highlight('{$rec->CURRENT_BLOCKING_SESSION}');\" ";
    $sid_cell = "<div {$highlight_graph_str}>" . drilldown_links($rec->CURRENT_BLOCKING_SESSION, $db, '', $snaps_table) . "</div>";
    u::td($sid_cell, '', 1);
    u::td("<div " . highlight_js_str($rec->CURRENT_SQL_ID) . ">" . sql_details_link($rec->CURRENT_SQL_ID, $db) . "</div>", '', 1);
    u::td("<div " . highlight_js_str($rec->PREV_SQL_ID) . ">" . sql_details_link($rec->PREV_SQL_ID, $db) . "</div>", '', 1);
    u::td($rec->CURRENT_PROGRAM, '', 1);
    u::td($rec->CURRENT_MACHINE, 'style="border-right:0px;"', 1);
    u::end_tag('tr');
}
u::filler_rows($table_rows, $i, 8);
u::end_tag('table');
u::end_tag('div');