From 4ccdc530bba8399f8e530d10699d4ffd2dfa612f Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Mon, 30 Jan 2012 14:27:45 +0100 Subject: [PATCH] [HttpKernel] Cleanup of PdoProfilerStorage --- .../Profiler/PdoProfilerStorage.php | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php b/src/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php index c87b8711f4..8e2bea4a44 100644 --- a/src/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php +++ b/src/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php @@ -91,22 +91,16 @@ abstract class PdoProfilerStorage implements ProfilerStorageInterface ':created_at' => time(), ); - if ($this->read($profile->getToken())) { - try { + try { + if ($this->read($profile->getToken())) { $this->exec($db, 'UPDATE sf_profiler_data SET parent = :parent, data = :data, ip = :ip, method = :method, url = :url, time = :time, created_at = :created_at WHERE token = :token', $args); - $this->cleanup(); - $status = true; - } catch (\Exception $e) { - $status = false; - } - } else { - try { + } else { $this->exec($db, 'INSERT INTO sf_profiler_data (token, parent, data, ip, method, url, time, created_at) VALUES (:token, :parent, :data, :ip, :method, :url, :time, :created_at)', $args); - $this->cleanup(); - $status = true; - } catch (\Exception $e) { - $status = false; } + $this->cleanup(); + $status = true; + } catch (\Exception $e) { + $status = false; } $this->close($db);