[Fusionforge-commits] r11769 - trunk/src/common/frs

Franck VILLAUME nerville at libremir.placard.fr.eu.org
Sat Dec 11 20:03:02 CET 2010


Author: nerville
Date: 2010-12-11 20:03:01 +0100 (Sat, 11 Dec 2010)
New Revision: 11769

Modified:
   trunk/src/common/frs/FRSPackage.class.php
Log:
cleanup and rmdir only is is_dir

Modified: trunk/src/common/frs/FRSPackage.class.php
===================================================================
--- trunk/src/common/frs/FRSPackage.class.php	2010-12-11 19:00:14 UTC (rev 11768)
+++ trunk/src/common/frs/FRSPackage.class.php	2010-12-11 19:03:01 UTC (rev 11769)
@@ -42,9 +42,9 @@
 /**
  * Gets a FRSPackage object from the given package id
  * 
- * @param package_id	the package id
- * @param data	the DB handle if passed in (optional)
- * @return	the FRSPackage object	
+ * @param	int	the package id
+ * @param	array	the DB handle if passed in (optional)
+ * @return	object	the FRSPackage object
  */
 function &frspackage_get_object($package_id, $data=false) {
 	global $FRSPACKAGE_OBJ;
@@ -58,7 +58,7 @@
 				$FRSPACKAGE_OBJ['_'.$package_id.'_']=false;
 				return false;
 			}
-			$data = db_fetch_array($res);			
+			$data = db_fetch_array($res);
 		}
 		$Group = group_get_object($data['group_id']);
 		$FRSPACKAGE_OBJ['_'.$package_id.'_']= new FRSPackage($Group,$data['package_id'],$data);
@@ -71,7 +71,7 @@
 	/**
 	 * Associative array of data from db.
 	 *
-	 * @var  array   $data_array.
+	 * @var	array	$data_array.
 	 */
 	var $data_array;
 	var $package_releases;
@@ -79,17 +79,17 @@
 	/**
 	 * The Group object.
 	 *
-	 * @var  object  $Group.
+	 * @var	object	$Group.
 	 */
 	var $Group; //group object
 
 	/**
-	 *  Constructor.
+	 * Constructor.
 	 *
-	 *  @param  object  The Group object to which this FRSPackage is associated.
-	 *  @param  int  The package_id.
-	 *  @param  array   The associative array of data.
-	 *	@return	boolean	success.
+	 * @param	object	The Group object to which this FRSPackage is associated.
+	 * @param	int	The package_id.
+	 * @param	array	The associative array of data.
+	 * @return	boolean	success.
 	 */
 	function FRSPackage(&$Group, $package_id=false, $arr=false) {
 		$this->Error();
@@ -469,7 +469,8 @@
 			$this->setError('Package::delete error: trying to delete root dir');
 			return false;
 		}
-		rmdir($dir);
+		if (is_dir($dir))
+			rmdir($dir);
 
 		db_query_params ('DELETE FROM frs_package WHERE package_id=$1 AND group_id=$2',
 				 array ($this->getID(),




More information about the Fusionforge-commits mailing list