[Fusionforge-commits] r10116 - in trunk/src: common/docman common/forum common/include common/valid common/widget plugins/externalsearch/include www/include www/search/include/engines www/widgets

Alain Peyrat aljeux at libremir.placard.fr.eu.org
Thu Jun 24 21:54:21 CEST 2010


Author: aljeux
Date: 2010-06-24 21:54:20 +0200 (Thu, 24 Jun 2010)
New Revision: 10116

Modified:
   trunk/src/common/docman/DocumentFactory.class.php
   trunk/src/common/forum/Forum.class.php
   trunk/src/common/include/HTTPRequest.class.php
   trunk/src/common/include/User.class.php
   trunk/src/common/include/config.php
   trunk/src/common/valid/ValidFactory.class.php
   trunk/src/common/widget/Widget.class.php
   trunk/src/common/widget/WidgetLayoutManager.class.php
   trunk/src/plugins/externalsearch/include/ExternalSearchEngine.class.php
   trunk/src/www/include/project_summary.php
   trunk/src/www/search/include/engines/ArtifactSearchEngine.class.php
   trunk/src/www/search/include/engines/ForumSearchEngine.class.php
   trunk/src/www/search/include/engines/GroupSearchEngine.class.php
   trunk/src/www/search/include/engines/SearchEngine.class.php
   trunk/src/www/widgets/widget.php
Log:
Fix lots of php warnings

Modified: trunk/src/common/docman/DocumentFactory.class.php
===================================================================
--- trunk/src/common/docman/DocumentFactory.class.php	2010-06-24 19:54:13 UTC (rev 10115)
+++ trunk/src/common/docman/DocumentFactory.class.php	2010-06-24 19:54:20 UTC (rev 10116)
@@ -187,7 +187,7 @@
 			exit_error('Error', db_error());
 		}
 		
