pas-dev Mailing List for Perl Application Server (Page 19)
Status: Beta
Brought to you by:
mortis
You can subscribe to this list here.
| 2002 |
Jan
|
Feb
(6) |
Mar
(19) |
Apr
(3) |
May
(147) |
Jun
(6) |
Jul
(4) |
Aug
(12) |
Sep
(1) |
Oct
(12) |
Nov
(23) |
Dec
(3) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(4) |
Feb
(12) |
Mar
(13) |
Apr
(16) |
May
(28) |
Jun
(9) |
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(84) |
Dec
(25) |
| 2004 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(13) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2005 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(5) |
Sep
(5) |
Oct
|
Nov
|
Dec
|
|
From: Kyle R . B. <mo...@vo...> - 2002-02-28 15:09:26
|
> I'm in the process of 'fixing' include files.
>
> Problem: When you include a file in a psp and up date the included file,
> but not the psp, the page doesnt rebuild.
This is a known problem, there is no dependency checking in the compiler.
There are currently two things you can do, one is set pas.psp.dynamicRecomile
to 'always' in the pas.conf file, the other is to set it to no, and manualy
build the psp cache directory using the pspBuild utility in the bin directory.
> Proposed solution: Each compiled object should have a $page->__includes()
> method that returns a list of its includes (suprise). After a page's
> timestamp is compared to the psp, the timestamps on the includes are
> checked. If any of these are newer than the page, the compiler rebuilds
> the page.
>
> I plan on making this check configuraable in teh config file. IF someone
> feels all these stat()/date checks are too expensive, they can turn them
> off. :)
Good solution. We can just enhance the compiler to keep track of the
dependant files, and store that dependency data in the compiled page
object itself, as a method that returns the static list of included
files...very good solution. It's clean, and it requires no extra
overhead on the psp developers.
Conceptualy the dependency inofrmation is a tree, but we can just
store it as an array.
As far as all the stat() checks goes, there are already 3 configuration
options: no - never recompile, yes - recompile based on mtime, and always.
Your propsed fix should modify the behavior of the 'yes' setting to
additionaly include depednecy checking.
> Hopefully I'll have more time tonight to track this down.
>
> Next on my TODO list is figuring out why it takes 2 refreshes to see the
> rebuilt page. This isnt a big deal, but it still nerves me.
>
> THe only reason I'm sending this is because if I dont brain dump now, I
> might forget later. :)
At this point, the compiler could probably use a re-write (the code isn't
the prettiest). Perhaps we should back down on the policy of few to no
external dependencies and base the compiler on HTML::Parser? I'm sure
it would end up being a whole lot cleaner and more extensible. In fact
using HTML::Parser would probably allow us to start the process of moving
towards JSP style taglibs.
Some other things I've noticed working with Pas lately are that $self->prev()
doesn't seem to be working correctly. Since it's not part of the servlet
model, maybe we just get rid of it?
Passing data to the psp from a Page object in the query object is starting
to feel wrong. The issue that caused this to itch for me was on a diagnostics
page where I was trying to dump all of the parameters from the query. I
had a page object that added data to the query, then forwarded the request
to the psp diagnostic page. In the psp page, it had code like this:
<TABLE>
<TR><TD>key</TD><TD>value</TD></TR>
<% foreach my $k ($self->query()->param()) { %>
<TR><TD><%= $k %></TD><TD><%= $self->query()->param($k) %></TD></TR>
<% } %>
</TABLE>
But the added data didn't show up in the key names returend from
$self->query()->param(). CGI.pm must be caching the originaly parsed
list of parameters - anything that get's added through a call to param(k,v)
isn't included in the list returned by param().
Perhaps we can use the reuqest object directly? Ala the servlet model?
They have a getParameter() that gives access to the GET/POST parameters,
and a getAttribute()/setAttribute() that is a storage area where the
servlet/jsp (page object/psp in our case) are supposed to use to pass
data back and forth.
The last big itch is in the forward_request() method of the page object. It
doesn't seem to work with relativly pathed requests correctly. I've had
to tweak the path to the psp page to get it to work under all circumstances.
Oh, and one last thing is PATH_INFO for registered page objects. It would
be nice of the Pas mod_perl request handler could figure out that a path
lead past a registered page object, and set the PATH_INFO accordingly.
I'll add this stuf to the TODO file.
Thanks,
Kyle
--
------------------------------------------------------------------------------
Wisdom and Compassion are inseparable.
-- Christmas Humphreys
mo...@vo... http://www.voicenet.com/~mortis
------------------------------------------------------------------------------
|
|
From: Mental <Me...@Ne...> - 2002-02-28 14:39:53
|
I'm in the process of 'fixing' include files. Problem: When you include a file in a psp and up date the included file, but not the psp, the page doesnt rebuild. Proposed solution: Each compiled object should have a $page->__includes() method that returns a list of its includes (suprise). After a page's timestamp is compared to the psp, the timestamps on the includes are checked. If any of these are newer than the page, the compiler rebuilds the page. I plan on making this check configuraable in teh config file. IF someone feels all these stat()/date checks are too expensive, they can turn them off. :) Hopefully I'll have more time tonight to track this down. Next on my TODO list is figuring out why it takes 2 refreshes to see the rebuilt page. This isnt a big deal, but it still nerves me. THe only reason I'm sending this is because if I dont brain dump now, I might forget later. :) -- Mental (Me...@Ne...) It too close to my house. I was walking from the living room to the kitchen, and the stewardess told me to sit down. --Steven Wright GPG public key: http://www.neverlight.com/Mental.asc |
|
From: Kyle R . B. <mo...@vo...> - 2002-02-26 00:03:08
|
> I have been investigating using pas for some web development. I want to
> preface this by saying thanks for the great looking tool. I much prefer
> using Perl for things but all of the packages I was find to provide some
> app server structure instead of just going with a mish-mash of cgi's
> were in Java. So thanks!
Your welcome! Thanks for the feedback.
> I have pas working pretty well under Apache/Linux/mod_perl. However, I
> also loaded it on my laptop in order to work in an off-line mode. Under
> win2000server/winApache/mod_perl and am getting errors regarding
> pathnames. It looks like
> Org::Bgw::Pas::Psp::Compiler::create_directory_for_file is unhappy with
> the fact that there is now a drive letter in front of the paths it is
> dealing with.
Yes, that's a problem. When I wrote the code I never considered Windows.
There are several functions that need to be delt with.
In Org::Bgw::Pas::Psp::Compiler, the following need to be
updated to account for pathin differences (both / vs \\ and drive
letter vs no drive letter -- maybe we can change the code to use
File::Base?).
- sub compute_pwd
- sub resolve_includes
- sub file_to_package
- sub package_to_file
- sub create_directory_for_file (as you discovered)
> Have you/do you know of anyone running under this config?
Not until now. :)
> If so I'd like to talk to them to make sure I am not reinventing the
> wheel. Otherwise if I can patch and get things working I will send the
> info along to you. I'm including the details below.
That would be awesome. I appreciate your involvement.
Oh, looking at your http.conf, is the only issue the leading drive
letter? Do we just need to keep create_directory_for_file to not
call mkdir for [ $file =~ /^[a-z]:\//i ]? Hrm...but doesn't the
[ -d $path ] return true for "d:/"?
I added your configuration of http.conf to the CVS archivea s docs/Win32.
By the way, if you want to try to just compile a PSP page, there
is a utility: bin/pspCompilePage that you can use to run/test the compiler
by hand. There is also a bin/pspBuild that will attempt to compile all
of the PSP pages under the document root.
Thanks again,
Kyle R. Burton
--
------------------------------------------------------------------------------
Wisdom and Compassion are inseparable.
-- Christmas Humphreys
mo...@vo... http://www.voicenet.com/~mortis
------------------------------------------------------------------------------
|