From 5eeabb67d7fa82ac230bb1a323ca3204d59b9915 Mon Sep 17 00:00:00 2001 From: Silvio Date: Wed, 31 Mar 2010 12:24:53 -0300 Subject: Adding classe CinIsis --- classes/CinIsis.php | 40 ++++++++++++++++++++++++++++++++++++++++ classes/MaleteDb.php | 4 ++-- config/config.yaml | 2 +- index.php | 28 ++++++++++++---------------- 4 files changed, 55 insertions(+), 19 deletions(-) create mode 100644 classes/CinIsis.php diff --git a/classes/CinIsis.php b/classes/CinIsis.php new file mode 100644 index 0000000..300bd61 --- /dev/null +++ b/classes/CinIsis.php @@ -0,0 +1,40 @@ +implementation = $config['implementation'] .'Db'; + $this->db = new $this->implementation($schema); + } +} diff --git a/classes/MaleteDb.php b/classes/MaleteDb.php index 0628e9e..a2d45aa 100644 --- a/classes/MaleteDb.php +++ b/classes/MaleteDb.php @@ -71,11 +71,11 @@ class MaleteDb implements IsisDb { * @see IsisDb::read() */ public function rows() { - $id = 1; + $id = 0; while($this->db->read($id)) { $id++; } - return $id - 1; + return $id; } /** diff --git a/config/config.yaml b/config/config.yaml index 0275926..f40aa75 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -1,3 +1,3 @@ --- -implementation: Malete +implementation: PhpIsis database: anu10 diff --git a/index.php b/index.php index 3887b3d..42140d6 100644 --- a/index.php +++ b/index.php @@ -1,36 +1,32 @@ read(1); - $rows = $db->rows(); +if ($isis->db) { + $result = $isis->db->read(1); + $rows = $isis->db->rows(); // Format output. echo '
';
-- 
cgit v1.2.3