本文整理汇总了PHP中PMA_Tracker::changeTrackingData方法的典型用法代码示例。如果您正苦于以下问题:PHP PMA_Tracker::changeTrackingData方法的具体用法?PHP PMA_Tracker::changeTrackingData怎么用?PHP PMA_Tracker::changeTrackingData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PMA_Tracker
的用法示例。
在下文中一共展示了PMA_Tracker::changeTrackingData方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testChangeTrackingData
/**
* Test for PMA_Tracker::testChangeTrackingData()
*
* @return void
* @test
*/
public function testChangeTrackingData()
{
if (!setupForTestsUsingDate()) {
$this->markTestSkipped("Cannot override internal function date()");
}
$reflection = new \ReflectionProperty('PMA_Tracker', 'pma_table');
$reflection->setAccessible(true);
$reflection->setValue(null, 'pma_table_tracking');
$this->assertFalse(
PMA_Tracker::changeTrackingData("", "", "", "", "")
);
$GLOBALS['controllink'] = null;
$dbi = $this->getMockBuilder('PMA_DatabaseInterface')
->disableOriginalConstructor()
->getMock();
$sql_query_1 = " UPDATE pma_table_tracking" .
" SET `schema_sql` = '# new_data_processed' " .
" WHERE `db_name` = 'pma_db' " .
" AND `table_name` = 'pma_table' " .
" AND `version` = '1.0' ";
$date = date('Y-m-d H:i:s');
$new_data = array(
array(
'username' => 'user1',
'statement' => 'test_statement1'
),
array(
'username' => 'user2',
'statement' => 'test_statement2'
)
);
$sql_query_2 = " UPDATE pma_table_tracking" .
" SET `data_sql` = '# log $date user1test_statement1\n" .
"# log $date user2test_statement2\n' " .
" WHERE `db_name` = 'pma_db' " .
" AND `table_name` = 'pma_table' " .
" AND `version` = '1.0' ";
$dbi->expects($this->at(0))
->method('query')
->with($sql_query_1, null, 0, false)
->will($this->returnValue("executed_1"));
$dbi->expects($this->at(1))
->method('query')
->with($sql_query_2, null, 0, false)
->will($this->returnValue("executed_2"));
$GLOBALS['dbi'] = $dbi;
$this->assertEquals(
'executed_1',
PMA_Tracker::changeTrackingData(
'pma_db',
'pma_table',
'1.0',
'DDL',
"# new_data_processed"
)
);
$this->assertEquals(
'executed_2',
PMA_Tracker::changeTrackingData(
'pma_db',
'pma_table',
'1.0',
'DML',
$new_data
)
);
tearDownForTestsUsingDate();
}
示例2: PMA_deleteFromTrackingReportLog
/**
* Function to delete from a tracking report log
*
* @param array &$data tracked data
* @param string $which_log ddlog|dmlog
* @param string $type DDL|DML
* @param string $message success message
*
* @return string HTML for the message
*/
function PMA_deleteFromTrackingReportLog(&$data, $which_log, $type, $message)
{
$html = '';
$delete_id = $_REQUEST['delete_' . $which_log];
// Only in case of valid id
if ($delete_id == (int) $delete_id) {
unset($data[$which_log][$delete_id]);
$successfullyDeleted = PMA_Tracker::changeTrackingData($_REQUEST['db'], $_REQUEST['table'], $_REQUEST['version'], $type, $data[$which_log]);
if ($successfullyDeleted) {
$msg = PMA_Message::success($message);
} else {
$msg = PMA_Message::rawError(__('Query error'));
}
$html .= $msg->getDisplay();
}
return $html;
}
示例3: unset
}
$msg->display();
}
}
if (isset($_REQUEST['delete_dmlog'])) {
// Delete dmlog row data
$delete_id = $_REQUEST['delete_dmlog'];
// Only in case of valable id
if ($delete_id == (int)$delete_id) {
unset($data['dmlog'][$delete_id]);
$successfullyDeleted = PMA_Tracker::changeTrackingData(
$_REQUEST['db'], $_REQUEST['table'],
$_REQUEST['version'], 'DML', $data['dmlog']
);
if ($successfullyDeleted) {
$msg = PMA_Message::success(
__('Tracking data manipulation successfully deleted')
);
} else {
$msg = PMA_Message::rawError(__('Query error'));
}
$msg->display();
}
}
}
if (isset($_REQUEST['report']) || isset($_REQUEST['report_export'])) {
echo '<h3>' . __('Tracking report')
示例4: PMA_handleDeleteDataManipulationLog
/**
* Function to handle the delete of fmlog rows
*
* @param array &$data tracked data
*
* @return void
*/
function PMA_handleDeleteDataManipulationLog(&$data)
{
$delete_id = $_REQUEST['delete_dmlog'];
// Only in case of valable id
if ($delete_id == (int) $delete_id) {
unset($data['dmlog'][$delete_id]);
$successfullyDeleted = PMA_Tracker::changeTrackingData($_REQUEST['db'], $_REQUEST['table'], $_REQUEST['version'], 'DML', $data['dmlog']);
if ($successfullyDeleted) {
$msg = PMA_Message::success(__('Tracking data manipulation successfully deleted'));
} else {
$msg = PMA_Message::rawError(__('Query error'));
}
$msg->display();
}
}
示例5: unset
unset($data['ddlog'][$delete_id]);
if (PMA_Tracker::changeTrackingData($_REQUEST['db'], $_REQUEST['table'], $_REQUEST['version'], 'DDL', $data['ddlog'])) {
$msg = PMA_Message::success(__('Tracking data definition successfully deleted'));
} else {
$msg = PMA_Message::rawError(__('Query error'));
}
$msg->display();
}
}
if (isset($_REQUEST['delete_dmlog'])) {
// Delete dmlog row data
$delete_id = $_REQUEST['delete_dmlog'];
// Only in case of valable id
if ($delete_id == (int) $delete_id) {
unset($data['dmlog'][$delete_id]);
if (PMA_Tracker::changeTrackingData($_REQUEST['db'], $_REQUEST['table'], $_REQUEST['version'], 'DML', $data['dmlog'])) {
$msg = PMA_Message::success(__('Tracking data manipulation successfully deleted'));
} else {
$msg = PMA_Message::rawError(__('Query error'));
}
$msg->display();
}
}
}
if (isset($_REQUEST['report']) || isset($_REQUEST['report_export'])) {
?>
<h3><?php
echo __('Tracking report');
?>
[<a href="tbl_tracking.php?<?php
echo $url_query;