From: Luoh Ren-S. <lc...@ii...> - 2004-05-19 01:12:42
|
Thank you for the kindly help on IRC :) I consider that using HTML::Mason::Tools::compress_path() and comp_id() is an internal implmentation technical used by HTML::Mason::Request::cache, which might be subject to change and should not be exposed to the component authors. So I would like to see the Request class providing a public way to get the cache object of another component. I can't tell the difference between the two expressions. Is there any chance that the results of them are different? $options{namespace} ||= compress_path( ($options{comp} || $self->current_comp)->comp_id); $options{namespace} ||= compress_path( ($options{comp}->comp_id || $self->current_comp)->comp_id); Thanks. Luoh Ren-Shan Gareth Kirwan wrote: >Didn't we do this yesterday ? > >Did: >$m->cache( namespace => HTML::Mason::Tools::compress_path( >$m->fetch_comp('/path/of/A')->comp_id ) )->clear > >Not work ? > >And I think you want: > >$options{namespace} ||= compress_path( ($options{comp}->comp_id || >$self->current_comp)->comp_id); > >for what you were suggesting :o) > >Personally I'd not alter the mason source. Subclass or something, but don't >go creating that kind of maintainance issue. > >If you're only doing this once, then I'd go with the long winded line I >first pasted. > >HTH. > >Gareth ( gbjk ) > > > >>-----Original Message----- >>From: mas...@li... >>[mailto:mas...@li...] On Behalf Of >>Luoh Ren-Shan >>Sent: 18 May 2004 11:42 >>To: mas...@li... >>Subject: [Mason] Manipulate the cache of another component >> >> >>Hi all, >> >>I have two component dealing with a same concept, say, users. >>Component A will display the users list, and component B will >>add an user. If I use $m->cache_self() in component A, is it >>possible for component B to invalidate the cache of A while >>adding a new user? >> >>I hope one line of sub HTML::Mason::Request::cache can be >>modified from >> $options{namespace} ||= >>compress_path($self->current_comp->comp_id); >>to >> $options{namespace} ||= compress_path(($options{comp} || >>$self->current_comp)->comp_id); >> >>such that component B can use >> $m->cache(comp => $m->fetch_comp("/path/of/A"))->clear; >> >>to clear the cache of component A. >> >> >>Any ideas? >> >>Thanks. >> >>Luoh Ren-Shan >> >> >>------------------------------------------------------- >>This SF.Net email is sponsored by: SourceForge.net Broadband >>Sign-up now for SourceForge Broadband and get the fastest >>6.0/768 connection for only $19.95/mo for the first 3 months! >>http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click >>_______________________________________________ >>Mason-users mailing list >>Mas...@li... >>https://lists.sourceforge.net/lists/listinfo/mason-users >> >> >> > > > > >------------------------------------------------------- >This SF.Net email is sponsored by: SourceForge.net Broadband >Sign-up now for SourceForge Broadband and get the fastest >6.0/768 connection for only $19.95/mo for the first 3 months! >http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click >_______________________________________________ >Mason-users mailing list >Mas...@li... >https://lists.sourceforge.net/lists/listinfo/mason-users > > |