You are viewing a plain text version of this content. The canonical link for it is here.
Posted to asp@perl.apache.org by constfilin <co...@yahoo.com> on 2002/03/29 07:43:27 UTC

virtual includes

Greetings -

I'm a newbie to Perl and - so much the more - Apache::ASP,
but when I needed <!--#include virtual=...-> support by
Apache::ASP, all I had to do is changing a couple of lines
in Apache/ASP.pm module. Here's the diff's output :

<DIFF_OUTPUT>
921c921
<     while($munge =~ s/^(.*?)\<!--\#include\s+(file|virtual)
\s*=\s*\"?([^\s\"]*?)\"?(\s+args\s*=\s*\"?.*?)?\"?\s*--\>//so) {
---
>     while($munge =~ s/^(.*?)\<!--\#include\s+file\s*=\s*\"?([^\s\"]
*?)\"?(\s+args\s*=\s*\"?.*?)?\"?\s*--\>//so) {
923c923
<  my $file = ($2 eq "virtual") ? $ENV{"DOCUMENT_ROOT"}.$3 : $3;
---
>  my $file = $2;
950c950
<  my $has_args = $4;
---
>  my $has_args = $3;
</DIFF_OUTPUT>

After that I restarted httpd and virtual inline includes began
working just fine.

The questions:

1. Does my implementation look too easy to be right?
2. Is it a "no-no" to modify the standard ASP.pm module?
3. Is there is a bug in my implementation of virtual includes?
4. Is there is a better, *right* implementation of virtual
   includes in Apache::ASP. If so then what is it?
5. If my implementation is good enough then how do I submit 
   a patch to the standard Apache::ASP distribution?

Thanks in advance

Constantine

   



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


Re: virtual includes

Posted by Joshua Chamas <jo...@chamas.com>.
constfilin wrote:
> 
> Greetings -
> 
> I'm a newbie to Perl and - so much the more - Apache::ASP,
> but when I needed <!--#include virtual=...-> support by
> Apache::ASP, all I had to do is changing a couple of lines
> in Apache/ASP.pm module. Here's the diff's output :
> 

Virtual includes for Apache::ASP are handled by hooking
Apache::ASP to Apache::SSI with the help of Apache::Filter.
For more about this, please see:

  http://apache-asp.org/config.html#Filter

File includes are handled natively so that the file includes
could be ASP code bits, but virtual includes are handled via
SSI so that the URLs could be referencing things like CGI scripts,
and other non-ASP executables.

--Josh

_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks Founder                       Huntington Beach, CA  USA 
http://www.nodeworks.com                1-714-625-4051

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


Re: virtual includes

Posted by eamondaly <ea...@fastweb.com>.
--- In apache-asp@y..., "constfilin" <co...@y...> wrote:
> 4. Is there is a better, *right* implementation of virtual
>    includes in Apache::ASP. If so then what is it?

You can get the same thing using the more ASP-ish:

<% $Response->Include( $Server->MapPath("/foo.html") ) %>

$Server->MapPath will translate a URL to a fill filename. See

  http://www.apache-asp.org/objects.html#%24Response-%3EI2a8df2f3

and

  http://www.apache-asp.org/objects.html#%24Server-%3EMap0fe1ebb5


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