<?php
/*
Copyright (C) 2001-2004 ZZOSS GbR, http://www.zzoss.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/**
@version $Id: dev_bundle_process.php,v 1.3 2004/04/03 16:15:48 ordnas Exp $
@copyright Copyright © 2001-2004 ZZ/OSS GbR, http://www.zzoss.com
@license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License
*/
require_once 'inc/init.php';
if(isset($_REQUEST['action'])){
$bundle_dir = $zi_registry->getApplicationPath().'downloads'.DIRECTORY_SEPARATOR;
$distri_xml = $zi_registry->getDistributionPath().'distribution.xml';
$app_xml = $zi_registry->getApplicationPath().'application.xml';
$bundle_tgz = '';
switch($_REQUEST['action']){
case 'bundle':
require_once 'ZZOSS_Package/Package.php';
$pkg_obj = new ZZOSS_Package;
$bundle_tgz = $pkg_obj->mkBundle($bundle_dir, $distri_xml, $app_xml);
break;
case 'instant':
// compose instant installer src path
require_once 'ZZOSS_File/File.php';
$instant_dir = ZZOSS_File::fixPath($zi_setup->getInstallerDataDir().DIRECTORY_SEPARATOR.'instant'.DIRECTORY_SEPARATOR);
require_once 'ZZOSS_Package/Package.php';
$pkg_obj = new ZZOSS_Package;
$bundle_tgz = $pkg_obj->mkBundle($bundle_dir, $distri_xml, $app_xml);
$bundles = array($bundle_tgz);
require_once 'ZZOSS_Package/Instant.php';
$pkg_obj = new ZZOSS_PackageInstant;
$bundle_tgz = $pkg_obj->create($_REQUEST['application'], $instant_dir, $bundles);
break;
}
if(strlen($bundle_tgz)){
require_once 'HTTP/Download.php';
$dl = &new HTTP_Download();
$dl->setFile($bundle_tgz);
$dl->setContentDisposition(HTTP_DOWNLOAD_ATTACHMENT, basename($bundle_tgz));
$dl->setContentType('application/octet-stream');
$dl->send();
}
}
?>