From 5230f8f8a86fc1ae5d90f8c74ae65c93e197502b Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Thu, 22 Jan 2015 09:14:12 +0100 Subject: Apply namespaces to class inheritances (pt1) --- framework/Caching/TDbCache.php | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'framework/Caching/TDbCache.php') diff --git a/framework/Caching/TDbCache.php b/framework/Caching/TDbCache.php index 968fac30..cee1b193 100644 --- a/framework/Caching/TDbCache.php +++ b/framework/Caching/TDbCache.php @@ -10,7 +10,11 @@ */ namespace Prado\Caching; -Prado::using('System.Data.TDbConnection'); +use Prado\Prado; +use Prado\Data\TDataSourceConfig; +use Prado\Data\TDbConnection; +use Prado\Exceptions\TConfigurationException; +use Prado\TPropertyValue; /** * TDbCache class @@ -201,7 +205,7 @@ class TDbCache extends TCache $this -> getApplication() -> setGlobalState($key, time()); } } - catch(Exception $e) + catch(\Exception $e) { // DB table not exists if($this->_autoCreate) @@ -464,7 +468,7 @@ class TDbCache extends TCache $command=$this->getDbConnection()->createCommand($sql); return unserialize($command->queryScalar()); } - catch(Exception $e) + catch(\Exception $e) { $this->initializeCache(true); return unserialize($command->queryScalar()); @@ -503,12 +507,12 @@ class TDbCache extends TCache try { $command=$this->getDbConnection()->createCommand($sql); - $command->bindValue(':key',$key,PDO::PARAM_STR); - $command->bindValue(':value',serialize($value),PDO::PARAM_LOB); + $command->bindValue(':key',$key,\PDO::PARAM_STR); + $command->bindValue(':value',serialize($value),\PDO::PARAM_LOB); $command->execute(); return true; } - catch(Exception $e) + catch(\Exception $e) { try { @@ -516,7 +520,7 @@ class TDbCache extends TCache $command->execute(); return true; } - catch(Exception $e) + catch(\Exception $e) { return false; } @@ -535,11 +539,11 @@ class TDbCache extends TCache try { $command=$this->getDbConnection()->createCommand("DELETE FROM {$this->_cacheTable} WHERE itemkey=:key"); - $command->bindValue(':key',$key,PDO::PARAM_STR); + $command->bindValue(':key',$key,\PDO::PARAM_STR); $command->execute(); return true; } - catch(Exception $e) + catch(\Exception $e) { $this->initializeCache(true); $command->execute(); @@ -559,7 +563,7 @@ class TDbCache extends TCache $command = $this->getDbConnection()->createCommand("DELETE FROM {$this->_cacheTable}"); $command->execute(); } - catch(Exception $e) + catch(\Exception $e) { try { @@ -567,7 +571,7 @@ class TDbCache extends TCache $command->execute(); return true; } - catch(Exception $e) + catch(\Exception $e) { return false; } -- cgit v1.2.3