本文整理汇总了PHP中PMA_Tracker::deleteTracking方法的典型用法代码示例。如果您正苦于以下问题:PHP PMA_Tracker::deleteTracking方法的具体用法?PHP PMA_Tracker::deleteTracking怎么用?PHP PMA_Tracker::deleteTracking使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PMA_Tracker
的用法示例。
在下文中一共展示了PMA_Tracker::deleteTracking方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testDeleteTracking
/**
* Test for PMA_Tracker::deleteTracking()
*
* @return void
* @test
*/
public function testDeleteTracking()
{
$dbi = $this->getMockBuilder('PMA_DatabaseInterface')
->disableOriginalConstructor()
->getMock();
$sql_query = "/*NOTRACK*/\n"
. "DELETE FROM pma_table_tracking"
. " WHERE `db_name` = 'testdb'"
. " AND `table_name` = 'testtable'";
$reflection = new \ReflectionProperty('PMA_Tracker', 'pma_table');
$reflection->setAccessible(true);
$reflection->setValue(null, 'pma_table_tracking');
$dbi->expects($this->exactly(1))
->method('query')
->with($sql_query)
->will($this->returnValue('executed'));
$GLOBALS['dbi'] = $dbi;
$this->assertEquals(
PMA_Tracker::deleteTracking("testdb", "testtable"),
'executed'
);
}
示例2:
$response = PMA_Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('db_structure.js');
/**
* If we are not in an Ajax request, then do the common work and show the links etc.
*/
require 'libraries/db_common.inc.php';
$url_query .= '&goto=tbl_tracking.php&back=db_tracking.php';
// Get the database structure
$sub_part = '_structure';
require 'libraries/db_info.inc.php';
// Work to do?
// (here, do not use $_REQUEST['db] as it can be crafted)
if (isset($_REQUEST['delete_tracking']) && isset($_REQUEST['table'])) {
PMA_Tracker::deleteTracking($GLOBALS['db'], $_REQUEST['table']);
/**
* If in an Ajax request, generate the success message and use
* {@link PMA_Response()} to send the output
*/
if ($GLOBALS['is_ajax_request'] == true) {
$response = PMA_Response::getInstance();
$response->addJSON('message', PMA_Message::success());
exit;
}
}
// Get tracked data about the database
$data = PMA_Tracker::getTrackedData($_REQUEST['db'], '', '1');
// No tables present and no log exist
if ($num_tables == 0 && count($data['ddlog']) == 0) {
echo '<p>' . __('No tables found in database.') . '</p>' . "\n";
示例3: PMA_deleteTrackingVersion
/**
* Deletes a tracking version
*
* @param string $version tracking version
*
* @return string HTML of the success message
*/
function PMA_deleteTrackingVersion($version)
{
$html = '';
$versionDeleted = PMA_Tracker::deleteTracking($GLOBALS['db'], $GLOBALS['table'], $version);
if ($versionDeleted) {
$msg = PMA_Message::success(sprintf(__('Version %1$s of %2$s was deleted.'), htmlspecialchars($version), htmlspecialchars($GLOBALS['db'] . '.' . $GLOBALS['table'])));
$html .= $msg->getDisplay();
}
return $html;
}
示例4: elseif
// Get the database structure
$sub_part = '_structure';
require 'libraries/db_info.inc.php';
// Work to do?
// (here, do not use $_REQUEST['db] as it can be crafted)
if (isset($_REQUEST['delete_tracking']) && isset($_REQUEST['table'])) {
PMA_Tracker::deleteTracking($GLOBALS['db'], $_REQUEST['table']);
PMA_Message::success(__('Tracking data deleted successfully.'))->display();
} elseif (isset($_REQUEST['submit_create_version'])) {
PMA_createTrackingForMultipleTables($_REQUEST['selected']);
PMA_Message::success(sprintf(__('Version %1$s was created for selected tables,' . ' tracking is active for them.'), htmlspecialchars($_REQUEST['version'])))->display();
} elseif (isset($_REQUEST['submit_mult'])) {
if (!empty($_REQUEST['selected_tbl'])) {
if ($_REQUEST['submit_mult'] == 'delete_tracking') {
foreach ($_REQUEST['selected_tbl'] as $table) {
PMA_Tracker::deleteTracking($GLOBALS['db'], $table);
}
PMA_Message::success(__('Tracking data deleted successfully.'))->display();
} elseif ($_REQUEST['submit_mult'] == 'track') {
echo PMA_getHtmlForDataDefinitionAndManipulationStatements('db_tracking.php' . $url_query, 0, $GLOBALS['db'], $_REQUEST['selected_tbl']);
exit;
}
} else {
PMA_Message::notice(__('No tables selected.'))->display();
}
}
// Get tracked data about the database
$data = PMA_Tracker::getTrackedData($_REQUEST['db'], '', '1');
// No tables present and no log exist
if ($num_tables == 0 && count($data['ddlog']) == 0) {
echo '<p>' . __('No tables found in database.') . '</p>' . "\n";