phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] phpgwapi/inc class.service.inc.php,1.5


From: powerstat
Subject: [Phpgroupware-cvs] phpgwapi/inc class.service.inc.php,1.5
Date: Wed, 4 May 2005 10:23:00 +0200

Update of phpgwapi/inc

Modified Files:
     Branch: MAIN
            class.service.inc.php lines: +4 -5

Log Message:
Overwriting $this with a new object is not allowed and very problematic.
Because phpgwapi.service seems only to be called from 
class.xmlrpc_server.inc.php
the easiest fix is to rename $this to $child, because the object will always be 
destroyed after the function has been called.

This code SMELLS!

====================================================
Index: phpgwapi/inc/class.service.inc.php
diff -u phpgwapi/inc/class.service.inc.php:1.4 
phpgwapi/inc/class.service.inc.php:1.5
--- phpgwapi/inc/class.service.inc.php:1.4      Thu Dec 30 06:47:31 2004
+++ phpgwapi/inc/class.service.inc.php  Wed May  4 08:23:35 2005
@@ -38,15 +38,14 @@
                                case 'contacts':
                                case 'notes':
                                case 'todo':
-                                       $this = 
CreateObject('phpgwapi.service_' . $service);
+                                       $child = 
CreateObject('phpgwapi.service_' . $service);
                                        break;
                                default:
-                                       $this = CreateObject($service);
-                                       break;
+                                       $child = CreateObject($service);
                        }
                        if($function)
                        {
-                               return $this->$function($data);
+                               return $child->$function($data);
                        }
                }







reply via email to

[Prev in Thread] Current Thread [Next in Thread]