没有找到配置可以限制,修改文件ExportController.php
里面添加一个检测数据大小方法checkSize
文件位置:phpMyAdmin\libraries\classes\Controllers\Export\ExportController.php
在主要查询计算导出数据大小代码如下
public function checkSize($limit=3){
//echo '<pre>';print_r($GLOBALS);die;
$export_type = $GLOBALS['_POST']['export_type'];
$sql = '';
if(!($GLOBALS['_POST']['what']=='sql' && $GLOBALS['_POST']['sql_structure_or_data']=='structure')){//只导出结构不限制
if($export_type=='table'){
if(empty($GLOBALS['_POST']['sql_query'])&& !empty($GLOBALS['_POST']['db']) && !empty($GLOBALS['_POST']['table'])){
$sql = 'select round(sum(data_length/1024/1024),2) as data from information_schema.tables where table_schema=\''.$GLOBALS['dbi']->escapeString($GLOBALS['_POST']['db']).'\' and table_name=\''.$GLOBALS['dbi']->escapeString($GLOBALS['_POST']['table']).'\'';
}
}elseif($export_type=='database'){
if( !empty($GLOBALS['_POST']['db']) && !empty($GLOBALS['_POST']['table_select'])){
$sql = 'select round(sum(data_length/1024/1024),2) as data from information_schema.tables where table_schema=\''.$GLOBALS['dbi']->escapeString($GLOBALS['_POST']['db']).'\' and table_name in(\''.implode('\',\'',$GLOBALS['_POST']['table_select']).'\')';
}
}elseif ($export_type==='server'){
$sql = 'select round(sum(data_length/1024/1024),2) as data from information_schema.tables';
}
if($sql!==''){
$res = $GLOBALS['dbi']->fetchResult($sql);
if($res[0]>$limit){
Core::fatalError(__('数据'.$res[0].'M超过限制'.$limit.'M,请使用命令导出'));
}
}
}
}
说明-$limit要是用了配置文件可以放进配置文件中,方便修改
在上面__invoke(ServerRequest $request) 方法里面调用 $this->checkSize();
限制效果