Location: PHPKode > projects > ZZ/OSS Installer > zic-1.1.0dev1/installer/plugins_process.php
<?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: plugins_process.php,v 1.12 2004/04/07 14:21:54 ordnas Exp $
    @copyright Copyright &copy; 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';
    
    $pkg_type = 'package';
    if(isset($_REQUEST['type'])){
        $pkg_type = $_REQUEST['type'];
    }
    $zi_registry->setPackageType($pkg_type);
    
    $zi_registry->registerPackages();
    
    $step = $_REQUEST["step"];
    
    // check if this script is part of installation procedure
    if(!$zi_registry->isProcedure($pkg_type.'s_build')){
        // by default, no further installation steps are required
        $has_step = false;
        
        // by default, we assume that instllation is done and redirect
        $url_next = 'application_done.php'.zi_form_querystr();
        
        // see if we should process fileroles
        if($zi_registry->isProcedure($pkg_type.'s_fileroles')){
            // check if there's one more step, otherwise installation is done
            $queue = $zi_registry->getPackagesQueue();
            require_once 'ZZOSS_Plugin/Plugin.php';
            $plugin = new ZZOSS_Plugin;
            $plugin->setQueue($queue);
            $step_next = $step + 1;
            if($plugin->isStep($step_next)) {
                $has_step = true;
                $url_next = 'packages_process.php'.zi_form_querystr().'&step='.$step_next;
            }
        }
        
        // If there's no more step, and we process plugins, then
        // go on and process packages.
        if(!$has_step && $pkg_type == 'plugin'){
            $_REQUEST['type'] = 'package';
            $url_next = 'packages_reset.php'.zi_form_querystr();
        }
        
        if(!$has_step){
            // clean up packages registry
            $zi_registry->unsetPackages();
            if($pkg_type == 'package'){
                $zi_registry->unsetPackagesQueue();
                $zi_registry->setPackageType('plugin');
                $zi_registry->unsetPackagesQueue();
            }
        }
        
        header('Location: '.$url_next);
        exit;
    }
    
    // Redirect to plugins Runtime Environment
    $url_next = 'plugins_re.php'.zi_form_querystr().'&re_type=build&step='.$step;
	header('Location: '.$url_next);
	exit;
?>
Return current item: ZZ/OSS Installer