本文整理汇总了PHP中PMA_Tracker::createVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP PMA_Tracker::createVersion方法的具体用法?PHP PMA_Tracker::createVersion怎么用?PHP PMA_Tracker::createVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PMA_Tracker
的用法示例。
在下文中一共展示了PMA_Tracker::createVersion方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rtrim
$tracking_set .= 'DROP INDEX,';
}
if ($_REQUEST['insert'] == true) {
$tracking_set .= 'INSERT,';
}
if ($_REQUEST['update'] == true) {
$tracking_set .= 'UPDATE,';
}
if ($_REQUEST['delete'] == true) {
$tracking_set .= 'DELETE,';
}
if ($_REQUEST['truncate'] == true) {
$tracking_set .= 'TRUNCATE,';
}
$tracking_set = rtrim($tracking_set, ',');
if (PMA_Tracker::createVersion($GLOBALS['db'], $GLOBALS['table'], $_REQUEST['version'], $tracking_set)) {
$msg = PMA_Message::success(sprintf($strTrackingVersionCreated, $_REQUEST['version'], $GLOBALS['db'], $GLOBALS['table']));
$msg->display();
}
}
// Deactivate tracking
if (isset($_REQUEST['submit_deactivate_now'])) {
if (PMA_Tracker::deactivateTracking($GLOBALS['db'], $GLOBALS['table'], $_REQUEST['version'])) {
$msg = PMA_Message::success(sprintf($strTrackingVersionDeactivated, $GLOBALS['db'], $GLOBALS['table'], $_REQUEST['version']));
$msg->display();
}
}
// Activate tracking
if (isset($_REQUEST['submit_activate_now'])) {
if (PMA_Tracker::activateTracking($GLOBALS['db'], $GLOBALS['table'], $_REQUEST['version'])) {
$msg = PMA_Message::success(sprintf($strTrackingVersionActivated, $GLOBALS['db'], $GLOBALS['table'], $_REQUEST['version']));
示例2: testCreateVersion
//.........这里部分代码省略.........
'Key' => 'PRI'
),
array(
'Field' => 'field2',
'Type' => 'text',
'Key' => ''
)
);
$dbi->expects($this->once())->method('getColumns')
->with('pma_test', 'pma_tbl')
->will($this->returnValue($getColumnsResult));
$getIndexesResult = array(
array(
'Table' => 'pma_tbl',
'Field' => 'field1',
'Key' => 'PRIMARY'
)
);
$dbi->expects($this->once())->method('getTableIndexes')
->with('pma_test', 'pma_tbl')
->will($this->returnValue($getIndexesResult));
$tableStatusArray = array(
array(
'Name' => 'pma_tbl',
'Rows' => '1',
'Create_time' => '2013-02-22 02:04:04',
'Update_time' => '2013-02-22 21:46:48'
)
);
$dbi->expects($this->any())->method('tryQuery')
->with($this->equalTo("SHOW CREATE TABLE `pma_test`.`pma_tbl`"))
->will(
$this->returnValue(
"CREATE TABLE `pma_test`.`pma_tbl` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` text NOT NULL
)"
)
);
$date = date('Y-m-d H:i:s');
$expectedMainQuery = "/*NOTRACK*/" .
"\nINSERT INTO. (db_name, table_name, version, date_created, date_updated," .
" schema_snapshot, schema_sql, data_sql, tracking ) values (
'pma_test',
'pma_tbl',
'1',
'". $date ."',
'". $date ."',
'a:2:{s:7:\"COLUMNS\";a:2:{".
"i:0;a:3:{s:5:\"Field\";s:6:\"field1\";s:4:\"Type\";s:7:\"int(11)\";" .
"s:3:\"Key\";s:3:\"PRI\";}" .
"i:1;a:3:{s:5:\"Field\";s:6:\"field2\";s:4:\"Type\";s:4:\"text\";" .
"s:3:\"Key\";s:0:\"\";}}" .
"s:7:\"INDEXES\";a:1:{" .
"i:0;a:3:{s:5:\"Table\";s:7:\"pma_tbl\";s:5:\"Field\";s:6:\"field1\";" .
"s:3:\"Key\";s:7:\"PRIMARY\";}}}',
'# log ". $date ." pma_test_user" .
"\nDROP VIEW IF EXISTS `pma_tbl`;" .
"\n# log ". $date ." pma_test_user" .
"\n\n;" .
"\n',
'" .
"\n',
'11' )";
$GLOBALS['controllink'] = null;
$queryResults = array(
array(
"SHOW TABLE STATUS FROM `pma_test` LIKE 'pma_tbl'",
null,
1,
true,
$tableStatusArray
),
array(
$expectedMainQuery,
null,
0,
false,
'executed'
)
);
$dbi->expects($this->any())->method('query')
->will($this->returnValueMap($queryResults));
$GLOBALS['dbi'] = $dbi;
$this->assertEquals(
'executed',
PMA_Tracker::createVersion('pma_test', 'pma_tbl', '1', '11', true)
);
tearDownForTestsUsingDate();
}
示例3: PMA_createTrackingVersion
/**
* Function to create the tracking version
*
* @return void
*/
function PMA_createTrackingVersion()
{
$tracking_set = PMA_getTrackingSet();
$versionCreated = PMA_Tracker::createVersion($GLOBALS['db'], $GLOBALS['table'], $_REQUEST['version'], $tracking_set, PMA_Table::isView($GLOBALS['db'], $GLOBALS['table']));
if ($versionCreated) {
$msg = PMA_Message::success(sprintf(__('Version %1$s was created, tracking for %2$s is active.'), htmlspecialchars($_REQUEST['version']), htmlspecialchars($GLOBALS['db'] . '.' . $GLOBALS['table'])));
$msg->display();
}
}
示例4: PMA_createTrackingForMultipleTables
/**
* Create tracking version for multiple tables
*
* @param array $selected list of selected tables
*
* @return void
*/
function PMA_createTrackingForMultipleTables($selected)
{
$tracking_set = PMA_getTrackingSet();
foreach ($selected as $selected_table) {
PMA_Tracker::createVersion($GLOBALS['db'], $selected_table, $_REQUEST['version'], $tracking_set, PMA_Table::isView($GLOBALS['db'], $selected_table));
}
}
示例5: rtrim
$tracking_set .= 'DROP INDEX,';
}
if ($_REQUEST['insert'] == true) {
$tracking_set .= 'INSERT,';
}
if ($_REQUEST['update'] == true) {
$tracking_set .= 'UPDATE,';
}
if ($_REQUEST['delete'] == true) {
$tracking_set .= 'DELETE,';
}
if ($_REQUEST['truncate'] == true) {
$tracking_set .= 'TRUNCATE,';
}
$tracking_set = rtrim($tracking_set, ',');
$versionCreated = PMA_Tracker::createVersion($GLOBALS['db'], $GLOBALS['table'], $_REQUEST['version'], $tracking_set, PMA_Table::isView($GLOBALS['db'], $GLOBALS['table']));
if ($versionCreated) {
$msg = PMA_Message::success(sprintf(__('Version %1$s was created, tracking for %2$s is active.'), htmlspecialchars($_REQUEST['version']), htmlspecialchars($GLOBALS['db'] . '.' . $GLOBALS['table'])));
$msg->display();
}
}
// Deactivate tracking
if (isset($_REQUEST['submit_deactivate_now'])) {
$deactivated = PMA_Tracker::deactivateTracking($GLOBALS['db'], $GLOBALS['table'], $_REQUEST['version']);
if ($deactivated) {
$msg = PMA_Message::success(sprintf(__('Tracking for %1$s was deactivated at version %2$s.'), htmlspecialchars($GLOBALS['db'] . '.' . $GLOBALS['table']), htmlspecialchars($_REQUEST['version'])));
$msg->display();
}
}
// Activate tracking
if (isset($_REQUEST['submit_activate_now'])) {