Changeset 8506
- Timestamp:
- 04/17/08 17:56:05 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/lib/storage/sfDatabaseSessionStorage.class.php
r8505 r8506 98 98 99 99 // get the database resource 100 $this->db = $database->get Resource();100 $this->db = $database->getConnection(); 101 101 if (is_null($this->db)) 102 102 { branches/1.1/lib/storage/sfMySQLSessionStorage.class.php
r8504 r8506 39 39 40 40 // cleanup the session id, just in case 41 $id = mysql_real_escape_string($id, $this->db );41 $id = mysql_real_escape_string($id, $this->db->getResource()); 42 42 43 43 // delete the record associated with this id 44 44 $sql = 'DELETE FROM '.$db_table.' WHERE '.$db_id_col.' = \''.$id.'\''; 45 45 46 if (@mysql_query($sql, $this->db ))46 if (@mysql_query($sql, $this->db->getResource())) 47 47 { 48 48 return true; … … 71 71 $sql = 'DELETE FROM '.$db_table.' WHERE '.$db_time_col.' < '.(time() - $lifetime); 72 72 73 if (!@mysql_query($sql, $this->db ))73 if (!@mysql_query($sql, $this->db->getResource())) 74 74 { 75 75 throw new sfDatabaseException(sprintf('sfMySQLSessionStorage cannot delete old sessions (%s).', mysql_error())); … … 97 97 98 98 // cleanup the session id, just in case 99 $id = mysql_real_escape_string($id, $this->db );99 $id = mysql_real_escape_string($id, $this->db->getResource()); 100 100 101 101 // delete the record associated with this id 102 102 $sql = 'SELECT '.$db_data_col.' FROM '.$db_table.' WHERE '.$db_id_col.' = \''.$id.'\''; 103 103 104 $result = @mysql_query($sql, $this->db );104 $result = @mysql_query($sql, $this->db->getResource()); 105 105 106 106 if ($result != false && @mysql_num_rows($result) == 1) … … 116 116 $sql = 'INSERT INTO '.$db_table.' ('.$db_id_col.', '.$db_data_col.', '.$db_time_col.') VALUES (\''.$id.'\', \'\', '.time().')'; 117 117 118 if (@mysql_query($sql, $this->db ))118 if (@mysql_query($sql, $this->db->getResource())) 119 119 { 120 120 return ''; … … 145 145 146 146 // cleanup the session id and data, just in case 147 $id = mysql_real_escape_string($id, $this->db );148 $data = mysql_real_escape_string($data, $this->db );147 $id = mysql_real_escape_string($id, $this->db->getResource()); 148 $data = mysql_real_escape_string($data, $this->db->getResource()); 149 149 150 150 // delete the record associated with this id 151 151 $sql = 'UPDATE '.$db_table.' SET '.$db_data_col.' = \''.$data.'\', '.$db_time_col.' = '.time().' WHERE '.$db_id_col.' = \''.$id.'\''; 152 152 153 if (@mysql_query($sql, $this->db ))153 if (@mysql_query($sql, $this->db->getResource())) 154 154 { 155 155 return true;

