本文整理汇总了PHP中cachemgr::check_current_co_objects_exists方法的典型用法代码示例。如果您正苦于以下问题:PHP cachemgr::check_current_co_objects_exists方法的具体用法?PHP cachemgr::check_current_co_objects_exists怎么用?PHP cachemgr::check_current_co_objects_exists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cachemgr
的用法示例。
在下文中一共展示了cachemgr::check_current_co_objects_exists方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: strtoupper
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;
}
示例2: select
public function select($sql, $skipModifiedMark = false)
{
if ($this->_ro_lnk) {
$db_lnk = $this->_ro_lnk;
} else {
$db_lnk = $this->_ro_conn();
}
if ($this->prefix != 'vmc_') {
$sql = preg_replace_callback('/([`\\s\\(,])(vmc_)([0-9a-z\\_]+)([`\\s\\.]{0,1})/is', array($this, 'fix_dbprefix'), $sql);
}
if (cachemgr::enable() && cachemgr::check_current_co_depth() > 0 && preg_match_all('/FROM\\s+([]0-9a-z_:"`.@[-]*)/is', $sql, $matchs)) {
if (isset($matchs[1])) {
foreach ($matchs[1] as $table) {
if (empty($table)) {
continue;
}
$table = strtoupper(trim(str_replace(array('`', '"', '\''), array('', '', ''), $table)));
$pos = strpos($table, strtoupper($this->prefix));
if ($pos === 0) {
$table = substr($table, strlen($this->prefix));
}
//todo: 真实表名
if (!cachemgr::check_current_co_objects_exists('DB', $table)) {
cachemgr::check_expires('DB', $table);
}
}
}
}
$rs = $this->exec($sql, $skipModifiedMark, $db_lnk);
if (!empty($rs['rs'])) {
return $rs['rs'];
} else {
return false;
}
}
示例3: select
public function select($sql, $skipModifiedMark = false)
{
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 ($this->prefix != 'sdb_') {
//$sql = preg_replace('/([`\s\(,])(sdb_)([a-z\_]+)([`\s\.]{0,1})/is',"\${1}".$this->prefix."\\3\\4",$sql);
$sql = preg_replace_callback('/([`\\s\\(,])(sdb_)([0-9a-z\\_]+)([`\\s\\.]{0,1})/is', array($this, 'fix_dbprefix'), $sql);
//todo: 兼容有特殊符号的表名前缀
}
//todo:为了配合check_expries判断表名,冗余执行
if (cachemgr::enable() && 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])));
$pos = strpos($table, strtoupper($this->prefix));
if ($pos === 0) {
$table = substr($table, strlen($this->prefix));
}
//todo: 真实表名
if (!cachemgr::check_current_co_objects_exists('DB', $table)) {
cachemgr::check_expires('DB', $table);
}
}
}
$rs = $this->exec($sql, $skipModifiedMark, $db_lnk);
if ($rs['rs']) {
$data = array();
while ($row = mysql_fetch_assoc($rs['rs'])) {
$data[] = $row;
}
mysql_free_result($rs['rs']);
return $data;
} else {
return false;
}
}
示例4: check_expires
public function check_expires($key, $force = false)
{
if ($force || cachemgr::enable() && 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_expires('CONF', $this->__checkVaryArr[$key]);
}
}
}