public function parse_file(File $file, $prefix = '') { $reader = new BufferedFileReader($file); $query = ''; while (($line = $reader->read_line()) !== null) { if (!empty($line) && substr($line, 0, 2) !== '--') { if (substr($line, -1) == ';') { if (empty($query)) { $query = $line; } else { $query .= ' ' . $line; } if (!empty($tableprefix)) { $query = str_replace('phpboost_', $tableprefix, $query); } $this->querier->inject($query); $query = ''; } else { $query .= ' ' . $line; } } } }
public function tearDown() { self::$dbms_utils = null; self::$querier->inject("DROP TABLE IF EXISTS `" . self::$test_table1 . "`"); self::$querier->inject("DROP TABLE IF EXISTS `" . self::$test_table2 . "`"); }
/** * @desc delete all the row from the <code>$table_name</code> table matching the * <code>$condition</code> condition * @param string $table_name the name of the table on which work will be done * @param string $condition the update condition beginning just after the from clause. * For example, <code>"length > 50 and weight < 100"</code> * @param string[string] $parameters the query_var map */ public function delete($table_name, $condition, array $parameters = array()) { $query = 'DELETE FROM ' . $table_name . ' ' . $condition . ';'; $this->querier->inject($query, $parameters); }
public function tearDown() { $this->querier->inject("DROP TABLE IF EXISTS " . $this->model->get_table_name() . ";"); }