[ewiki] Re: changes to ewiki_control_links()

  • From: Andy Fundinger <andy@xxxxxxxxxxx>
  • To: "'ewiki@xxxxxxxxxxxxx'" <ewiki@xxxxxxxxxxxxx>
  • Date: Fri, 31 Oct 2003 15:33:26 -0500

        I suggest that either ewiki_auth() not alter data or that we not use
pass-by-reference in this case, preferably the later.  The problem is that
an ewiki_auth plugin that would like to alter data for some page/action/user
combination cannot tell that in this case the user will not actually be
seeing this data and thus could destroy data that the other plugins will
need for their operations.  Any 'proper' data alteration would have been
done by the ewiki_auth call in ewiki_page.

Andy


> -----Original Message-----
> From: Mario Salzer [mailto:mario@xxxxxxxxxxxxx]
> Sent: Thursday, October 30, 2003 10:35 PM
> To: ewiki@xxxxxxxxxxxxx
> Subject: [ewiki] Re: changes to ewiki_control_links()
> 
> Hi,
> 
> > I don't understand two of your changes to ewiki_control_links.  It seems
> > that you are mixing the old and new implementations of ewiki_auth.  The
> 
> No, there is no mixing. Everything now just works with the new / corrected
> ewiki_auth() function (no more backpassing/garbaging).
> 
> The ewiki_auth() previously may have back-passed-by-reference something
> and could thereby destroy the contents of the callers wikipage $data
> array.
> This is no longer the case.
> 
> > ewiki_auth() will no longer be garbaging data--so why is data being
> passed
> > to ewiki_control_links() by reference?
> 
> The only reason to change the _control_links() call to use the pass-by-ref
> &$data is for the minimicro speed enhancement when doing so. Additionally
> any chained _auth plugins now had a way to tweak (but not to garbage) the
> $data array. Nothing more.
>
> The p-b-r &$data now is used for most interfaces, to achieve this little
> speed gain, but also to allow tweaking some settings in it. For example
> there is the "lastmodified" field in $data, which ["page"] plugins could
> set
> (if there was a way) and this value then was returned as HTTP Last-
> Modified
> header - what currently works for ordinary pages only.
> 
> # 

Other related posts: