From 2922c9aff6e11757629b86996fa23d8ed7b93c56 Mon Sep 17 00:00:00 2001 From: zYne Date: Fri, 9 Feb 2007 20:56:04 +0000 Subject: [PATCH] caching docs --- lib/Doctrine/Adapter/Statement/Interface.php | 2 +- lib/Doctrine/Cache.php | 3 +- lib/Doctrine/Db.php | 2 + lib/Doctrine/Db/Statement.php | 4 +- manual/docs/Caching - Availible options.php | 12 ++++++ manual/docs/Caching - Introduction.php | 45 ++++++++++++++++++++ manual/documentation.php | 30 +++++++++++-- 7 files changed, 90 insertions(+), 8 deletions(-) create mode 100644 manual/docs/Caching - Availible options.php create mode 100644 manual/docs/Caching - Introduction.php diff --git a/lib/Doctrine/Adapter/Statement/Interface.php b/lib/Doctrine/Adapter/Statement/Interface.php index d028b7cce..3a22d57c8 100644 --- a/lib/Doctrine/Adapter/Statement/Interface.php +++ b/lib/Doctrine/Adapter/Statement/Interface.php @@ -133,7 +133,7 @@ interface Doctrine_Adapter_Statement_Interface * bound parameters in the SQL statement being executed. * @return boolean Returns TRUE on success or FALSE on failure. */ - public function execute(array $params = array()); + public function execute($params = null); /** * fetch * diff --git a/lib/Doctrine/Cache.php b/lib/Doctrine/Cache.php index 1f9807526..2aec1a010 100644 --- a/lib/Doctrine/Cache.php +++ b/lib/Doctrine/Cache.php @@ -18,6 +18,7 @@ * and is licensed under the LGPL. For more information, see * . */ +Doctrine::autoload('Doctrine_Db_EventListener'); /** * Doctrine_Cache * @@ -234,7 +235,7 @@ class Doctrine_Cache extends Doctrine_Db_EventListener implements Countable, Ite while ($i--) { $element = next($stats); $query = key($stats); - + $hash = md5($query); $this->_driver->delete($hash); diff --git a/lib/Doctrine/Db.php b/lib/Doctrine/Db.php index 2ef5c1a94..750ab65a8 100644 --- a/lib/Doctrine/Db.php +++ b/lib/Doctrine/Db.php @@ -428,7 +428,9 @@ class Doctrine_Db implements Countable, IteratorAggregate, Doctrine_Adapter_Inte if ( ! empty($params)) { $stmt = $this->dbh->prepare($statement); + return $stmt->execute($params); + } else { if ( ! $skip) { $stmt = $this->dbh->query($statement); diff --git a/lib/Doctrine/Db/Statement.php b/lib/Doctrine/Db/Statement.php index 13cc79e39..20c03e77a 100644 --- a/lib/Doctrine/Db/Statement.php +++ b/lib/Doctrine/Db/Statement.php @@ -52,7 +52,7 @@ class Doctrine_Db_Statement implements Doctrine_Adapter_Statement_Interface } public function getStatement() { - return $this->stmt; + return $this->stmt; } public function getQuery() { @@ -194,7 +194,7 @@ class Doctrine_Db_Statement implements Doctrine_Adapter_Statement_Interface * bound parameters in the SQL statement being executed. * @return boolean Returns TRUE on success or FALSE on failure. */ - public function execute(array $params = array()) + public function execute($params = null) { $event = new Doctrine_Db_Event($this, Doctrine_Db_Event::EXECUTE, $this->stmt->queryString, $params); diff --git a/manual/docs/Caching - Availible options.php b/manual/docs/Caching - Availible options.php new file mode 100644 index 000000000..a59fb9816 --- /dev/null +++ b/manual/docs/Caching - Availible options.php @@ -0,0 +1,12 @@ +Doctrine_Cache offers many options for performance fine-tuning: +