There we go.

Comments

damien tournoud’s picture

Status: Active » Needs work

In the MySQL and PostgreSQL implementation:

+      $asssertions = array();

(one s too many)

+  public function clearDatabase() {
+    if ($this->connection) {
+      $query = $this->connection->prepare(PIFRClientReviewDB_sqlite::table_query);
+      foreach ($query->execute() as $table) {
+        $this->connection->query("DROP TABLE $table->name");
+      }
+      return !$this->connection->exec(PIFRClientReviewDB_sqlite::table_query);
+    }
+    return FALSE;
+  }

This could probably be a noop if we suppose that PIFR remove all the checkout directory before doing a new checkout.

+  public function setVariable($name, $value) {
+    if ($this->connection) {
+      $db_prefix = is_array($this->db_prefix) && isset($this->db_prefix['variable']) ? $this->db_prefix['variable'] : $this->db_prefix;
+      $status = $this->connection
+        ->prepare('INSERT INTO ' . $db_prefix . 'variable (name, value) VALUES (:name, :value)'
+        ->execute(array('name' => $name, 'value' => serialize($value)));
+      return $status && $this->connection->exec('TRUNCATE TABLE cache') !== FALSE;
+    }
+    return FALSE;
+  }

The cache table is not prefixed. I suggest moving Drupal 7 DatabaseConnection::prefixTable() function to the class, and using that directly.

chx’s picture

Status: Needs work » Needs review
StatusFileSize
new5.45 KB

Thanks Damien.

damien tournoud’s picture

Status: Needs review » Needs work

Seems ok now. What do we need to set up in order to test that?

chx’s picture

Status: Needs work » Needs review

i guess Damien crossposted.

boombatower’s picture

Status: Needs review » Needs work

Should be able to just run the pifr_client.test wither everything setup for SQLite. Read the install.txt if you need any help.

I'll review the code shortly.

boombatower’s picture

Heh, I cross-posted as well. Eitherway I ran the test and it crashes with patch applied. Since I am assume it is related to the changing of the way the assertion are returned.

Beware that running the test will hose your file_directory_path variable, haven't figured that one out yet.

boombatower’s picture

Status: Needs work » Needs review
StatusFileSize
new4.67 KB
  • Left over ) was causing the issue.
  • Also a spelling error in the mysql.inc change that was caught by test.
  • Extra change to .info file (assume from dev tarball)

After cleanup all seems well.

boombatower’s picture

Confirmed that everything still works for mysql. I would like chx or Damien to run the pifr client test on sqlite and confirm that it works.

Thanks again for getting on this.

boombatower’s picture

ping?

boombatower’s picture

Priority: Normal » Critical

SQLite will be dropped from the testbot for the initial release if this isn't done by then.

boombatower’s picture

boombatower’s picture

Assigned: Unassigned » boombatower
StatusFileSize
new5.04 KB

Updated for create/drop, cleaned up code, and checked that path is inside checkout directory...since that is expected.

boombatower’s picture

Status: Needs review » Fixed

Committed.

boombatower’s picture

Added documentation to INSTALL.txt.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.