本文整理汇总了PHP中PMA_Tracker::enabled方法的典型用法代码示例。如果您正苦于以下问题:PHP PMA_Tracker::enabled方法的具体用法?PHP PMA_Tracker::enabled怎么用?PHP PMA_Tracker::enabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PMA_Tracker
的用法示例。
在下文中一共展示了PMA_Tracker::enabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isTracked
/**
* Gets the tracking status of a table, is it active or deactive ?
*
* @param string $dbname name of database
* @param string $tablename name of table
*
* @static
*
* @return boolean true or false
*/
public static function isTracked($dbname, $tablename)
{
if (!self::$enabled) {
return false;
}
/* We need to avoid attempt to track any queries
* from PMA_getRelationsParam
*/
self::$enabled = false;
$cfgRelation = PMA_getRelationsParam();
/* Restore original state */
self::$enabled = true;
if (!$cfgRelation['trackingwork']) {
return false;
}
$sql_query = " SELECT tracking_active FROM " . self::_getTrackingTable() . " WHERE db_name = '" . PMA_Util::sqlAddSlashes($dbname) . "' " . " AND table_name = '" . PMA_Util::sqlAddSlashes($tablename) . "' " . " ORDER BY version DESC";
$row = $GLOBALS['dbi']->fetchArray(PMA_queryAsControlUser($sql_query));
if (isset($row['tracking_active']) && $row['tracking_active'] == 1) {
return true;
} else {
return false;
}
}
示例2: isTracked
/**
* Gets the tracking status of a table, is it active or deactive ?
*
* @param string $dbname name of database
* @param string $tablename name of table
*
* @static
*
* @return boolean true or false
*/
static public function isTracked($dbname, $tablename)
{
if (! self::$enabled) {
return false;
}
/* We need to avoid attempt to track any queries from PMA_getRelationsParam */
self::$enabled = false;
$cfgRelation = PMA_getRelationsParam();
/* Restore original state */
self::$enabled = true;
if (! $cfgRelation['trackingwork']) {
return false;
}
$sql_query = " SELECT tracking_active FROM " . self::$pma_table .
" WHERE db_name = '" . PMA_sqlAddSlashes($dbname) . "' " .
" AND table_name = '" . PMA_sqlAddSlashes($tablename) . "' " .
" ORDER BY version DESC";
$row = PMA_DBI_fetch_array(PMA_query_as_controluser($sql_query));
if (isset($row['tracking_active']) && $row['tracking_active'] == 1) {
return true;
} else {
return false;
}
}