[Fusionforge-commits] r10121 - in trunk/src: common/forum common/frs common/include common/tracker common/widget www/include www/search/include

Alain Peyrat aljeux at libremir.placard.fr.eu.org
Thu Jun 24 22:36:09 CEST 2010


Author: aljeux
Date: 2010-06-24 22:36:08 +0200 (Thu, 24 Jun 2010)
New Revision: 10121

Modified:
   trunk/src/common/forum/Forum.class.php
   trunk/src/common/forum/ForumFactory.class.php
   trunk/src/common/frs/FRSPackage.class.php
   trunk/src/common/include/Group.class.php
   trunk/src/common/include/RBAC.php
   trunk/src/common/include/database-pgsql.php
   trunk/src/common/include/escapingUtils.php
   trunk/src/common/tracker/ArtifactType.class.php
   trunk/src/common/tracker/ArtifactsForUser.class.php
   trunk/src/common/widget/Widget.class.php
   trunk/src/common/widget/Widget_MySurveys.class.php
   trunk/src/common/widget/Widget_ProjectDescription.class.php
   trunk/src/common/widget/Widget_Rss.class.php
   trunk/src/www/include/Layout.class.php
   trunk/src/www/include/logger.php
   trunk/src/www/include/pre.php
   trunk/src/www/search/include/SearchManager.class.php
Log:
Fix php warnings

Modified: trunk/src/common/forum/Forum.class.php
===================================================================
--- trunk/src/common/forum/Forum.class.php	2010-06-24 20:35:56 UTC (rev 10120)
+++ trunk/src/common/forum/Forum.class.php	2010-06-24 20:36:08 UTC (rev 10121)
@@ -58,7 +58,7 @@
 	if (!$res || db_numrows($res) < 1) {
 		return false;
 	}
-	$arr =& db_fetch_array ($res);
+	$arr = db_fetch_array ($res);
 	return $arr['group_id'] ;
 }
 

Modified: trunk/src/common/forum/ForumFactory.class.php
===================================================================
--- trunk/src/common/forum/ForumFactory.class.php	2010-06-24 20:35:56 UTC (rev 10120)
+++ trunk/src/common/forum/ForumFactory.class.php	2010-06-24 20:36:08 UTC (rev 10121)
@@ -80,7 +80,7 @@
 		if (!$res) {
 			return $result ;
 		}
-		while ($arr =& db_fetch_array($res)) {
+		while ($arr = db_fetch_array($res)) {
 			$result[] = $arr['group_forum_id'] ;
 		}
 		return $result ;

Modified: trunk/src/common/frs/FRSPackage.class.php
===================================================================
--- trunk/src/common/frs/FRSPackage.class.php	2010-06-24 20:35:56 UTC (rev 10120)
+++ trunk/src/common/frs/FRSPackage.class.php	2010-06-24 20:36:08 UTC (rev 10121)
@@ -202,7 +202,7 @@
 			$this->setError('FRSPackage::fetchData()  Invalid package_id'.db_error());
 			return false;
 		}
-		$this->data_array =& db_fetch_array($res);
+		$this->data_array = db_fetch_array($res);
 		db_free_result($res);
 		return true;
 	}

Modified: trunk/src/common/include/Group.class.php
===================================================================
--- trunk/src/common/include/Group.class.php	2010-06-24 20:35:56 UTC (rev 10120)
+++ trunk/src/common/include/Group.class.php	2010-06-24 20:36:08 UTC (rev 10121)
@@ -2049,7 +2049,7 @@
 			$res = db_query_params ('SELECT users.* FROM users INNER JOIN user_group ON users.user_id=user_group.user_id WHERE user_group.group_id=$1',
 						array ($this->getID())) ;
 			while ($arr =& db_fetch_array($res)) {
-				$this->membersArr[] =& new GFUser($arr['user_id'],$arr);
+				$this->membersArr[] = new GFUser($arr['user_id'],$arr);
 			}
 		}
 		return $this->membersArr;

