[zi-cvs] packages/com.zzoss.zic packages_dependencies.php,1.3,1.4
[email protected] Sun, 11 Jan 2004 08:25:33 -0800
| Newsgroups | gmane.comp.php.zzoss.installer.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/zzossinstaller/packages/com.zzoss.zic
In directory sc8-pr-cvs1:/tmp/cvs-serv6437
Modified Files:
packages_dependencies.php
Log Message:
fixed foreach() for display of needed packages
Index: packages_dependencies.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/packages_dependencies.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** packages_dependencies.php 4 Jan 2004 18:21:32 -0000 1.3
--- packages_dependencies.php 11 Jan 2004 16:25:31 -0000 1.4
***************
*** 1,239 ****
! <?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$
! @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';
!
! /***************************************************************************
! * SCRIPT SPECIFIC FUNCTIONS *
! ***************************************************************************/
!
! function zi_process()
! {
! global $zi_registry;
! $action_deps = $zi_registry->getPackagesActionsDeps();
! $zi_registry->updatePackagesActions($action_deps);
! }
!
! /***************************************************************************
! * STARTUP *
! ***************************************************************************/
!
! // default next link
! $link_next = 'packages_process.php'.zi_form_querystr();
!
! $packages = $zi_registry->getPackages();
! $packages_resolve = $zi_registry->getPackagesResolve();
! $packages_versions = $zi_registry->getPackagesVersions();
! /*
! echo '<h3>Packages Versions</h3>';
! echo '<pre>';
! echo print_r($packages_versions);
! echo '</pre>';
! */
! // load previous selection
! $actions = $zi_registry->getPackagesActions();
! /*
! echo '<h3>Actions</h3>';
! echo '<pre>';
! echo print_r($actions);
! echo '</pre>';
! */
! // main func here
! require_once 'ZZOSS_Package/Dependency.php';
! $zi_deps = new ZZOSS_PackageDependency;
!
! $queue = $zi_deps->run($packages, $packages_resolve, $packages_versions, $actions);
! if($zi_deps->isError()){
! // catch errors
! $error = $zi_deps->getError();
! }
! /*
! echo '<pre>';
! echo '<h3>Queue</h3>';
! echo print_r($queue);
! echo '</pre>';
! */
! /*
! echo '<pre>';
! echo '<h3>Deps By Name</h3>';
! echo print_r($zi_deps->getDepsByName());
! echo '</pre>';
! */
! // save process queue
! $zi_registry->setPackagesQueue($queue);
!
! if(!$zi_deps->isError() && !$zi_deps->hasPendingDeps()) {
! header("Location: ".$link_next);
! exit;
! }
!
!
! /***************************************************************************
! * PAGE CONTENT *
! ***************************************************************************/
!
! include 'themes/'.$GLOBALS['ZI']['theme'].'/header.php';
!
! $application = $zi_registry->getApplication();
! ?>
! <h1>Packages Dependencies</h1>
! <h2><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $_REQUEST['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $_REQUEST['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>', 'Application Information', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2>
! <?php
! if($zi_deps->isError()){
! ?>
! <div class="warning">FATAL ERROR<br/><?php echo $error; ?></div>
! <?php
! }
!
! // Was an error thrown because of packages not defined in the application.xml?
! if($zi_deps->hasUndefinedPackages()){
! $pkgs_pending = $zi_deps->getUndefinedPackages();
! } else {
! $pkgs_pending = $zi_deps->getPending();
! }
! /*
! echo '<pre>';
! echo '<h3>getPending()</h3>';
! echo print_r($pkgs_pending);
! echo '</pre>';
! */
! if(is_array($pkgs_pending) && count($pkgs_pending)){
! /*
! echo '<pre>';
! echo '<h3>getDeps()</h3>';
! echo print_r($zi_deps->getDeps());
! echo '</pre>';
!
! echo '<pre>';
! echo '<h3>getCheckedNames()</h3>';
! echo print_r($zi_deps->getCheckedNames());
! echo '</pre>';
!
! echo '<pre>';
! echo '<h3>getDepsByName()</h3>';
! echo print_r($zi_deps->getDepsByName());
! echo '</pre>';
! */
!
! //zi_show_deps($zi_deps->getDeps(), $queue);
! ?>
! <table class="list">
! <tr>
! <th align="left">Package</th>
! <th align="center">Version</th>
! <th align="center">Needed By</th>
! </tr>
! <?php
! foreach($pkgs_pending as $pkg_name => $pkgs_needed_by){
! if(!$zi_deps->hasUndefinedPackages()){
! $package = $packages[$pkg_name];
! // temporarily assign package action
! $actions_deps[$package['id']] = 'I';
! } else {
! //print_r($pkgs_needed_by);
! $package['name'] = $pkgs_needed_by['name'];
! $package["release"]["version"] = $pkgs_needed_by['version'];
! $pkgs_needed_by = $pkgs_needed_by['needed_by'];
! }
!
! $package_name_full = $package['name'];
! if(strlen($package_name_full) > 32){
! $package_name_short = substr($package_name_full, 0, 29).'...';
! } else {
! $package_name_short = $package_name_full;
! }
! ?>
! <tr>
! <td><?php
! if(!$zi_deps->hasUndefinedPackages()){
! ?>
! <a title="<?php echo $package_name_full.'-'.$package['release']['version']; ?>" href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=package&id=<?php echo $package['id']; ?>&application=<?php echo $_REQUEST['application']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=package&id=<?php echo $package['id']; ?>&application=<?php echo $_REQUEST['application']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>', 'Package Information', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank">
! <?php
! }
!
! echo $package_name_short;
!
! if(!$zi_deps->hasUndefinedPackages()){
! ?></a><br/><?php echo $package['summary'];
! }
! ?>
! </td>
! <td align="center"><?php
! echo $package["release"]["version"];
! if(!$zi_deps->hasUndefinedPackages()){
! echo ' <img src="themes/share/icons/org.kde.icons.crystalsvg/16x16/network.png" align="absmiddle" border="0" alt="remote package" title="Download">';
! }
! ?></td>
! <td align="left"><?php
! $pkgs_needed = $pkgs_needed_by['needed_by'];
! foreach($pkgs_needed as $pkg_needed){
! $package = $packages[key($pkg_needed)];
! $package_name_full = $package['name'];
! if(strlen($package_name_full) > 32){
! $package_name_short = substr($package_name_full, 0, 29).'...';
! } else {
! $package_name_short = $package_name_full;
! }
! ?>
! <a title="<?php echo $package_name_full.'-'.$package['release']['version']; ?>" href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=package&id=<?php echo $package['id']; ?>&application=<?php echo $_REQUEST['application']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=package&id=<?php echo $package['id']; ?>&application=<?php echo $_REQUEST['application']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>', 'Package Information', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank"><?php
! echo $package_name_short.'-'.$package['release']['version']; ?></a><br/></td><?php
! }
! ?>
! </tr>
! <?php
! }
! /*
! echo '<pre>';
! echo '<h3>Actions Deps</h3>';
! echo print_r($actions_deps);
! echo '</pre>';
! */
! ?>
! </table>
! <?php
! }
!
! if(!$zi_deps->isError()){
! // remember new package actions for dependencies
! $zi_registry->setPackagesActionsDeps($actions_deps);
! }
!
! if($error){
! $link_back = 'applications.php';
! } else {
! $link_back = "packages.php";
! if(strlen($_REQUEST["profile"])) {
! $link_back .= zi_form_querystr();
! }
! if(!$zi_deps->hasPendingDeps()) {
! $zi_buttons['next'] = $link_next;
! } else {
! $zi_buttons['ok'] = 'packages_download.php'.zi_form_querystr();
! }
! }
! $zi_buttons['back'] = $link_back;
! include 'themes/'.$GLOBALS['ZI']['theme'].'/footer.php';
?>
--- 1,242 ----
! <?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$
! @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';
!
! /***************************************************************************
! * SCRIPT SPECIFIC FUNCTIONS *
! ***************************************************************************/
!
! function zi_process()
! {
! global $zi_registry;
! $action_deps = $zi_registry->getPackagesActionsDeps();
! $zi_registry->updatePackagesActions($action_deps);
! }
!
! /***************************************************************************
! * STARTUP *
! ***************************************************************************/
!
! // default next link
! $link_next = 'packages_process.php'.zi_form_querystr();
!
! $packages = $zi_registry->getPackages();
! $packages_resolve = $zi_registry->getPackagesResolve();
! $packages_versions = $zi_registry->getPackagesVersions();
! /*
! echo '<h3>Packages Versions</h3>';
! echo '<pre>';
! echo print_r($packages_versions);
! echo '</pre>';
! */
! // load previous selection
! $actions = $zi_registry->getPackagesActions();
! /*
! echo '<h3>Actions</h3>';
! echo '<pre>';
! echo print_r($actions);
! echo '</pre>';
! */
! // main func here
! require_once 'ZZOSS_Package/Dependency.php';
! $zi_deps = new ZZOSS_PackageDependency;
!
! $queue = $zi_deps->run($packages, $packages_resolve, $packages_versions, $actions);
! if($zi_deps->isError()){
! // catch errors
! $error = $zi_deps->getError();
! }
! /*
! echo '<pre>';
! echo '<h3>Queue</h3>';
! echo print_r($queue);
! echo '</pre>';
! */
! /*
! echo '<pre>';
! echo '<h3>Deps By Name</h3>';
! echo print_r($zi_deps->getDepsByName());
! echo '</pre>';
! */
! // save process queue
! $zi_registry->setPackagesQueue($queue);
!
! if(!$zi_deps->isError() && !$zi_deps->hasPendingDeps()) {
! header("Location: ".$link_next);
! exit;
! }
!
!
! /***************************************************************************
! * PAGE CONTENT *
! ***************************************************************************/
!
! include 'themes/'.$GLOBALS['ZI']['theme'].'/header.php';
!
! $application = $zi_registry->getApplication();
! ?>
! <h1>Packages Dependencies</h1>
! <h2><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $_REQUEST['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&id=<?php echo $_REQUEST['id']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>', 'Application Information', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2>
! <?php
! if($zi_deps->isError()){
! ?>
! <div class="warning">FATAL ERROR<br/><?php echo $error; ?></div>
! <?php
! }
!
! // Was an error thrown because of packages not defined in the application.xml?
! if($zi_deps->hasUndefinedPackages()){
! $pkgs_pending = $zi_deps->getUndefinedPackages();
! } else {
! $pkgs_pending = $zi_deps->getPending();
! }
! /*
! echo '<pre>';
! echo '<h3>getPending()</h3>';
! echo print_r($pkgs_pending);
! echo '</pre>';
! */
! if(is_array($pkgs_pending) && count($pkgs_pending)){
! /*
! echo '<pre>';
! echo '<h3>getDeps()</h3>';
! echo print_r($zi_deps->getDeps());
! echo '</pre>';
!
! echo '<pre>';
! echo '<h3>getCheckedNames()</h3>';
! echo print_r($zi_deps->getCheckedNames());
! echo '</pre>';
!
! echo '<pre>';
! echo '<h3>getDepsByName()</h3>';
! echo print_r($zi_deps->getDepsByName());
! echo '</pre>';
! */
!
! //zi_show_deps($zi_deps->getDeps(), $queue);
! ?>
! <table class="list">
! <tr>
! <th align="left">Package</th>
! <th align="center">Version</th>
! <th align="center">Needed By</th>
! </tr>
! <?php
! foreach($pkgs_pending as $pkg_name => $pkgs_needed_by){
! if(!$zi_deps->hasUndefinedPackages()){
! $package = $packages[$pkg_name];
! // temporarily assign package action
! $actions_deps[$package['id']] = 'I';
! } else {
! //print_r($pkgs_needed_by);
! $package['name'] = $pkgs_needed_by['name'];
! $package["release"]["version"] = $pkgs_needed_by['version'];
! $pkgs_needed_by = $pkgs_needed_by['needed_by'];
! }
!
! $package_name_full = $package['name'];
! if(strlen($package_name_full) > 32){
! $package_name_short = substr($package_name_full, 0, 29).'...';
! } else {
! $package_name_short = $package_name_full;
! }
! ?>
! <tr>
! <td><?php
! if(!$zi_deps->hasUndefinedPackages()){
! ?>
! <a title="<?php echo $package_name_full.'-'.$package['release']['version']; ?>" href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=package&id=<?php echo $package['id']; ?>&application=<?php echo $_REQUEST['application']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=package&id=<?php echo $package['id']; ?>&application=<?php echo $_REQUEST['application']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>', 'Package Information', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank">
! <?php
! }
!
! echo $package_name_short;
!
! if(!$zi_deps->hasUndefinedPackages()){
! ?></a><br/><?php echo $package['summary'];
! }
! ?>
! </td>
! <td align="center"><?php
! echo $package["release"]["version"];
! if($package["release"]["version"]=="") {
! echo 'any';
! }
! if(!$zi_deps->hasUndefinedPackages()){
! echo ' <img src="themes/share/icons/org.kde.icons.crystalsvg/16x16/network.png" align="absmiddle" border="0" alt="remote package" title="Download">';
! }
! ?></td>
! <td align="left"><?php
! $pkgs_needed = $pkgs_needed_by;
! foreach($pkgs_needed as $pkg_needed){
! $package = $packages[key($pkg_needed)];
! $package_name_full = $package['name'];
! if(strlen($package_name_full) > 32){
! $package_name_short = substr($package_name_full, 0, 29).'...';
! } else {
! $package_name_short = $package_name_full;
! }
! ?>
! <a title="<?php echo $package_name_full.'-'.$package['release']['version']; ?>" href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=package&id=<?php echo $package['id']; ?>&application=<?php echo $_REQUEST['application']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=package&id=<?php echo $package['id']; ?>&application=<?php echo $_REQUEST['application']; ?>&distribution=<?php echo $_REQUEST['distribution']; ?>', 'Package Information', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank"><?php
! echo $package_name_short.'-'.$package['release']['version']; ?></a><br/></td><?php
! }
! ?>
! </tr>
! <?php
! }
! /*
! echo '<pre>';
! echo '<h3>Actions Deps</h3>';
! echo print_r($actions_deps);
! echo '</pre>';
! */
! ?>
! </table>
! <?php
! }
!
! if(!$zi_deps->isError()){
! // remember new package actions for dependencies
! $zi_registry->setPackagesActionsDeps($actions_deps);
! }
!
! if($error){
! $link_back = 'applications.php';
! } else {
! $link_back = "packages.php";
! if(strlen($_REQUEST["profile"])) {
! $link_back .= zi_form_querystr();
! }
! if(!$zi_deps->hasPendingDeps()) {
! $zi_buttons['next'] = $link_next;
! } else {
! $zi_buttons['ok'] = 'packages_download.php'.zi_form_querystr();
! }
! }
! $zi_buttons['back'] = $link_back;
! include 'themes/'.$GLOBALS['ZI']['theme'].'/footer.php';
?>
-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html