Пример #1
0
 public function _write($ses_id, $data)
 {
     if ($data == $this->_savedData) {
         return;
     }
     $ses_id = preg_replace('/\\W+/', '', $ses_id);
     if (!strlen($ses_id)) {
         return;
     }
     // @todo remove this, use User_Session_Handled_Db from User bundle
     if (class_exists('Oops_User_Helper')) {
         $user_id = Oops_User_Helper::GetID();
     } else {
         $user_id = 0;
     }
     $ses_time = date("Ymd");
     // Oops_Sql::Query("SET SQL_LOG_BIN=0");
     if (strlen($data)) {
         Oops_Sql_Common::insertUpdate($this->_tableSessions, array('ses_id' => $ses_id, 'ses_time' => $ses_time, 'ses_start' => $ses_time, 'data' => $data, 'user_id' => $user_id), array('ses_id'));
     } else {
         Oops_Sql_Common::delete($this->_tableSessions, array('ses_id' => $ses_id));
     }
     // Oops_Sql::Query("SET SQL_LOG_BIN=1");
     return true;
 }