You are here

protected function SqliteProfilerStorage::exec in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-kernel/Profiler/SqliteProfilerStorage.php \Symfony\Component\HttpKernel\Profiler\SqliteProfilerStorage::exec()

Overrides PdoProfilerStorage::exec

File

vendor/symfony/http-kernel/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);
  }
}