[evolvis-commits] r17590: Added helper method, removed unused required file in index.php, added some comments

papel at evolvis.org papel at evolvis.org
Mon Oct 10 15:19:38 CEST 2011


Author: papel
Date: 2011-10-10 15:19:37 +0200 (Mon, 10 Oct 2011)
New Revision: 17590

Modified:
   trunk/gforge_base/evolvisforge/gforge/common/include/utils.php
   trunk/gforge_base/evolvisforge/gforge/www/frs/index.php
Log:
Added helper method, removed unused required file in index.php, added some comments

Modified: trunk/gforge_base/evolvisforge/gforge/common/include/utils.php
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/common/include/utils.php	2011-10-10 13:07:54 UTC (rev 17589)
+++ trunk/gforge_base/evolvisforge/gforge/common/include/utils.php	2011-10-10 13:19:37 UTC (rev 17590)
@@ -1323,15 +1323,38 @@
 	return false;
 }
 
+
+/**
+ * removeEmptyArrayIndexes() - Removes empty array indexes
+ *
+ * @param Array	- The array with empty indexes included
+ * 
+ * @return Array - The array without empty indexes
+ */
 function removeEmptyArrayIndexes($arr) {
 	for ($i = 0; $i <= count($arr); $i++) {
 		if ($arr[$i] == "" || $arr[$i] == null) {
-			unset($arr[$i]); //eleminate empty indexes
+			unset($arr[$i]); //Eleminate empty indexes
 		}
 	}
 	return $arr;
 }
 
+/**
+ * setTemporaryMaxExecutionTime - Sets a new execution time limit if safe mode not activated
+ * 
+ * @param Integer $tmpExecutionTime - New time limit in seconds
+ * 
+ * @return Integer $maxExecutionTime - Old execution time limited setted in the php.ini
+ */
+function setTemporaryMaxExecutionTime($tmpExecutionTime) {
+	$maxExecutionTime = ini_get('max_execution_time'); //Value of the php.ini
+	if(!ini_get('safe_mode')) { //set_time_limit only works if safe_mode is not activated
+		set_time_limit($tmpExecutionTime);
+	}       
+	return $maxExecutionTime;
+}
+
 // Local Variables:
 // mode: php
 // c-file-style: "bsd"

Modified: trunk/gforge_base/evolvisforge/gforge/www/frs/index.php
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/www/frs/index.php	2011-10-10 13:07:54 UTC (rev 17589)
+++ trunk/gforge_base/evolvisforge/gforge/www/frs/index.php	2011-10-10 13:19:37 UTC (rev 17590)
@@ -27,7 +27,6 @@
 require_once('../env.inc.php');
 require_once $gfwww.'include/pre.php';
 require_once $gfwww.'frs/include/frs_utils.php';
-//require_once $gfcommon.'common/include/utils.php';
 require_once $gfcommon.'frs/FRSPackage.class.php';
 require_once $gfcommon.'frs/download.class.php';
 require_once $gfcommon.'include/datepick.php';



More information about the evolvis-commits mailing list