<?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_instant.php,v 1.8 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
*/
// execute init file
require_once 'inc/init.php';
if($_REQUEST['action'] == 'start'){
// remember the app we want to bundle
$app_settings = $zi_registry->getApplicationSettings($_REQUEST['application_bundle'], $_REQUEST['distribution_bundle']);
$_SESSION['distribution'] = $_REQUEST['distribution_bundle'];
$_SESSION['application'] = $_REQUEST['application_bundle'];
$_SESSION['application_root'] = $app_settings['application_root'];
require_once 'ZZOSS_File/File.php';
$instant_dir = ZZOSS_File::fixPath($zi_setup->getInstallerDataDir().DIRECTORY_SEPARATOR.'instant'.DIRECTORY_SEPARATOR);
/*
// check if instant sources are there or copy them anyway
// if we develop the installer itself
if($GLOBALS['ZI']['installer_dev']){
if(is_dir($instant_dir)){
System::rm(array('-rf', $instant_dir));
}
// copy the installer files for the instant bundle to data directory
require_once 'ZZOSS_Dir/Dir.php';
ZZOSS_Dir::copy(getcwd(), $instant_dir);
if(is_dir($instant_dir.'bundles'.DIRECTORY_SEPARATOR)){
// remove the bundles directory from the instant sources
System::rm(array('-rf', $instant_dir.'bundles'.DIRECTORY_SEPARATOR));
}
}
*/
// change the application root to the instant sources in data directory
$app_settings['application_root'] = $instant_dir;
$zi_registry->updateApplicationSettings($app_settings, $_REQUEST['application'], $_REQUEST['distribution']);
$procedures = array(
'plugins_deps' => 'installed',
'packages_deps' => 'installed',
'packages_build'=> 'on',
'_dest' => 'dev_bundle_instant.php'.zi_form_querystr().'&action=end'
);
$zi_registry->setProcedures($procedures, '', $_REQUEST['application'], $_REQUEST['distribution']);
$redirect = 'application_settings.php'.zi_form_querystr();
//$redirect = 'plugins_process.php'.zi_form_querystr().'&type=package&step=0';
header('Location: '.$redirect);
exit;
}
if($_REQUEST['action'] == 'end'){
// reset app root
$app_settings['application_root'] = $_SESSION['application_root'];
$zi_registry->updateApplicationSettings($app_settings);
$_REQUEST['distribution'] = $_SESSION['distribution'];
$_REQUEST['application'] = $_SESSION['application'];
$_REQUEST['mode'] = 'dev';
unset($_SESSION['distribution']);
unset($_SESSION['application']);
unset($_SESSION['application_root']);
header('Location: dev_bundle.php'.zi_form_querystr());
exit;
}
?>