svn: /web/qa/trunk/reports/ parserfunc.php

From: Date: Mon, 13 Jun 2011 22:34:00 +0000
Subject: svn: /web/qa/trunk/reports/ parserfunc.php
Groups: php.qa 
Request: Send a blank email to php-qa+get-65811@lists.php.net to get a copy of this message
odoucet Mon, 13 Jun 2011 22:34:00 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=312131 Log: qa report: forget to create tables in sqlite files if this is a new version. added a small bugfix (need a test script for the future ... This will be next commit). Changed paths: U web/qa/trunk/reports/parserfunc.php Modified: web/qa/trunk/reports/parserfunc.php =================================================================== --- web/qa/trunk/reports/parserfunc.php 2011-06-13 22:08:58 UTC (rev 312130) +++ web/qa/trunk/reports/parserfunc.php 2011-06-13 22:34:00 UTC (rev 312131) @@ -40,6 +40,41 @@ return; } $DBFILE = dirname(__FILE__).'/db/'.$array['version'].'.sqlite'; + + if (!file_exists($DBFILE)) { + //Create DB + $dbi = new SQLite3($DBFILE, SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE); + $query = 'CREATE TABLE failed ( + id integer PRIMARY KEY AUTOINCREMENT, + id_report bigint(20) NOT NULL, + test_name varchar(128) NOT NULL, + output STRING NOT NULL, + diff STRING NOT NULL, + signature binary(16) NOT NULL + )'; + $dbi->exec($query); + if ($dbi->lastErrorCode() != '') { + echo "ERROR: ".$dbi->lastErrorMsg()."\n"; + exit; + } + + $query = 'CREATE TABLE reports ( + id integer primary key AUTOINCREMENT, + date datetime NOT NULL, + status smallint(1) not null, + nb_failed unsigned int(10) NOT NULL, + nb_expected_fail unsigned int(10) NOT NULL, + build_env STRING NOT NULL, + phpinfo STRING NOT NULL, + user_email varchar(64) default null + )'; + $dbi->exec($query); + if ($dbi->lastErrorCode() != '') { + echo "ERROR: ".$dbi->lastErrorMsg()."\n"; + exit; + } + $dbi->close(); + } $dbi = new SQLite3($DBFILE, SQLITE3_OPEN_READWRITE) or exit('cannot open DB to record results'); $query = "INSERT INTO reports (id, date, status, @@ -194,10 +229,6 @@ } $extract['tests'][$name]['output'] = $outputTest; $extract['tests'][$name]['diff'] = rtrim( preg_replace('@ [^\s]{1,}'.substr($name, 0, -1).'@', ' %s/'.basename(substr($name, 0, -1)), $diff)); - - //last cleanup attempt - //if ($extract['tests'][$name]['diff'] == '') unset($extract['tests'][$name]); - } unset($extract['outputsRaw']);

« previous php.qa (#65811) next »