-		while ($arr =& db_fetch_array($result)) {
+		while ($arr = db_fetch_array($result)) {
 			$doc_group_id = $arr['doc_group'];
 			if (!is_array(@$this->Documents[$doc_group_id])) {
 				$this->Documents[$doc_group_id] = array();

Modified: trunk/src/common/forum/Forum.class.php
===================================================================
--- trunk/src/common/forum/Forum.class.php	2010-06-24 19:54:13 UTC (rev 10115)
+++ trunk/src/common/forum/Forum.class.php	2010-06-24 19:54:20 UTC (rev 10116)
@@ -245,7 +245,7 @@
 			$this->setError(_('Invalid forum group identifier'));
 			return false;
 		}
-		$this->data_array =& db_fetch_array($res);
+		$this->data_array = db_fetch_array($res);
 		db_free_result($res);
 		return true;
 	}
@@ -298,7 +298,7 @@
 	 *	@return	int	The unix time.
 	 */
 	function getSavedDate() {
-		if (@$this->save_date) {
+		if (isset($this->save_date)) {
 			return $this->save_date;
 		} else {
 			if (session_loggedin()) {

Modified: trunk/src/common/include/HTTPRequest.class.php
===================================================================
--- trunk/src/common/include/HTTPRequest.class.php	2010-06-24 19:54:13 UTC (rev 10115)
+++ trunk/src/common/include/HTTPRequest.class.php	2010-06-24 19:54:20 UTC (rev 10116)
@@ -75,7 +75,7 @@
      *
      * @return mixed HTTPRequest Object.
      */
-    function &instance() {
+    static function &instance() {
         static $_httprequest_instance;
         if (!$_httprequest_instance) {
             $_httprequest_instance = new HTTPRequest();

Modified: trunk/src/common/include/User.class.php
===================================================================
--- trunk/src/common/include/User.class.php	2010-06-24 19:54:13 UTC (rev 10115)
+++ trunk/src/common/include/User.class.php	2010-06-24 19:54:20 UTC (rev 10116)
@@ -620,7 +620,7 @@
 			$this->setError('GFUser::fetchData()::'.db_error());
 			return false;
 		}
-		$this->data_array =& db_fetch_array($res);
+		$this->data_array = db_fetch_array($res);
 		return true;
 	}
 	

Modified: trunk/src/common/include/config.php
===================================================================
--- trunk/src/common/include/config.php	2010-06-24 19:54:13 UTC (rev 10115)
+++ trunk/src/common/include/config.php	2010-06-24 19:54:20 UTC (rev 10116)
@@ -27,7 +27,7 @@
 	private $settings ;
 	private $bools = array () ;
     
-	public function get_instance () {
+	static public function get_instance () {
 		if (self::$instance == NULL) {
 			self::$instance = new FusionForgeConfig () ;
 		}

Modified: trunk/src/common/valid/ValidFactory.class.php
===================================================================
--- trunk/src/common/valid/ValidFactory.class.php	2010-06-24 19:54:13 UTC (rev 10115)
+++ trunk/src/common/valid/ValidFactory.class.php	2010-06-24 19:54:20 UTC (rev 10116)
@@ -165,7 +165,7 @@
      * @param  String Index of file to check in $_FILES array.
      * @return Boolean
      */
-    function validate($files, $index) {
+    function validate($files, $index='') {
         if(is_array($files) && isset($files[$index])) {
             $this->addRule(new Rule_File());
             return parent::validate($files[$index]);

Modified: trunk/src/common/widget/Widget.class.php
===================================================================
--- trunk/src/common/widget/Widget.class.php	2010-06-24 19:54:13 UTC (rev 10115)
+++ trunk/src/common/widget/Widget.class.php	2010-06-24 19:54:20 UTC (rev 10116)
@@ -151,53 +151,53 @@
 	}
 	function destroy($id) {
 	}
-	/* static */ function & getInstance($widget_name) {
+	static  function & getInstance($widget_name) {
 		$o = null;
 		switch($widget_name) {
 			case 'mysurveys':
-				$o =& new Widget_MySurveys();
+				$o = new Widget_MySurveys();
 				break;
 			case 'myprojects':
-				$o =& new Widget_MyProjects();
+				$o = new Widget_MyProjects();
 				break;
 			case 'mybookmarks':
-				$o =& new Widget_MyBookmarks();
+				$o = new Widget_MyBookmarks();
 				break;
 			case 'mymonitoredforums':
-				$o =& new Widget_MyMonitoredForums();
+				$o = new Widget_MyMonitoredForums();
 				break;
 			case 'myartifacts':
-				$o =& new Widget_MyArtifacts();
+				$o = new Widget_MyArtifacts();
 				break;
 			case 'myrss':
-				$o =& new Widget_MyRss();
+				$o = new Widget_MyRss();
 				break;
 			case 'mytasks':
-				$o =& new Widget_MyTasks();
+				$o = new Widget_MyTasks();
 				break;
 
 			case 'myadmin':
 				if (UserManager::instance()->getCurrentUser()->is_super_user) { //This widget is only for super admin
-					$o =& new Widget_MyAdmin();
+					$o = new Widget_MyAdmin();
 				}
 				break;/*
 			case 'mysrs':
-				$o =& new Widget_MySrs();
+				$o = new Widget_MySrs();
 				break;
 			case 'mymonitoredfp':
-				$o =& new Widget_MyMonitoredFp();
+				$o = new Widget_MyMonitoredFp();
 				break;
 				case 'mylatestsvncommits':
-				$o =& new Widget_MyLatestSvnCommits();
+				$o = new Widget_MyLatestSvnCommits();
 				break; 
 				case 'mybugs':
-				$o =& new Widget_MyBugs();
+				$o = new Widget_MyBugs();
 				break;
 								case 'mytwitterfollow':
-				$o =& new Widget_MyTwitterFollow();
+				$o = new Widget_MyTwitterFollow();
 				break;
 				case 'mywikipage':                   //not yet
-				$o =& new Widget_MyWikiPage();
+				$o = new Widget_MyWikiPage();
 				break;
 				case 'mysystemevent':
 				if (user_is_super_user()) { //This widget is only for super admin
@@ -205,46 +205,46 @@
 				}
 				break;
 				case 'projectclassification':
-				$o =& new Widget_ProjectClassification();
+				$o = new Widget_ProjectClassification();
 				break;*/
 				case 'projectdescription':
-				$o =& new Widget_ProjectDescription();
+				$o = new Widget_ProjectDescription();
 				break;
 				case 'projectmembers':
-				$o =& new Widget_ProjectMembers();
+				$o = new Widget_ProjectMembers();
 				break;
 				case 'projectinfo':
-				$o =& new Widget_ProjectInfo();
+				$o = new Widget_ProjectInfo();
 				break;
 				case 'projectlatestfilereleases':
-				$o =& new Widget_ProjectLatestFileReleases();
+				$o = new Widget_ProjectLatestFileReleases();
 				break;
 				case 'projectlatestnews':
-				$o =& new Widget_ProjectLatestNews();
+				$o = new Widget_ProjectLatestNews();
 				break;
 				case 'projectpublicareas':
-				$o =& new Widget_ProjectPublicAreas();
+				$o = new Widget_ProjectPublicAreas();
 				break;
 				case 'projectrss':
-				$o =& new Widget_ProjectRss();
+				$o = new Widget_ProjectRss();
 				break;/*
 				case 'projecttwitterfollow':
-				$o =& new Widget_ProjectTwitterFollow();
+				$o = new Widget_ProjectTwitterFollow();
 				break;
 				case 'projectsvnstats':
-				$o =& new Widget_ProjectSvnStats();
+				$o = new Widget_ProjectSvnStats();
 				break;
 				//case 'projectwikipage':                    //not yet
-				//    $o =& new Widget_ProjectWikiPage();
+				//    $o = new Widget_ProjectWikiPage();
 				//    break;
 				case 'projectlatestsvncommits':
-				$o =& new Widget_ProjectLatestSvnCommits();
+				$o = new Widget_ProjectLatestSvnCommits();
 				break;
 				case 'projectlatestcvscommits':
-				$o =& new Widget_ProjectLatestCvsCommits();
+				$o = new Widget_ProjectLatestCvsCommits();
 				break;*/
 			default:
-				//$em =& EventManager::instance();
+				//$em = EventManager::instance();
 				//$em->processEvent('widget_instance', array('widget' => $widget_name, 'instance' => &$o));
 				plugin_hook('widget_instance', array('widget' => $widget_name, 'instance' => &$o));
 				break;

Modified: trunk/src/common/widget/WidgetLayoutManager.class.php
===================================================================
--- trunk/src/common/widget/WidgetLayoutManager.class.php	2010-06-24 19:54:13 UTC (rev 10115)
+++ trunk/src/common/widget/WidgetLayoutManager.class.php	2010-06-24 19:54:20 UTC (rev 10116)
@@ -67,19 +67,19 @@
 				} else if ($owner_type === self::OWNER_TYPE_GROUP) {
 					echo '<br />';
 				}
-				$layout =& new WidgetLayout($data['id'], $data['name'], $data['description'], $data['scope']);
+				$layout = new WidgetLayout($data['id'], $data['name'], $data['description'], $data['scope']);
 				$sql = 'SELECT * FROM layouts_rows WHERE layout_id = $1 ORDER BY rank';
 				$req_rows = db_query_params($sql,array($layout->id));
 				while ($data = db_fetch_array($req_rows)) {
-					$row =& new WidgetLayout_Row($data['id'], $data['rank']);
+					$row = new WidgetLayout_Row($data['id'], $data['rank']);
 					$sql = 'SELECT * FROM layouts_rows_columns WHERE layout_row_id = $1';
 					$req_cols = db_query_params($sql,array($row->id));
 					while ($data = db_fetch_array($req_cols)) {
-						$col =& new WidgetLayout_Row_Column($data['id'], $data['width']);
+						$col = new WidgetLayout_Row_Column($data['id'], $data['width']);
 						$sql = "SELECT * FROM layouts_contents WHERE owner_type = $1  AND owner_id = $2 AND column_id = $3 ORDER BY rank";
 						$req_content = db_query_params($sql,array($owner_type, $owner_id, $col->id));
 						while ($data = db_fetch_array($req_content)) {
-							$c =& Widget::getInstance($data['name']);
+							$c = Widget::getInstance($data['name']);
 							if ($c && $c->isAvailable()) {
 								$c->loadContent($data['content_id']);
 								$col->add($c, $data['is_minimized'], $data['display_preferences']);

Modified: trunk/src/plugins/externalsearch/include/ExternalSearchEngine.class.php
===================================================================
--- trunk/src/plugins/externalsearch/include/ExternalSearchEngine.class.php	2010-06-24 19:54:13 UTC (rev 10115)
+++ trunk/src/plugins/externalsearch/include/ExternalSearchEngine.class.php	2010-06-24 19:54:20 UTC (rev 10116)
@@ -37,7 +37,7 @@
 		return true;
 	}
 	
-	function & getSearchRenderer($words, $offset, $exact, $parameters) {
+	function getSearchRenderer($words, $offset, $exact, $parameters) {
 		require_once $gfplugins.'externalsearch/include/ExternalHtmlSearchRenderer.class.php';
 		$renderer = new ExternalHtmlSearchRenderer($type, $this->name, $this->url, $words);
 		return $renderer;

Modified: trunk/src/www/include/project_summary.php
===================================================================
--- trunk/src/www/include/project_summary.php	2010-06-24 19:54:13 UTC (rev 10115)
+++ trunk/src/www/include/project_summary.php	2010-06-24 19:54:20 UTC (rev 10116)
@@ -42,7 +42,7 @@
 		project_setup_agg($group_id);
 	}
 	// Remove warning
-	if (@$project_agg_arr[$type]) {
+	if (isset($project_agg_arr[$type])) {
 		return "$project_agg_arr[$type]";
 	} else {
 		return '0';

Modified: trunk/src/www/search/include/engines/ArtifactSearchEngine.class.php
===================================================================
--- trunk/src/www/search/include/engines/ArtifactSearchEngine.class.php	2010-06-24 19:54:13 UTC (rev 10115)
+++ trunk/src/www/search/include/engines/ArtifactSearchEngine.class.php	2010-06-24 19:54:20 UTC (rev 10116)
@@ -34,7 +34,7 @@
 		return false;
 	}
 	
-	function & getSearchRenderer($words, $offset, $exact, $parameters) {
+	function getSearchRenderer($words, $offset, $exact, $parameters) {
 		$this->includeSearchRenderer();
 		$rendererClassName = $this->rendererClassName;
 		$renderer = new $rendererClassName($words, $offset, $exact, $parameters[SEARCH__PARAMETER_GROUP_ID], $parameters[SEARCH__PARAMETER_ARTIFACT_ID]);

Modified: trunk/src/www/search/include/engines/ForumSearchEngine.class.php
===================================================================
--- trunk/src/www/search/include/engines/ForumSearchEngine.class.php	2010-06-24 19:54:13 UTC (rev 10115)
+++ trunk/src/www/search/include/engines/ForumSearchEngine.class.php	2010-06-24 19:54:20 UTC (rev 10116)
@@ -23,7 +23,7 @@
 		return false;
 	}
 	
-	function & getSearchRenderer($words, $offset, $exact, $parameters) {
+	function getSearchRenderer($words, $offset, $exact, $parameters) {
 		$this->includeSearchRenderer();
 		$rendererClassName = $this->rendererClassName;
 		$renderer = new $rendererClassName($words, $offset, $exact, $parameters[SEARCH__PARAMETER_GROUP_ID], $parameters[SEARCH__PARAMETER_FORUM_ID]);

Modified: trunk/src/www/search/include/engines/GroupSearchEngine.class.php
===================================================================
--- trunk/src/www/search/include/engines/GroupSearchEngine.class.php	2010-06-24 19:54:13 UTC (rev 10115)
+++ trunk/src/www/search/include/engines/GroupSearchEngine.class.php	2010-06-24 19:54:20 UTC (rev 10116)
@@ -43,7 +43,7 @@
 		return false;
 	}
 	
-	function & getSearchRenderer($words, $offset, $exact, $parameters) {
+	function getSearchRenderer($words, $offset, $exact, $parameters) {
 		$this->includeSearchRenderer();
 		$rendererClassName = $this->rendererClassName;
 		$renderer = new $rendererClassName($words, $offset, $exact, $parameters[SEARCH__PARAMETER_GROUP_ID]);

Modified: trunk/src/www/search/include/engines/SearchEngine.class.php
===================================================================
--- trunk/src/www/search/include/engines/SearchEngine.class.php	2010-06-24 19:54:13 UTC (rev 10115)
+++ trunk/src/www/search/include/engines/SearchEngine.class.php	2010-06-24 19:54:20 UTC (rev 10116)
@@ -36,7 +36,7 @@
 		require_once $gfwww.'search/include/renderers/'.$this->rendererClassName.'.class.php';
 	}
 	
-	function & getSearchRenderer($words, $offset, $exact) {
+	function getSearchRenderer($words, $offset, $exact, $parameters) {
 		$this->includeSearchRenderer();
 		$rendererClassName = $this->rendererClassName;
 		$renderer = new $rendererClassName($words, $offset, $exact);

Modified: trunk/src/www/widgets/widget.php
===================================================================
--- trunk/src/www/widgets/widget.php	2010-06-24 19:54:13 UTC (rev 10115)
+++ trunk/src/www/widgets/widget.php	2010-06-24 19:54:20 UTC (rev 10116)
@@ -40,7 +40,8 @@
     if ($good) {
         if ($request->exist('name')) {
             $param = $request->get('name');
-            $name = array_pop(array_keys($param));
+            $v = array_keys($param);
+            $name = array_pop($v);
             $instance_id = (int)$param[$name];
             if ($widget =& Widget::getInstance($name)) {
                 if ($widget->isAvailable()) {




More information about the Fusionforge-commits mailing list