本文整理匯總了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;
}
}