当前位置: 首页>>代码示例>>PHP>>正文


PHP PMA_Tracker::enabled方法代码示例

本文整理汇总了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;
     }
 }
开发者ID:1290800466,项目名称:mac_win,代码行数:33,代码来源:Tracker.class.php

示例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;
        }
    }
开发者ID:,项目名称:,代码行数:37,代码来源:


注:本文中的PMA_Tracker::enabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。