<?php
/*
PARAMETERS:
?config=&version=&revision=&os=&pack_type=msi&edition=&rel_type=
*/
$config=$_REQUEST['config'];
$version=$_REQUEST['version'];
$revision=$_REQUEST['revision'];
$os=$_REQUEST['os'];
$pack_type=$_REQUEST['pack_type'];
// lower-case hack to convert Uppercase-edition-inf for ftp-servers
$edition=strtolower($_REQUEST['edition']);
$rel_type=$_REQUEST['rel_type'];

$beta_name='LatestBeta';
$beta_desc='RC';
$beta_ver='5.0.15';
$beta_date='17.03.2008';
$beta_next_rel_date='';
$beta_rel_notes='';
$beta_type='msi';
$beta_auth=0;

$beta_filename='mysql-workbench-' . $edition . '-' . $beta_ver . '-beta-' . 'win32'/*$os*/ . '.' . $pack_type;
$beta_mirror_prefix='http://dev.mysql.com/get/Downloads/MySQLGUITools/' . $beta_filename . '/from/';
$beta_mirror_suffix='Downloads/MySQLGUITools/' . $beta_filename;

$ga_name='LatestGA';
$ga_desc='GA';

// add comment to description for SE versions lacking ssl
$tmp = explode(".", $version);
if ($edition == 'se' && $tmp[0] == 5 && $tmp[1] == 0 && $tmp[2] < 22)
  $ga_desc='GA (your version doesn\'t support ssl, please update using https://enterprise.mysql.com/software/gui_tools.php)';

$ga_ver='5.0.22';
$ga_date='27.05.2008';
$ga_next_rel_date='';
$ga_rel_notes='';
$ga_type='msi';
$ga_auth=0;

$ga_filename='mysql-workbench-' . $edition . '-' . $ga_ver . '-' . 'win32'/*$os*/ . '.' . $pack_type;
$ga_mirror_prefix='http://dev.mysql.com/get/Downloads/MySQLGUITools/' . $ga_filename . '/from/';
$ga_mirror_suffix='Downloads/MySQLGUITools/' . $ga_filename . $pack_type;

print '<?xml version="1.0" encoding="UTF-8"?>';
?>

<LOCAL_VERSION Config="<?php echo $config;?>" Version="<?php echo $version;?>" Revision="<?php echo $revision;?>" OS="<?php echo $os;?>" PackType="<?php echo $pack_type;?>" Edition="<?php echo $edition;?>" RelType="<?php echo $rel_type;?>" />
<?php
/*
Return the only one version of file for now.
Later it's supposed to return different file (by means of file structure version & of edition) based on given parameters,
so oldest versions of application could also update even after significant changes in structure.

Mirror list order is candidate for dynamic generation as well,
since nearest servers to user have to go first.
*/

$specific_script='./versions-' . $edition . '.1.0.php';

require_once $specific_script;
?>
