public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) { $this->flushError(); Cli::pcolor(Cli::ansiwarn, "\t\t\t\tException: "); Cli::pcolor(Cli::ansilerr, $e->getMessage()); Cli::pcolor(Cli::ansicrit, " in "); Cli::pcolor(Cli::ansierr, $e->getFile()); Cli::pcolor(Cli::ansicrit, " line "); Cli::pcolorln(Cli::ansierr, $e->getLine()); $n = 0; foreach ($e->getTrace() as $item) { if ($n++ < 2) { continue; } if (!array_key_exists("file", $item)) { break; } Cli::pr("\t\t\t\t\t"); if (array_key_exists("class", $item) && $item["class"] != "") { Cli::pcolor(Cli::ansicrit, $item["class"] . "->"); } Cli::pcolor(Cli::ansicrit, $item["function"] . "();"); Cli::pcolor(Cli::ansicrit, " in "); Cli::pcolor(Cli::ansierr, $item["file"]); if (array_key_exists("line", $item)) { Cli::pcolor(Cli::ansicrit, " line "); Cli::pcolor(Cli::ansierr, $item["line"]); } Cli::pln(""); } }
public static function import() { Cli::enableHelp(); Cli::pr("\"model\": "); $tables = array(); $bdd = Bdd::getInstance(); foreach ($bdd->getTables() as $table) { $tables[$table] = $bdd->getTableInfo($table); } $p = 0; if (version_compare(PHP_VERSION, '5.4.0') >= 0) { $p = JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE; } Cli::pln(json_encode($tables, $p)); }