本文整理汇总了PHP中PMA_download_header函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_download_header函数的具体用法?PHP PMA_download_header怎么用?PHP PMA_download_header使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_download_header函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: str_replace
// For re-usability, moved http-headers and stylesheets
// to a seperate file. It can now be included by libraries/header.inc.php,
// querywindow.php.
require_once './libraries/header_http.inc.php';
// [MIME]
if (isset($ct) && !empty($ct)) {
$mime_type = $ct;
} else {
$mime_type = (isset($mime_map[$transform_key]['mimetype'])
? str_replace('_', '/', $mime_map[$transform_key]['mimetype'])
: $default_ct)
. (isset($mime_options['charset']) ? $mime_options['charset'] : '');
}
PMA_download_header($cn, $mime_type);
if (! isset($resize)) {
echo $row[$transform_key];
} else {
// if image_*__inline.inc.php finds that we can resize,
// it sets $resize to jpeg or png
$srcImage = imagecreatefromstring($row[$transform_key]);
$srcWidth = ImageSX($srcImage);
$srcHeight = ImageSY($srcImage);
// Check to see if the width > height or if width < height
// if so adjust accordingly to make sure the image
// stays smaller then the $newWidth and $newHeight
示例2: _toFile
/**
* Handles common tasks of writing the visualization to file for various formats.
*
* @param string $file_name file name
* @param string $type mime type
* @param string $ext extension of the file
*
* @return nothing
*/
private function _toFile($file_name, $type, $ext)
{
$file_name = $this->_sanitizeName($file_name, $ext);
ob_clean();
PMA_download_header($file_name, $type);
}
示例3: showOutput
/**
* Output EPS Document for download
*
* @param string $fileName name of the eps document
*
* @return void
*
* @access public
*/
function showOutput($fileName)
{
// if(ob_get_clean()){
//ob_end_clean();
//}
$output = $this->stringCommands;
PMA_download_header($fileName . '.eps', 'image/x-eps', strlen($output));
print $output;
}
示例4: foreach
'uri' => $GLOBALS['PMA_Config']->get('PmaAbsoluteUri'),
'status' => 'yes',
'location' => 'no',
'sidebar' => 'no',
'navigation' => 'no',
'icon' => 'phpMyAdmin',
);
// dom sript file
// none need yet
// icon
$icon = 'favicon.ico';
// name
$name = 'phpMyAdmin.webapp';
$ini_file = "[Parameters]\n";
foreach ($parameters as $key => $value) {
$ini_file .= $key . '=' . $value . "\n";
}
PMA_download_header($name, 'application/webapp', 0, false);
$zip = new zipfile;
$zip->setDoWrite();
$zip->addFile($ini_file, 'webapp.ini');
$zip->addFile(file_get_contents($icon), 'phpMyAdmin.ico');
$zip->file();
?>
示例5: substr
} else {
/* Filename from request should be safe here */
$filename = $_REQUEST['filename'];
}
/* Decode data */
if ($extension != 'svg') {
$data = substr($_REQUEST['image'], strpos($_REQUEST['image'], ',') + 1);
$data = base64_decode($data);
} else {
$data = $_REQUEST['image'];
}
/* Send download header */
PMA_download_header($filename, $_REQUEST['type'], strlen($data));
/* Send data */
echo $data;
/* For monitor chart config export */
} else {
if (isset($_REQUEST['monitorconfig'])) {
PMA_download_header('monitor.cfg', 'application/force-download');
echo urldecode($_REQUEST['monitorconfig']);
/* For monitor chart config import */
} else {
if (isset($_REQUEST['import'])) {
header('Content-type: text/plain');
if (!file_exists($_FILES['file']['tmp_name'])) {
exit;
}
echo file_get_contents($_FILES['file']['tmp_name']);
}
}
}
示例6: showOutput
/**
* Output Visio XML .VDX Document for download
*
* @param string $fileName name of the Visio XML document
*
* @return void
* @access public
* @see XMLWriter::flush()
*/
function showOutput($fileName)
{
//if(ob_get_clean()){
//ob_end_clean();
//}
$output = $this->flush();
PMA_download_header($fileName . '.vdx', 'application/visio', strlen($output));
print $output;
}
示例7: PMA_userprefs_pageinit
* Gets some core libraries and displays a top message if required
*/
require_once './libraries/common.inc.php';
require_once './libraries/user_preferences.lib.php';
require_once './libraries/config/config_functions.lib.php';
require_once './libraries/config/messages.inc.php';
require_once './libraries/config/ConfigFile.class.php';
require_once './libraries/config/Form.class.php';
require_once './libraries/config/FormDisplay.class.php';
require './libraries/config/user_preferences.forms.php';
PMA_userprefs_pageinit();
$error = '';
if (isset($_POST['submit_export']) && filter_input(INPUT_POST, 'export_type') == 'text_file') {
// export to JSON file
$filename = 'phpMyAdmin-config-' . urlencode(PMA_getenv('HTTP_HOST')) . '.json';
PMA_download_header($filename, 'application/json');
$settings = PMA_load_userprefs();
echo json_encode($settings['config_data']);
return;
} else {
if (isset($_POST['submit_get_json'])) {
$settings = PMA_load_userprefs();
header('Content-Type: application/json');
echo json_encode(array('prefs' => json_encode($settings['config_data']), 'mtime' => $settings['mtime']));
return;
} else {
if (isset($_POST['submit_import'])) {
// load from JSON file
$json = '';
if (filter_input(INPUT_POST, 'import_type') == 'text_file' && isset($_FILES['import_file']) && $_FILES['import_file']['error'] == UPLOAD_ERR_OK && is_uploaded_file($_FILES['import_file']['tmp_name'])) {
// read JSON from uploaded file
示例8: PMA_mysqlDie
PMA_mysqlDie(
sprintf(__('\'%s\' database does not exist.'), htmlspecialchars($db)),
'', ''
);
}
/* Check if table exists */
if (!PMA_DBI_get_columns($db, $table)) {
PMA_mysqlDie(__('Invalid table name'));
}
/* Grab data */
$sql = 'SELECT ' . PMA_backquote($transform_key) . ' FROM ' . PMA_backquote($table) . ' WHERE ' . $where_clause . ';';
$result = PMA_DBI_fetch_value($sql);
/* Check return code */
if ($result === false) {
PMA_mysqlDie(__('MySQL returned an empty result set (i.e. zero rows).'), $sql);
}
/* Avoid corrupting data */
@ini_set('url_rewriter.tags', '');
PMA_download_header(
$table . '-' . $transform_key . '.bin',
PMA_detectMIME($result),
strlen($result)
);
echo $result;
?>
示例9: showOutput
/**
* output Svg Document
*
* svg document prompted to the user for download
* Svg document saved in .svg extension and can be
* easily changeable by using any svg IDE
*
* @param string $fileName file name
*
* @return void
* @access public
* @see XMLWriter::startElement(),XMLWriter::writeAttribute()
*/
function showOutput($fileName)
{
//ob_get_clean();
$output = $this->flush();
PMA_download_header($fileName . '.svg', 'image/svg+xml', strlen($output));
print $output;
}
示例10: sprintf
}
// Export as file download
if (isset($_REQUEST['report_export']) && $_REQUEST['export_type'] == 'sqldumpfile') {
@ini_set('url_rewriter.tags', '');
$dump = "# " . sprintf(
__('Tracking report for table `%s`'), htmlspecialchars($_REQUEST['table'])
)
. "\n" . "# " . date('Y-m-d H:i:s') . "\n";
foreach ($entries as $entry) {
$dump .= $entry['statement'];
}
$filename = 'log_' . htmlspecialchars($_REQUEST['table']) . '.sql';
PMA_download_header($filename, 'text/x-sql', strlen($dump));
echo $dump;
exit();
}
/**
* Gets tables informations
*/
echo '<br />';
/**
* Actions
*/
示例11: showOutput
/**
* Output Dia Document for download
*
* @param string $fileName name of the dia document
*
* @return void
* @access public
* @see XMLWriter::flush()
*/
function showOutput($fileName)
{
if (ob_get_clean()) {
ob_end_clean();
}
$output = $this->flush();
PMA_download_header($fileName . '.dia', 'application/x-dia-diagram', strlen($output));
print $output;
}
示例12: preg_replace
* this code sems to support only few MIME types (check
* function PMA_BS_CreateReferenceLink in libraries/blobstreaming.lib.php).
*/
$c_type = preg_replace('/[^A-Za-z0-9/_-]/', '_', $_REQUEST['c_type']);
// Get the blob streaming URL
$filename = PMA_BS_getURL($reference);
if (empty($filename)) {
die(__('No blob streaming server configured!'));
}
$hdrs = get_headers($filename, 1);
if ($hdrs === false) {
die(__('Failed to fetch headers'));
}
$fHnd = fopen($filename, "rb");
if ($fHnd === false) {
die(__('Failed to open remote URL'));
}
$f_size = $hdrs['Content-Length'];
PMA_download_header(basename($filename), $c_type, $f_size);
$pos = 0;
$content = "";
while (!feof($fHnd)) {
$content .= fread($fHnd, $f_size);
$pos = strlen($content);
if ($pos >= $f_size) {
break;
}
}
echo $content;
flush();
fclose($fHnd);