當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PMA_Tracker::createVersion方法代碼示例

本文整理匯總了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']));
開發者ID:shishenkov,項目名稱:zpanel,代碼行數:31,代碼來源:tbl_tracking.php

示例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();
    }
開發者ID:roccivic,項目名稱:phpmyadmin,代碼行數:101,代碼來源:PMA_Tracker_test.php

示例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();
    }
}
開發者ID:minggLu,項目名稱:openemr,代碼行數:14,代碼來源:tbl_tracking.lib.php

示例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));
    }
}
開發者ID:saisai,項目名稱:phpmyadmin,代碼行數:14,代碼來源:tracking.lib.php

示例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'])) {
開發者ID:lz1988,項目名稱:stourwebcms,代碼行數:31,代碼來源:tbl_tracking.php


注:本文中的PMA_Tracker::createVersion方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。