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


PHP PMA_filterTracking函数代码示例

本文整理汇总了PHP中PMA_filterTracking函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_filterTracking函数的具体用法?PHP PMA_filterTracking怎么用?PHP PMA_filterTracking使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了PMA_filterTracking函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testPMAFilterTracking

 /**
  * Tests for PMA_filterTracking() method.
  *
  * @return void
  * @test
  */
 public function testPMAFilterTracking()
 {
     $data = array(array("date" => "20120102", "username" => "username1", "statement" => "statement1"), array("date" => "20130102", "username" => "username2", "statement" => "statement2"));
     $filter_ts_from = 0;
     $filter_ts_to = 999999999999;
     $filter_users = array("username1");
     $ret = PMA_filterTracking($data, $filter_ts_from, $filter_ts_to, $filter_users);
     $this->assertEquals('username1', $ret[0]['username']);
     $this->assertEquals('statement1', $ret[0]['statement']);
 }
开发者ID:xtreme-jamil-shamy,项目名称:phpmyadmin-cf,代码行数:16,代码来源:PMA_tbl_tracking_test.php

示例2: PMA_getEntries

/**
 * Function to get the entries
 *
 * @param array $data           data
 * @param int   $filter_ts_from filter time stamp from
 * @param int   $filter_ts_to   filter time stamp to
 * @param array $filter_users   filter users
 *
 * @return array
 */
function PMA_getEntries($data, $filter_ts_from, $filter_ts_to, $filter_users)
{
    $entries = array();
    // Filtering data definition statements
    if ($_REQUEST['logtype'] == 'schema' || $_REQUEST['logtype'] == 'schema_and_data') {
        $entries = array_merge($entries, PMA_filterTracking($data['ddlog'], $filter_ts_from, $filter_ts_to, $filter_users));
    }
    // Filtering data manipulation statements
    if ($_REQUEST['logtype'] == 'data' || $_REQUEST['logtype'] == 'schema_and_data') {
        $entries = array_merge($entries, PMA_filterTracking($data['dmlog'], $filter_ts_from, $filter_ts_to, $filter_users));
    }
    // Sort it
    $ids = $timestamps = $usernames = $statements = array();
    foreach ($entries as $key => $row) {
        $ids[$key] = $row['id'];
        $timestamps[$key] = $row['timestamp'];
        $usernames[$key] = $row['username'];
        $statements[$key] = $row['statement'];
    }
    array_multisort($timestamps, SORT_ASC, $ids, SORT_ASC, $usernames, SORT_ASC, $statements, SORT_ASC, $entries);
    return $entries;
}
开发者ID:saisai,项目名称:phpmyadmin,代码行数:32,代码来源:tracking.lib.php


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