Location: PHPKode > projects > ZZ/OSS Installer > zic-1.1.0dev1/installer/dev_package_xml.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: dev_package_xml.php,v 1.5 2004/03/18 09:41:39 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';
    
    include 'themes/'.$GLOBALS['ZI']['theme'].'/header.php';
    ?>
    <h1>Create package.xml</h1>

    <?php
    if(!isset($_REQUEST['ZI_VALUES']) || !is_array($_REQUEST['ZI_VALUES'])){
        $_REQUEST['ZI_VALUES']['filter_dirs'] = 'CVS';
        $_REQUEST['ZI_VALUES']['filter_files'] = '/[~#]$/i';
    } else {
        $filter_dirs = explode(',',$_REQUEST['ZI_VALUES']['filter_dirs']);
        // TODO: .bak
        $filter_files = $_REQUEST['ZI_VALUES']['filter_files'];
        
        // Create tar file list.
        require_once 'ZZOSS_File/Find.php';
        $zi_filefind = new ZZOSS_FileFind;
        $zi_filefind->setFilterDirs($filter_dirs);
        $zi_filefind->setFilterFiles($filter_files);
        
        $files = $zi_filefind->listFiles($_REQUEST['ZI_VALUES']['dir']);
        
        if(count($files)){
            $filelist = "<filelist>\n";
            foreach($files as $file){
                $filelist .= "    <file role=\"php\" baseinstalldir=\"\" name=\"$file\"/>\n";
            }
            $filelist .= "</filelist>\n";
            echo '<textarea cols="60" rows="15" wrap="off">'.$filelist."</textarea>";
        } else {
            echo '<pre>No files in directory.</pre>';
        }
        
    }
    
    // installer widget class
	require_once 'ZZOSS_Installer/Widget.php';
	$zi_widget = new ZZOSS_InstallerWidget;
	if(isset($zi_errors)){
        $zi_widget->setErrors($zi_errors);
    }
    ?>
    <table class="form">
        <tr>
            <th colspan="3">Compose Filelist</th>
        </tr>
    <?php
    echo $zi_widget->add('path', 'Path to package files', 'dir');
    echo $zi_widget->add('path', 'Omit directories', 'filter_dirs');
    echo $zi_widget->add('path', 'Omit files', 'filter_files');
    ?>
    </table>
    <?php
    $zi_buttons['back'] = 'dev_package.php'.zi_form_querystr();
    $zi_buttons['next'] = '';
	include 'themes/'.$GLOBALS['ZI']['theme'].'/footer.php';
?>
Return current item: ZZ/OSS Installer