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


PHP PMA_verifyWhetherValueCanBeTruncatedAndAppendExtraData函數代碼示例

本文整理匯總了PHP中PMA_verifyWhetherValueCanBeTruncatedAndAppendExtraData函數的典型用法代碼示例。如果您正苦於以下問題:PHP PMA_verifyWhetherValueCanBeTruncatedAndAppendExtraData函數的具體用法?PHP PMA_verifyWhetherValueCanBeTruncatedAndAppendExtraData怎麽用?PHP PMA_verifyWhetherValueCanBeTruncatedAndAppendExtraData使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了PMA_verifyWhetherValueCanBeTruncatedAndAppendExtraData函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

            $extra_data = array();
        }
        $transformation_types = array("input_transformation", "transformation");
        foreach ($mime_map as $transformation) {
            $column_name = $transformation['column_name'];
            foreach ($transformation_types as $type) {
                $file = PMA_securePath($transformation[$type]);
                $extra_data = PMA_transformEditedValues($db, $table, $transformation, $edited_values, $file, $column_name, $extra_data, $type);
            }
        }
        // end of loop for each $mime_map
    }
    // Need to check the inline edited value can be truncated by MySQL
    // without informing while saving
    $column_name = $_REQUEST['fields_name']['multi_edit'][0][0];
    PMA_verifyWhetherValueCanBeTruncatedAndAppendExtraData($db, $table, $column_name, $extra_data);
    /**Get the total row count of the table*/
    $_table = new PMA_Table($_REQUEST['table'], $_REQUEST['db']);
    $extra_data['row_count'] = $_table->countRecords();
    $extra_data['sql_query'] = PMA_Util::getMessage($message, $GLOBALS['display_query']);
    $response = PMA_Response::getInstance();
    $response->isSuccess($message->isSuccess());
    $response->addJSON('message', $message);
    $response->addJSON($extra_data);
    exit;
}
if (!empty($return_to_sql_query)) {
    $disp_query = $GLOBALS['sql_query'];
    $disp_message = $message;
    unset($message);
    $GLOBALS['sql_query'] = $return_to_sql_query;
開發者ID:altesien,項目名稱:FinalProject,代碼行數:31,代碼來源:tbl_replace.php

示例2: testVerifyWhetherValueCanBeTruncatedAndAppendExtraData

 /**
  * Test for PMA_verifyWhetherValueCanBeTruncatedAndAppendExtraData
  *
  * @return void
  */
 public function testVerifyWhetherValueCanBeTruncatedAndAppendExtraData()
 {
     $extra_data = array('isNeedToRecheck' => true);
     $meta = new stdClass();
     $_REQUEST['where_clause'][0] = 1;
     $dbi = $this->getMockBuilder('PMA_DatabaseInterface')->disableOriginalConstructor()->getMock();
     $dbi->expects($this->at(0))->method('tryQuery')->with('SELECT `table`.`a` FROM `db`.`table` WHERE 1');
     $meta->type = 'int';
     $dbi->expects($this->at(1))->method('getFieldsMeta')->will($this->returnValue(array($meta)));
     $dbi->expects($this->at(2))->method('fetchValue')->will($this->returnValue(false));
     $dbi->expects($this->at(3))->method('tryQuery')->with('SELECT `table`.`a` FROM `db`.`table` WHERE 1');
     $meta->type = 'int';
     $dbi->expects($this->at(4))->method('getFieldsMeta')->will($this->returnValue(array($meta)));
     $dbi->expects($this->at(5))->method('fetchValue')->will($this->returnValue('123'));
     $dbi->expects($this->at(6))->method('tryQuery')->with('SELECT `table`.`a` FROM `db`.`table` WHERE 1');
     $meta->type = 'timestamp';
     $dbi->expects($this->at(7))->method('getFieldsMeta')->will($this->returnValue(array($meta)));
     $dbi->expects($this->at(8))->method('fetchValue')->will($this->returnValue('2013-08-28 06:34:14'));
     $GLOBALS['dbi'] = $dbi;
     PMA_verifyWhetherValueCanBeTruncatedAndAppendExtraData('db', 'table', 'a', $extra_data);
     $this->assertFalse($extra_data['isNeedToRecheck']);
     PMA_verifyWhetherValueCanBeTruncatedAndAppendExtraData('db', 'table', 'a', $extra_data);
     $this->assertEquals('123', $extra_data['truncatableFieldValue']);
     $this->assertTrue($extra_data['isNeedToRecheck']);
     PMA_verifyWhetherValueCanBeTruncatedAndAppendExtraData('db', 'table', 'a', $extra_data);
     $this->assertEquals('2013-08-28 06:34:14.000000', $extra_data['truncatableFieldValue']);
     $this->assertTrue($extra_data['isNeedToRecheck']);
 }
開發者ID:kfjihailong,項目名稱:phpMyAdmin,代碼行數:33,代碼來源:PMA_insert_edit_test.php


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