當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。