[Fusionforge-commits] FusionForge branch master updated. 9b07236a38f93323231a920475010a775af019b3

Franck VILLAUME nerville at fusionforge.org
Mon Apr 15 23:15:10 CEST 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  9b07236a38f93323231a920475010a775af019b3 (commit)
      from  a75f72e5be30c8b751c04cdef90784c1ea95e4d0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 9b07236a38f93323231a920475010a775af019b3
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Mon Apr 15 23:13:55 2013 +0200

    FRS: protect if ZipArchive class is missing

diff --git a/src/common/frs/FRSPackage.class.php b/src/common/frs/FRSPackage.class.php
index 2bb56cc..5f19dde 100644
--- a/src/common/frs/FRSPackage.class.php
+++ b/src/common/frs/FRSPackage.class.php
@@ -6,7 +6,7 @@
  * Copyright 2009, Roland Mas
  * Copyright (C) 2011-2012 Alain Peyrat - Alcatel-Lucent
  * Copyright 2011, Franck Villaume - Capgemini
- * Copyright 2012, Franck Villaume - TrivialDev
+ * Copyright 2012-2013, Franck Villaume - TrivialDev
  *
  * This file is part of FusionForge. FusionForge is free software;
  * you can redistribute it and/or modify it under the terms of the
@@ -512,7 +512,7 @@ class FRSPackage extends Error {
 
 	public function createNewestReleaseFilesAsZip(){
 		$release = $this->getNewestRelease();
-		if ($release) {
+		if ($release && class_exists('ZipArchive')) {
 			$zip = new ZipArchive();
 			$zipPath = $this->getNewestReleaseZipPath();
 			$filesPath = forge_get_config('upload_dir').'/'.$this->Group->getUnixName().'/'.$this->getFileName().'/'.$release->getFileName();
diff --git a/src/www/frs/index.php b/src/www/frs/index.php
index e524fdd..fa5b4f9 100644
--- a/src/www/frs/index.php
+++ b/src/www/frs/index.php
@@ -5,6 +5,7 @@
  * Copyright 1999-2001 (c) VA Linux Systems
  * Copyright 2002-2004 (c) GForge Team
  * Copyright 2010 (c) FusionForge Team
+ * Copyright 2013, Franck Villaume - TrivialDev
  * http://fusionforge.org/
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -128,12 +129,14 @@ if ( $num_packages < 1) {
 			echo '<div class="warning">' . _('No releases') . '</div>
 			';
 		} else {
-			// display link to latest-release-as-zip
-			print '<p><em>'._('Download latest release as zip:').' ';
-			print util_make_link ('/frs/download.php/latestzip/'.$frsPackage->getID().'/'.$frsPackage->getNewestReleaseZipName(),
-					      $frsPackage->getNewestReleaseZipName(),
-					      array('title' => _('This link always points to the newest release as a zip file.')));
-			print '</em></p>';
+			if (class_exists('ZipArchive')) {
+				// display link to latest-release-as-zip
+				print '<p><em>'._('Download latest release as zip:').' ';
+				print util_make_link ('/frs/download.php/latestzip/'.$frsPackage->getID().'/'.$frsPackage->getNewestReleaseZipName(),
+						$frsPackage->getNewestReleaseZipName(),
+						array('title' => _('This link always points to the newest release as a zip file.')));
+				print '</em></p>';
+			}
 
 			// iterate and show the releases of the package
 			for ( $r = 0; $r < $num_releases; $r++ ) {

-----------------------------------------------------------------------

Summary of changes:
 src/common/frs/FRSPackage.class.php |    4 ++--
 src/www/frs/index.php               |   15 +++++++++------
 2 files changed, 11 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list