Modified: trunk/src/common/include/RBAC.php
===================================================================
--- trunk/src/common/include/RBAC.php	2010-06-24 20:35:56 UTC (rev 10120)
+++ trunk/src/common/include/RBAC.php	2010-06-24 20:36:08 UTC (rev 10121)
@@ -308,7 +308,7 @@
 			if ($this instanceof RoleAnonymous) {
 				$res = db_query_params ('SELECT group_id, enable_anonscm FROM groups WHERE is_public=1',
 							array ()) ;
-				while ($arr =& db_fetch_array($res)) {
+				while ($arr = db_fetch_array($res)) {
 					$this->perms_array['project_read'][$arr['group_id']] = 1 ;
 					$this->perms_array['frs'][$arr['group_id']] = 1 ;
 					$this->perms_array['scm'][$arr['group_id']] = $arr['enable_anonscm'] ;
@@ -316,19 +316,19 @@
 
 				$res = db_query_params ('SELECT t.group_artifact_id FROM artifact_group_list t, groups g WHERE t.is_public=1 AND t.allow_anon=1 AND g.is_public=1 AND t.group_id = g.group_id',
 							array ()) ;
-				while ($arr =& db_fetch_array($res)) {
+				while ($arr = db_fetch_array($res)) {
 					$this->perms_array['tracker'][$arr['group_artifact_id']] = 1 ;
 				}
 
 				$res = db_query_params ('SELECT p.group_project_id FROM project_group_list p, groups g WHERE p.is_public=1 AND g.is_public=1 AND p.group_id = g.group_id',
 							array ()) ;
-				while ($arr =& db_fetch_array($res)) {
+				while ($arr = db_fetch_array($res)) {
 					$this->perms_array['pm'][$arr['group_project_id']] = 1 ;
 				}
 
 				$res = db_query_params ('SELECT f.group_forum_id, f.allow_anonymous, f.moderation_level FROM forum_group_list f, groups g WHERE f.is_public=1 AND g.is_public=1 AND f.group_id = g.group_id',
 							array ()) ;
-				while ($arr =& db_fetch_array($res)) {
+				while ($arr = db_fetch_array($res)) {
 					if ($arr['allow_anonymous'] == 1) {
 						if ($arr['moderation_level'] == 0) {
 							$this->perms_array['forum'][$arr['group_forum_id']] = 3 ;

Modified: trunk/src/common/include/database-pgsql.php
===================================================================
--- trunk/src/common/include/database-pgsql.php	2010-06-24 20:35:56 UTC (rev 10120)
+++ trunk/src/common/include/database-pgsql.php	2010-06-24 20:36:08 UTC (rev 10121)
@@ -365,7 +365,7 @@
  */
 function db_reset_result($qhandle,$row=0) {
 	global $sys_db_row_pointer;
-	return $sys_db_row_pointer[$qhandle]=$row;
+	return $sys_db_row_pointer[(int)$qhandle]=$row;
 }
 
 /**
@@ -421,10 +421,10 @@
 function db_fetch_array($qhandle) {
 	global $sys_db_row_pointer;
 	if(!isset($sys_db_row_pointer[$qhandle])) {
-		$sys_db_row_pointer[$qhandle] = 0;
+		$sys_db_row_pointer[(int)$qhandle] = 0;
 	}
-	$sys_db_row_pointer[$qhandle]++;
-	return @pg_fetch_array($qhandle,($sys_db_row_pointer[$qhandle]-1));
+	$sys_db_row_pointer[(int)$qhandle]++;
+	return @pg_fetch_array($qhandle,($sys_db_row_pointer[(int)$qhandle]-1));
 }
 
 /**

Modified: trunk/src/common/include/escapingUtils.php
===================================================================
--- trunk/src/common/include/escapingUtils.php	2010-06-24 20:35:56 UTC (rev 10120)
+++ trunk/src/common/include/escapingUtils.php	2010-06-24 20:36:08 UTC (rev 10121)
@@ -174,7 +174,7 @@
  * @param int $defaultValue an int which is returned if we can't find the key in the array
  * @return int the wanted value
  */
-function _getIntFromArray(& $array, $key, $defaultValue = 0) {
+function _getIntFromArray( $array, $key, $defaultValue = 0) {
 	if(isset($array[$key]) && is_numeric($array[$key]) &&
 		$array[$key] <= 2147483647 && $array[$key] >= -2147483648 ) {
 		return (int) $array[$key];
@@ -195,7 +195,7 @@
  * @param int $defaultValue an int which is returned if we can't find the key in the array
  * @return string the wanted value
  */
-function _getStringFromArray(& $array, $key, $defaultValue = '') {
+function _getStringFromArray( $array, $key, $defaultValue = '') {
 	if(isset($array[$key])) {
 		return $array[$key];
 	}

Modified: trunk/src/common/tracker/ArtifactType.class.php
===================================================================
--- trunk/src/common/tracker/ArtifactType.class.php	2010-06-24 20:35:56 UTC (rev 10120)
+++ trunk/src/common/tracker/ArtifactType.class.php	2010-06-24 20:36:08 UTC (rev 10121)
@@ -645,7 +645,7 @@
 			$this->setError('Template Group Error '.$g->getErrorMessage());
 			return false;
 		}
-		$at =& new ArtifactType($g,$clone_tracker_id);
+		$at = new ArtifactType($g,$clone_tracker_id);
 		if (!$at || !is_object($at)) {
 			$this->setError('Could Not Get Tracker To Clone');
 			return false;

Modified: trunk/src/common/tracker/ArtifactsForUser.class.php
===================================================================
--- trunk/src/common/tracker/ArtifactsForUser.class.php	2010-06-24 20:35:56 UTC (rev 10120)
+++ trunk/src/common/tracker/ArtifactsForUser.class.php	2010-06-24 20:36:08 UTC (rev 10121)
@@ -61,7 +61,7 @@
 		for ($i=0; $i < $rows; $i++) {
 			$id  = db_result($result,$i,'artifact_id');
 			$arr = db_fetch_array($result);
-			$afi =& new ArtifactFromID($id,$arr);
+			$afi = new ArtifactFromID($id,$arr);
 			if ($afi->isError()) {
 				$this->setError($afi->getErrorMessage());
 			} elseif($afi->Artifact->ArtifactType->Group->getStatus() == 'A') {
@@ -118,7 +118,7 @@
 			$group_id = db_result($result,$i,'group_id');
 			$group_artifact_id = db_result($result,$i,'group_artifact_id');
 			$group =& group_get_object($group_id);
-			$artifact =& new ArtifactType($group,$group_artifact_id);
+			$artifact = new ArtifactType($group,$group_artifact_id);
 			$ag = $artifact->getGroup();
 			if ($artifact->isError()) {
 				$this->setError($artifact->getErrorMessage());

Modified: trunk/src/common/widget/Widget.class.php
===================================================================
--- trunk/src/common/widget/Widget.class.php	2010-06-24 20:35:56 UTC (rev 10120)
+++ trunk/src/common/widget/Widget.class.php	2010-06-24 20:36:08 UTC (rev 10121)
@@ -249,7 +249,7 @@
 				plugin_hook('widget_instance', array('widget' => $widget_name, 'instance' => &$o));
 				break;
 		}
-		if (!$o || !is_a($o, 'Widget')) {
+		if (!$o || !($o instanceof Widget)) {
 			$o = null;
 		}
 		return $o;

Modified: trunk/src/common/widget/Widget_MySurveys.class.php
===================================================================
--- trunk/src/common/widget/Widget_MySurveys.class.php	2010-06-24 20:35:56 UTC (rev 10120)
+++ trunk/src/common/widget/Widget_MySurveys.class.php	2010-06-24 20:36:08 UTC (rev 10121)
@@ -53,7 +53,7 @@
 			$html_my_surveys .= '<table style="width:100%">';
 			for ($j=0; $j<$rows; $j++) {
 				$group_id = db_result($result,$j,'group_id');
-				$surveyfacto       =& new SurveyFactory(group_get_object($group_id));
+				$surveyfacto = new SurveyFactory(group_get_object($group_id));
 				$surveys = $surveyfacto->getSurveys();
 				$vItemId = new Valid_UInt('hide_item_id');
 				$vItemId->required();

Modified: trunk/src/common/widget/Widget_ProjectDescription.class.php
===================================================================
--- trunk/src/common/widget/Widget_ProjectDescription.class.php	2010-06-24 20:35:56 UTC (rev 10120)
+++ trunk/src/common/widget/Widget_ProjectDescription.class.php	2010-06-24 20:36:08 UTC (rev 10121)
@@ -37,7 +37,7 @@
         $group_id = $request->get('group_id');
         $pm = ProjectManager::instance();
         $project = $pm->getProject($group_id);
-        $hp =& Codendi_HTMLPurifier::instance();
+        $hp = Codendi_HTMLPurifier::instance();
 
 	$pluginManager = plugin_manager_get_object();
 	if (! $pluginManager->PluginIsInstalled('blocks') || !plugin_hook ("blocks", "summary_description")) {

Modified: trunk/src/common/widget/Widget_Rss.class.php
===================================================================
--- trunk/src/common/widget/Widget_Rss.class.php	2010-06-24 20:35:56 UTC (rev 10120)
+++ trunk/src/common/widget/Widget_Rss.class.php	2010-06-24 20:36:08 UTC (rev 10121)
@@ -49,7 +49,7 @@
 			if (!is_dir(forg_get_config('sys_var_path') .'/rss')) {
 				mkdir(forg_get_config('sys_var_path') .'/rss');
 			}
-			$rss =& new SimplePie($this->rss_url, forg_get_config('sys_var_path') .'/rss', null, forg_get_config('sys_proxy'));
+			$rss = new SimplePie($this->rss_url, forg_get_config('sys_var_path') .'/rss', null, forg_get_config('sys_proxy'));
 			$max_items = 10;
 			$items = array_slice($rss->get_items(), 0, $max_items);
 			$content .= '<table width="100%">';
@@ -137,7 +137,7 @@
 				if (!is_dir(forg_get_config('sys_var_path') .'/rss')) {
 					mkdir(forg_get_config('sys_var_path') .'/rss');
 				}
-				$rss_reader =& new SimplePie($rss['url'], forg_get_config('sys_var_path') .'/rss', null, forge_get_config('sys_proxy'));
+				$rss_reader = new SimplePie($rss['url'], forg_get_config('sys_var_path') .'/rss', null, forge_get_config('sys_proxy'));
 				$rss['title'] = $rss_reader->get_title();
 			}
 			$sql = 'INSERT INTO widget_rss (owner_id, owner_type, title, url) VALUES ($1,$2,$3,$4)';

Modified: trunk/src/www/include/Layout.class.php
===================================================================
--- trunk/src/www/include/Layout.class.php	2010-06-24 20:35:56 UTC (rev 10120)
+++ trunk/src/www/include/Layout.class.php	2010-06-24 20:36:08 UTC (rev 10121)
@@ -608,7 +608,7 @@
 	}
 
 	function outerTabs($params) {
-		$menu =& $this->navigation->getSiteMenu();
+		$menu = $this->navigation->getSiteMenu();
 
 		echo $this->tabGenerator($menu['urls'], $menu['titles'], false, $menu['selected'], '');
 

Modified: trunk/src/www/include/logger.php
===================================================================
--- trunk/src/www/include/logger.php	2010-06-24 20:35:56 UTC (rev 10120)
+++ trunk/src/www/include/logger.php	2010-06-24 20:36:08 UTC (rev 10121)
@@ -50,7 +50,7 @@
 		
 		// store subpage id for analyzing later
 		$subpage = @$expl_pathinfo[3];
-		$subpage2 = @$expl_pathinfo[4];
+		$subpage2 = isset($expl_pathinfo[4]) ? $expl_pathinfo[4] : '';
 
 		//set up the group_id
 	   	$group_id=db_result($res_grp,0,'group_id');

Modified: trunk/src/www/include/pre.php
===================================================================
--- trunk/src/www/include/pre.php	2010-06-24 20:35:56 UTC (rev 10120)
+++ trunk/src/www/include/pre.php	2010-06-24 20:36:08 UTC (rev 10121)
@@ -168,6 +168,8 @@
 	require_once $gfcommon.'include/Jabber.class.php';
 }
 
+ini_set('date.timezone', $sys_default_timezone);
+
 if (isset($_SERVER['SERVER_SOFTWARE'])) { // We're on the web
 	// exit_error() and variants (for the web)
 	require_once $gfwww.'include/exit.php';

Modified: trunk/src/www/search/include/SearchManager.class.php
===================================================================
--- trunk/src/www/search/include/SearchManager.class.php	2010-06-24 20:35:56 UTC (rev 10120)
+++ trunk/src/www/search/include/SearchManager.class.php	2010-06-24 20:36:08 UTC (rev 10121)
@@ -21,7 +21,7 @@
 
 function & getSearchManager() {
 	if(!isset($GLOBALS['OBJ_SEARCH_MANAGER'])) {
-		$GLOBALS['OBJ_SEARCH_MANAGER'] =& new SearchManager();
+		$GLOBALS['OBJ_SEARCH_MANAGER'] = new SearchManager();
 	}
 	return $GLOBALS['OBJ_SEARCH_MANAGER'];
 }




More information about the Fusionforge-commits mailing list