[Solar-svn] Revision 2984
pmjones at solarphp.com
pmjones at solarphp.com
Wed Mar 5 06:45:41 CST 2008
Solar_Session_Handler_Adapter_Sql: [FIX] Various fixes noted by Antti Holvikari after I moved stuff around. Thanks, Antti.
Modified: trunk/Solar/Session/Handler/Adapter/Sql.php
===================================================================
--- trunk/Solar/Session/Handler/Adapter/Sql.php 2008-03-05 03:20:15 UTC (rev 2983)
+++ trunk/Solar/Session/Handler/Adapter/Sql.php 2008-03-05 12:45:41 UTC (rev 2984)
@@ -63,7 +63,7 @@
/**
*
- * Open session handler
+ * Open session handler.
*
* @return bool
*
@@ -82,6 +82,19 @@
/**
*
+ * Close session handler.
+ *
+ * @return bool
+ *
+ */
+ public function close()
+ {
+ $this->_sql->disconnect();
+ $this->_sql = null;
+ }
+
+ /**
+ *
* Reads session data.
*
* @param string $id The session ID.
@@ -197,12 +210,14 @@
*
* Inserts a new session-data row in the database.
*
+ * @param string $id The session ID.
+ *
* @param string $data The serialized session data.
*
* @return bool
*
*/
- protected function _insert($data)
+ protected function _insert($id, $data)
{
$now = date('Y-m-d H:i:s');
@@ -214,7 +229,7 @@
);
try {
- $this->_sql->insert($this->_config['table'], $values);
+ $this->_sql->insert($this->_config['table'], $cols);
} catch (Solar_Sql_Exception $e) {
// @todo log this somehow?
return false;
@@ -225,6 +240,8 @@
*
* Updates an existing session-data row in the database.
*
+ * @param string $id The session ID.
+ *
* @param string $data The serialized session data.
*
* @return bool
@@ -232,7 +249,7 @@
* @todo Should we log caught exceptions?
*
*/
- protected function _update($data)
+ protected function _update($id, $data)
{
$cols = array(
$this->_config['updated_col'] => date('Y-m-d H:i:s'),
More information about the Solar-svn
mailing list