You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Ayhan Ulusoy <ay...@drexel.edu> on 2003/10/19 13:14:57 UTC

RE : porting Sandwich to mp2


> -----Original Message-----
> From: Stas Bekman [mailto:stas@stason.org]
> Sent: Sunday, October 19, 2003 10:17 AM
> To: dev@perl.apache.org; Ayhan Ulusoy
> Subject: Re: porting Sandwich to mp2
> 
>  > Another thing :
> 
> Again, please separate questions in separate threads. As these threads
> tend to
> grow big, it becomes really hard to manage them. Thanks.


[Ayhan] Again, sorry about that & thanks for splitting it.



>  > would it not be better to separate plain-old response
>  > handlers from, say, filters.
> 
> What do you mean? Making it easy to derive from the handler's package
> whether
> it's a filter or not?

[Ayhan] Yes, that's exactly what I mean and the "::Filter::" prefix
seems good.


> Sure, go ahead and call your filter modules Apache::FilterFoo or
> Apache::Filter::Foo. I'm going to release shortly
> Apache::Filter::HTTPHeadersFixup and probably Apache::Filter::Debug.
>
[Ayhan] Hmmm.. That "Apache::Filter::Debug" sounds yummy... 


>  > Now that 1.99_10 is out, and that the filter API hasn't changed for
a
>  > whole 6 months :), I'd like to release on CPAN a general-purpose
>  > output-filter as a replacement for "Sandwich", but which can also
work
>  > with wrapper templates (it's called CheeseBurger right-now).
>  >
>  > The code has been there for a while and works. I just need to add
>  > support for the Sandwich options, so that it would be a drop-in
>  > replacement.
>  >
>  > Under which namespace do I release it?
> 
> Either Apache::Sandwich, or if you want to stress that it's a filter
> Apache::FilterLayers or Apache::FilterSandwich, or you might want to
poll
> the
> modperl list... Also it's probably a good idea to ask the owner of
> Apache::Sandwich whether they aren't working on a mp2 port already.


[Ayhan] Well, as you hint at it, this is probably not the right list to
discuss the "Sandwich" part of the name, where the mod_perl list would
probably be more appropriate. (whereas for "Apache::", I think it is
though and it is now in a separate thread.)


But now that we're at it, yes, I think it would be the least of things
to contact the author of "Sandwich" if it were an mp2 port, but it
isn't.

I am afraid I wasn't all too clear when I was talking about a "Sandwich
replacement". 

This module (let's call it Apache::Filter::CheeseBurger) has been
inspired from, but actually quite different than, Apache::Sandwich,
processed HEADER & FOOTER parts. 

CheeseBurger is a template-wrapper written from scratch to work with the
apache/mp 2 layered IO. It is Template-Toolkit compatible.

Enough publicity... Honestly, I have no stomach to try and implement
anything like that for mp1, especially when I know that 90% of the code
will go into a "if (mp1) {} else {}" statement. 

Besides, why would people switch to apache2+mp2 if it doesn't bring
anything new and yummy, which they do and one of those is called layered
IO. 

To my knowledge, there are 2 modules that have vaguely similar
functionalities on CPAN :  "Apache::Sandwich" and
"Apache::SimpleReplace".  
Both were written for mp1 with god knows how many hacks in them just to
emulate something that wasn't there in the first place. They would
simply require a complete re-write to work with the apache 2 layered IO,
and even then there wouldn't be a 100% functionality match between their
mp1 and mp2 versions. 

On the other hand, people who have been using those modules would need
similar functionality in the mp2 world to feel at home.

So I thought, well, I could drop in support for the several PerlSetVar
options for those modules (HEADER & FOOTER for Sandwich,  and TEMPLATE &
REPLACE for SimpleReplace) for an extra 2 cents of work. That way,
people could keep on using their existing documents. That's all.

Apache::Sandwich had a way of being called from within response
handlers. That, I can't replicate for example. Simply because we live in
a different filtering paradigm. 

Instead of advertising to be an mp2 port of Apache::Sandwich and
breaking people's code behind their back, I'd rather leave that behind
and only suggest that if they need something similar to Sandwich
functionality, they can find it here. They wouldn't need to change much
unless they were doing funny stuff, but they would have been warned.

This leaves the author of Apache::Sandwich the option of doing a port
himself, or maybe I or somebody else could jump in and do that port at a
later time if it seems to be absolutely unavoidable. 

Or maybe, Sandwich could be ported in a different way, by adding an "if
(mp >= 1.99_10)" switch at the start of its code so that it can delegate
most of its work to CheeseBurger or an equivalent module written
specifically for mp2 and takes full advantage of the filter frame-work.
That way, the mp2 module doesn't have to carry all the baggage of the
mp1 module (compilation overhead and so on). 

That being said, I will contact the author anyway to see what can be
done.

Sorry for the long message. I think I got kind of carried away.


Cheers,
Ayhan











 








> __________________________________________________________________
> Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
> http://stason.org/     mod_perl Guide ---> http://perl.apache.org
> mailto:stas@stason.org http://use.perl.org http://apacheweek.com
> http://modperlbook.org http://apache.org   http://ticketmaster.com
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
> For additional commands, e-mail: dev-help@perl.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


RE : RE : porting Sandwich to mp2

Posted by Ayhan Ulusoy <ay...@drexel.edu>.
Hi Geoff,

Please be ensured : this thing doesn't have a real name yet, and before
it does, the mod_perl list will be pinged.  

It just needed one for the development... 

I am counting on you though to give feed-back on the mod_perl list when
it comes to choosing a real name :-)


Cheers,

Ayhan



> -----Original Message-----
> From: Geoffrey Young [mailto:geoff@modperlcookbook.org]
> Sent: Sunday, October 19, 2003 3:18 PM
> To: Ayhan Ulusoy
> Cc: 'Stas Bekman'; dev@perl.apache.org
> Subject: Re: RE : porting Sandwich to mp2
> 
> 
> >
> > This module (let's call it Apache::Filter::CheeseBurger)
> 
> please don't release a module with that name on CPAN -
Apache::Sandwich is
> bad enough - it remains for historical reasons, created far before we
(as
> a
> community) started taking our namespace seriously :)
> 
> the proper way to release something to CPAN in the Apache:: namespace
is
> to
> ping the main mod_perl list with an RFC and wait for feedback.
although
> this isn't always followed, it's generally a wise thing to do and
would be
> greatly appreciated
> 
> --Geoff
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
> For additional commands, e-mail: dev-help@perl.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: RE : porting Sandwich to mp2

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> 
> This module (let's call it Apache::Filter::CheeseBurger) 

please don't release a module with that name on CPAN - Apache::Sandwich is 
bad enough - it remains for historical reasons, created far before we (as a 
community) started taking our namespace seriously :)

the proper way to release something to CPAN in the Apache:: namespace is to 
ping the main mod_perl list with an RFC and wait for feedback.  although 
this isn't always followed, it's generally a wise thing to do and would be 
greatly appreciated

--Geoff


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: RE : porting Sandwich to mp2

Posted by Stas Bekman <st...@stason.org>.
Ayhan Ulusoy wrote:

>>Sure, go ahead and call your filter modules Apache::FilterFoo or
>>Apache::Filter::Foo. I'm going to release shortly
>>Apache::Filter::HTTPHeadersFixup and probably Apache::Filter::Debug.
>>
> 
> [Ayhan] Hmmm.. That "Apache::Filter::Debug" sounds yummy... 

It's available here for a year or so:
http://perl.apache.org/docs/2.0/user/handlers/filters.html#All_in_One_Filter

I use it all the time to debug filters. I just haven't decided yet whether I 
should call it ::Debug or something else, since Debug is too generic, At the 
moment it's called FilterSnoop. If you play with it let me know what you 
think. I simply wanted to expose some of the internal functions that it uses, 
that's where the debug idea came from.

> [Ayhan] Well, as you hint at it, this is probably not the right list to
> discuss the "Sandwich" part of the name, where the mod_perl list would
> probably be more appropriate. (whereas for "Apache::", I think it is
> though and it is now in a separate thread.)

The main benefit to ask at the modperl list is that there are many more people 
listening there. Though as my recent experience shows, there are two few 
involved with mp2, so you get hardly any feedback at all. But give it a try 
nevertheless.

> But now that we're at it, yes, I think it would be the least of things
> to contact the author of "Sandwich" if it were an mp2 port, but it
> isn't.

Sure, post a proper description to the modperl list and we will discuss it there.

[...]
> So I thought, well, I could drop in support for the several PerlSetVar
> options for those modules (HEADER & FOOTER for Sandwich,  and TEMPLATE &
> REPLACE for SimpleReplace) for an extra 2 cents of work. That way,
> people could keep on using their existing documents. That's all.

BTW, it's trivial to add new config directives in mp2 (rather than using 
PerlSetVar). See:
http://perl.apache.org/docs/2.0/user/config/custom.html

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org