function &select($sql) { if ($this->_rw_lnk) { $db_lnk =& $this->_rw_lnk; } else { if ($this->_ro_lnk) { $db_lnk =& $this->_ro_lnk; } else { $db_lnk =& $this->_ro_conn(); } } if (cachemgr::check_current_co_depth() > 0 && preg_match('/FROM\\s+([]0-9a-z_:"`.@[-]*)/is', $sql, $matchs)) { if (isset($matchs[1])) { $table = strtoupper(trim(str_replace(array('`', '"', '\''), array('', '', ''), $matchs[1]))); if (!cachemgr::check_current_co_objects_exists('DB', $table)) { cachemgr::check_expries('DB', $table); } } } $rs = $this->exec($sql, false, $db_lnk); $data = array(); while ($row = mysql_fetch_assoc($rs['rs'])) { $data[] = $row; } mysql_free_result($rs['rs']); return $data; }
public function check_expries($key, $force = false) { if ($force || cachemgr::check_current_co_depth() > 0) { if (!isset($this->__checkVaryArr[$key])) { $this->__checkVaryArr[$key] = strtoupper(md5($this->app_id . $key)); } if (!cachemgr::check_current_co_objects_exists('CONF', $this->__checkVaryArr[$key])) { cachemgr::check_expries('CONF', $this->__checkVaryArr[$key]); } } }