예제 #1
0
 public function testFTS()
 {
     $tableName = "test_fts4";
     if (!$this->db->hasTable($tableName)) {
         $this->db->fetchColumn("CREATE VIRTUAL TABLE {$tableName} USING fts4(subject, body)");
         for ($i = 1; $i <= 100; $i++) {
             $id = $this->db->insert($tableName, array('subject' => $i . ' test ' . $i, 'body' => $i . 'hello hollad cccdd aayy' . $i));
         }
     }
     $row = $this->db->query("SELECT * FROM {$tableName} WHERE subject MATCH 'test'");
     return $row;
 }
예제 #2
0
 /**
  * creat or get a DB
  *
  * @param $dbpath
  * @return SpatialiteShellDriver
  */
 public function createDB($dbpath)
 {
     $driver = new SpatialiteShellDriver($dbpath);
     if (!$driver->hasTable("geometry_columns")) {
         $driver->initDbFile();
     }
     return $driver;
 }