just having a backup of the libraries Admin/vendor (angularjs & some libraries) api/system (codeigniter framework libraries) Student/vendor (angularjs & some libraries) api/application/third_party (two heavy useless libraries)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

86 lines
5.3 KiB

<?php
$current_dir = dirname('.');
chdir(dirname(__FILE__));
include_once 'libraries/mha_common.inc.php';
include_once 'libraries/plugin_interface.lib.php';
include_once 'libraries/export.lib.php';
$post_params = ['db','table','what','single_table','export_type','export_method','quick_or_custom','db_select','table_select','table_structure','table_data','limit_to','limit_from','allrows','lock_tables','output_format','filename_template','maxsize','remember_template','charset','compression','as_separate_files','knjenc','xkana','htmlword_structure_or_data','htmlword_null','htmlword_columns','mediawiki_headers','mediawiki_structure_or_data','mediawiki_caption','pdf_structure_or_data','odt_structure_or_data','odt_relation','odt_comments','odt_mime','odt_columns','odt_null','codegen_structure_or_data','codegen_format','excel_null','excel_removeCRLF','excel_columns','excel_edition','excel_structure_or_data','yaml_structure_or_data','ods_null','ods_structure_or_data','ods_columns','json_structure_or_data','json_pretty_print','xml_structure_or_data','xml_export_events','xml_export_functions','xml_export_procedures','xml_export_tables','xml_export_triggers','xml_export_views','xml_export_contents','texytext_structure_or_data','texytext_columns','texytext_null','phparray_structure_or_data','sql_include_comments','sql_header_comment','sql_dates','sql_relation','sql_mime','sql_use_transaction','sql_disable_fk','sql_compatibility','sql_structure_or_data','sql_create_database','sql_drop_table','sql_procedure_function','sql_create_table','sql_create_view','sql_create_trigger','sql_if_not_exists','sql_auto_increment','sql_backquotes','sql_truncate','sql_delayed','sql_ignore','sql_type','sql_insert_syntax','sql_max_query_size','sql_hex_for_binary','sql_utc_time','sql_drop_database','sql_views_as_tables','sql_metadata','csv_separator','csv_enclosed','csv_escaped','csv_terminated','csv_null','csv_removeCRLF','csv_columns','csv_structure_or_data',
// csv_replace should have been here but we use it directly from $_POST
'latex_caption','latex_structure_or_data','latex_structure_caption','latex_structure_continued_caption','latex_structure_label','latex_relation','latex_comments','latex_mime','latex_columns','latex_data_caption','latex_data_continued_caption','latex_data_label','latex_null','aliases'];
foreach ($post_params as $one_post_param) {
if (isset($_POST[$one_post_param])) {
$GLOBALS[$one_post_param] = $_POST[$one_post_param];
}
}
$db=$GLOBALS['db'];
$what = $GLOBALS['what'];
$export_type = $GLOBALS['export_type'];
$table_select=$GLOBALS['table_select'];
$table_structure=$GLOBALS['table_structure'];
$table_data=$GLOBALS['table_data'];
$GLOBALS['buffer_needed'] = true;
$GLOBALS['crlf'] = $crlf = "\n";
$export_plugin = PMA_getPlugin(
"export", $what,
'libraries/plugins/export/', array(
'export_type' => $export_type,
'single_table' => false
)
);
if (isset($_REQUEST['quick_or_custom']) && $_REQUEST['quick_or_custom'] == 'quick') {
$quick_export = true;
} else {
$quick_export = false;
}
$asfile = true;
$err_url = 'db_export.php' . PMA_URL_getCommon(array('db' => $db));
if (isset($table_select)) {
$tables = $table_select;
} else {
$tables = array();
}
$parser = new SqlParser\Parser($sql_query);
$aliases = array();
if ((!empty($parser->statements[0]))
&& ($parser->statements[0] instanceof SqlParser\Statements\SelectStatement)
) {
$aliases = SqlParser\Utils\Misc::getAliases($parser->statements[0], $db);
}
if (!empty($_REQUEST['aliases'])) {
$aliases = PMA_mergeAliases($aliases, $_REQUEST['aliases']);
$_SESSION['tmpval']['aliases'] = $_REQUEST['aliases'];
}
@set_time_limit($cfg['ExecTimeLimit']);
if (! empty($cfg['MemoryLimit'])) {
@ini_set('memory_limit', $cfg['MemoryLimit']);
}
register_shutdown_function('PMA_shutdownDuringExport');
$time_start = time();
$output_kanji_conversion = function_exists('PMA_Kanji_strConv') && $type != 'xls';
$output_charset_conversion = $asfile && $GLOBALS['PMA_recoding_engine'] != PMA_CHARSET_NONE
&& isset($charset) && $charset != 'utf-8' && $type != 'xls';
$GLOBALS['onfly_compression'] = $GLOBALS['cfg']['CompressOnFly'] && $compression == 'gzip';
$do_relation = isset($GLOBALS[$what . '_relation']);
$do_comments = isset($GLOBALS[$what . '_include_comments'])
|| isset($GLOBALS[$what . '_comments']);
$do_mime = isset($GLOBALS[$what . '_mime']);
if ($do_relation || $do_comments || $do_mime) {
$cfgRelation = PMA_getRelationsParam();
}
$do_dates = isset($GLOBALS[$what . '_dates']);
$whatStrucOrData = $GLOBALS[$what . '_structure_or_data'];
PMA_exportDatabase(
$db, $tables, $whatStrucOrData, $table_structure, $table_data,
$export_plugin, $crlf, $err_url, $export_type, $do_relation,
$do_comments, $do_mime, $do_dates, $aliases, $separate_files
);
chdir($current_dir);