Merge branch 'MAINT_3_4_0' into QA_3_4
[phpmyadmin-regexreplace.git] / webapp.php
blob86d6bf1c2f728c7438ef3f3772b4c6e9f9fdeec0
1 <?php
2 /**
3 * generate an WebApp file for Prism / WebRunner
5 * @see http://wiki.mozilla.org/Prism
6 * @package phpMyAdmin
7 */
9 /**
10 * @ignore
12 define('PMA_MINIMUM_COMMON', true);
13 /**
14 * Gets core libraries and defines some variables
16 require './libraries/common.inc.php';
17 /**
18 * ZIP file handler.
20 require './libraries/zip.lib.php';
22 // ini file
23 $parameters = array(
24 'id' => 'phpMyAdmin@' . $_SERVER['HTTP_HOST'],
25 'uri' => $GLOBALS['PMA_Config']->get('PmaAbsoluteUri'),
26 'status' => 'yes',
27 'location' => 'no',
28 'sidebar' => 'no',
29 'navigation' => 'no',
30 'icon' => 'phpMyAdmin',
33 // dom sript file
34 // none need yet
36 // icon
37 $icon = 'favicon.ico';
39 // name
40 $name = 'phpMyAdmin.webapp';
42 $ini_file = "[Parameters]\n";
43 foreach ($parameters as $key => $value) {
44 $ini_file .= $key . '=' . $value . "\n";
47 $zip = new zipfile;
48 $zip->addFile($ini_file, 'webapp.ini');
49 $zip->addFile(file_get_contents($icon), 'phpMyAdmin.ico');
51 header('Content-Type: application/webapp');
52 header('Content-Disposition: attachment; filename="' . $name . '"');
53 echo $zip->file();