From: Mitra <mi...@ea...> - 2003-03-11 10:11:19
|
At 9:32 AM +0100 11/3/03, Jakub Ad=E1mek wrote: >Mitra, > >neither 4.11 allows to redefine functions. I am not sure that ever >any PHP version allowed this. >Of course you must use only the aa_menus from the modules/site dir, >you don't want to see slice menus in a site module. Well we've only started seeing these problems as people moved to 4.3, or maybe as the require stuff was changed. I don't know why aa_menus was being defined twice, I just got the error message, I think it was on the week you were away. > The problem of util.php3 is not that of a developer but that of the >time which PHP needs to parse the file and which influences the >server answer time. Yes - I realize that, what I'm saying is that if util.php3 is TOO big , then split it into two and only include the part you need, DON't define the same functions twice. We have seen too many bugs that way. - Mitra > >-----Original Message----- >From: Mitra [mailto:mi...@ea...] >Sent: Saturday, March 08, 2003 11:35 PM >To: Jakub Adamek; apc...@so... >Subject: RE: [Apc-aa-coders] Redefining functions > >I have appended the original message about aa_menus, > >If util.php3 is getting too big, it would be MUCH easier to split it >up - util.php3 and utilcore.php3 and then require_once utilcore.php3 >from util.php3, this would be much better than redefining functions. > >Could you upgrade to PHP 4.3, this and later versions are where we >are seeing all the redefining problems. > >- Mitra > > >At 8:45 PM +0100 8/3/03, Jakub Adamek wrote: > >>Mitra, >> > > >you are very right. I didn't want to include the whole util.php3 >because of performance, but perhaps it is not as important. > > > >But about get_aamenus(): there is no reason why one script should >include several menu definitions. I didn't encounter this problem, >where was it? > > > >As to the PHP version: I am developing on 4.1.1. > > > >Jakub > > > >-----Original Message----- >From: apc...@li... >[mailto:apc...@li...] On Behalf Of Mitra >Sent: Friday, March 07, 2003 10:32 PM >To: apc...@so... >Subject: [Apc-aa-coders] Redefining functions > >Jakub - > > >I'm pulling this to a separate thread since its not really connected >to the filler problems > > >>the problem of defining new_id twice is fixed in CVS (if (! >>function_exists ("new_id"))). Can you perhaps do an update? I get >>always this error on refresh. >> > > >We are seeing a lot of problems with multiply defined functions, l >ately - I think they are becoming visible because the latest PHP >doesn't allow redefining functions. > > >It seems to me that we have a big weakness in apc-aa if we redefine >functions, take this example of new_id, the version in filler.php3 >is wrong, it misses a bug-fix that Honza made on the version in >util.php3. > > >It also makes it really hard to find bugs because it is not always >clear which version of a function is being used. > > >There was also an example reported to do with aa-menus (defined in >menu.php3 and modules/site/menu.php3) recently - a message on >1-march that was never dealt with. > > >Instead of redefining new_id, wouldn't it have been better to >include util.php3, I've deleted the code from post2shtml.php3 and >added require_once util.php3 I've done this and resubmitting to CVS. > > >Could someone (is site module Jakub or Honza?) fix aa_menus. > > >I'd also suggest upgrading your version of PHP so that you see these >problems on your dev machine. > > >- Mitra > > > >Here is the earlier message ..... > >>So what can we do - I'm not clear if Jakub is redeclaring the >>function for a reason? I tried a couple of things - like >>temporarily renaming the function in include/menu.php3 just while >>the site page loaded and that just broke things. >> > >At 11:31 AM +0100 28/2/03, Honza Malik wrote: > >>I tried it on our install. I moved our site module up and it works in >> >both configurations. > > >I think the problem could be in diffrerent versions of PHP. It seems, > >that new versions of PHP (>=3D4.3.0) do not allow redeclaration of > >functions (it was also the problem with gc() in PHPLib already reported > >in apc-aa-general). > > >On P=87, 2003-02-28 at 05:00, Mitra wrote: > > > The admin interface won't go to manage a site now, this seems to be > > > because get_aamenus is defined in both menu.php3 and > > > modules/site/menu.php3 > > > > > > its a strange bug, it works on one of my installations, but not the > > > other - they are both running the current CVS, only the data is > > > different. > > > > > > I think the main difference is that when you login to one you get a > > > slice, whereas on the other you get a site (alphabetical order) > > > > > > I'm not quite clear whether the name collision is deliberate, i.e. > > > redefining a function - or accidental > > > > > > Anyway, I think its a Jakub problem - and he's out this week I > > > understand? I can work around it on my machine, but this stops work > > > if anyone else has a "site" as their alphabetically first slice. > > >-- >Mitra Technology Consulting - www.mitra.biz - mi...@mi... >02-6684-8096 or 0414-648-0722 > >Life is a Mystery to be Lived, not a Problem to be Solved -- Mitra Technology Consulting - www.mitra.biz - mi...@mi... 02-6684-8096 or 0414-648-0722 Life is a Mystery to be Lived, not a Problem to be Solved |