protected function SqliteProfilerStorage::exec

Overrides PdoProfilerStorage::exec

File

drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/SqliteProfilerStorage.php, line 57

Class

SqliteProfilerStorage
SqliteProfilerStorage stores profiling information in a SQLite database.

Namespace

Symfony\Component\HttpKernel\Profiler

Code

protected function exec($db, $query, array $args = array()) {
  if ($db instanceof \SQLite3) {
    $stmt = $this
      ->prepareStatement($db, $query);
    foreach ($args as $arg => $val) {
      $stmt
        ->bindValue($arg, $val, is_int($val) ? \SQLITE3_INTEGER : \SQLITE3_TEXT);
    }
    $res = $stmt
      ->execute();
    if (false === $res) {
      throw new \RuntimeException(sprintf('Error executing SQLite query "%s"', $query));
    }
    $res
      ->finalize();
  }
  else {
    parent::exec($db, $query, $args);
  }
}