real_connect($host, $user, $passwd, $db, $port, $socket, $flags); } else { parent::__construct($host, $user, $passwd, $db, $port, $socket); } } } function have_innodb($link) { if (($res = $link->query("SHOW VARIABLES LIKE 'have_innodb'")) && ($row = $res->fetch_row()) && !empty($row)) { if ($row[1] == "DISABLED" || $row[1] == "NO") { return false; } return true; } else { /* MySQL 5.6.1+ */ if ($res = $link->query("SHOW ENGINES")) { while ($row = $res->fetch_assoc()) { if (!isset($row['Engine']) || !isset($row['Support'])) return false; if (('InnoDB' == $row['Engine']) && (('YES' == $row['Support']) || ('DEFAULT' == $row['Support'])) ) { return true; } } return false; } else { return false; } } return false; } } else { printf("skip Eeeek/BUG/FIXME - connect.inc included twice! skipif bug?\n"); } function handle_catchable_fatal($errno, $error, $file, $line) { static $errcodes = array(); if (empty($errcodes)) { $constants = get_defined_constants(); foreach ($constants as $name => $value) { if (substr($name, 0, 2) == "E_") $errcodes[$value] = $name; } } printf("[%s] %s in %s on line %s\n", (isset($errcodes[$errno])) ? $errcodes[$errno] : $errno, $error, $file, $line); return true; } ?>