summaryrefslogtreecommitdiff
path: root/shared
diff options
context:
space:
mode:
authorEudyptula <eitan@mosenkis.net>2009-06-17 18:24:09 -0400
committerEudyptula <eitan@mosenkis.net>2009-06-17 18:24:09 -0400
commitbe11ee8c9834387dbf0d3dc7adcfafc375179294 (patch)
tree1c93df634a61cb2a01a6087fce18658f5c1a738d /shared
parentMove dbinit to shared and gave backend db access, created classes buildlog_en... (diff)
downloadingenue-be11ee8c9834387dbf0d3dc7adcfafc375179294.tar.gz
ingenue-be11ee8c9834387dbf0d3dc7adcfafc375179294.tar.bz2
ingenue-be11ee8c9834387dbf0d3dc7adcfafc375179294.zip
Added build logging to database, basic frontend log viewer
Diffstat (limited to 'shared')
-rw-r--r--shared/classes/0sql_row_obj.php6
-rw-r--r--shared/classes/buildlog_entry.php1
-rw-r--r--shared/classes/task.php5
3 files changed, 8 insertions, 4 deletions
diff --git a/shared/classes/0sql_row_obj.php b/shared/classes/0sql_row_obj.php
index e7aafa3..9461eeb 100644
--- a/shared/classes/0sql_row_obj.php
+++ b/shared/classes/0sql_row_obj.php
@@ -284,7 +284,7 @@ abstract class sql_row_obj { // If the name of this class changes, it must be up
if (!array_key_exists($name, $this->db_values) || $this->values[$name] !== $this->db_values[$name]) {
$sql_val=$col->sql_value($this->values[$name]);
if (is_array($sql_val)) {
- echo $name."\n";
+ //echo $name."\n";
print_r($sql_val);
throw new Exception('Failed to write '.get_class($this).' object to table `'.$this->table.'` because column '.$name.' ('.$sql_val['description'].') '.$sql_val['reason'].' (value: '.$sql_val['value'].')');
}
@@ -304,7 +304,7 @@ abstract class sql_row_obj { // If the name of this class changes, it must be up
self::sql_query($q);
// Fill auto-increment column if it was null before the query
if (isset($this->auto_increment) && $this->__get($this->auto_increment) === null) {
- $this->__set($this->auto_increment, sql_last_insert_id());
+ $this->__set($this->auto_increment, self::$pdo->lastInsertId());
}
// We've just written the current values to the db, so it stands to reason they are now the values in the db
$this->values_to_db_values();
@@ -627,7 +627,7 @@ class sql_col {
} elseif (substr($string, 0, 1) == "'") {
// An odd number of ' at the end means an unquoted '
// The $i<count($opts) is just to avoid infinite loops that shouldn't happen
- echo strtoupper($word).' '.$string;
+ //echo strtoupper($word).' '.$string;
while ( ( strlen($string) - strlen(rtrim($string, '\'')) ) % 2 == 0 && $i<count($opts)) {
$string.=' '.$opts[++$i];
}
diff --git a/shared/classes/buildlog_entry.php b/shared/classes/buildlog_entry.php
index 417a3eb..d3dfb9c 100644
--- a/shared/classes/buildlog_entry.php
+++ b/shared/classes/buildlog_entry.php
@@ -22,7 +22,6 @@ class sql_buildlog_entry extends sql_row_obj {
'type' => 'TEXT',
'not null' => true,
)
-
);
}
?>
diff --git a/shared/classes/task.php b/shared/classes/task.php
index 7fe83f4..3eecdeb 100644
--- a/shared/classes/task.php
+++ b/shared/classes/task.php
@@ -8,6 +8,11 @@ class sql_task extends sql_row_obj {
'not null' => true,
'auto increment' => true,
),
+ 'build' => array(
+ 'type' => 'CHAR',
+ 'length' => 6,
+ 'not null' => true,
+ ),
'command' => array (
'type' => 'VARCHAR',
'length' => 255,