[RFC] JAF - Just Another Framework

2002-02-17 Thread Gregory Belenky

CONTENTS
  I. THE PAST
  II. THE PRESENT
  III. THE FUTURE
  IV. THE CODE
  V. THE AUTHOR

I. THE PAST

Three yars ago we (http://www.webzavod.ru/ -- sorry, russian version only)
moved from Win+IIS to Linux+Apche and rewrote our projects. But our quest
for the best wasn't stopped. The general idea was to find the way to
separate
HTML and Perl, because programming and design teams must work with project
files together.

The second step in the mod_perl world was to create some projects based on
Apache::Registry+Template-Toolkit. This scheme solved the problem of
collaborating
programmers and designers but we still needed more simplicity and
flexibility --
to create new projects based on the previous ones (I think this is the main
webmaster|webdesigner|webprogrammer's task).
At the same time we tried to use AxKit (with XPathScript transformations)
with no
success because it was on the very early development stage.

Then there were Apache::Dispatch, our own module based on it and other
related
options. But it was hard to extract the base, and each project started with
simple templates and code copying. We use simple-power apache config, so we
need
to copy virtual host config (including rewrite rules too).

II. THE PRESENT

There is many template-driven site engines. Each of them have different
templates syntax and configuration parameters. But they are writtn on Perl
and
why you should learn another 'language' additional to Perl?

There is many techniques to create dynamic and semi-dynamic sites. Some of
them
are good (SSI for simple static sites, Apache::Registry -- easy step from
CGI to
mod_perl), some are best (Apache handler for it's performance). So there
must be
a compromise between ease of use and performance. Easy to use, easy to
create dynamic
site, and more important -- easy to support it. So even a mod_perl-novice
would
create a good site without learning new (of course except Perl itself, and
Template-Toolkit) programming and markup language.

We develope the Module that will be capable of:
  * use simple interface for dynamic site creating (and dynamic parts for
any almost static site);
  * use simple urls with no query strings at all;
  * use smart templates (standard header and footer, for example).

That very early beta works on:
  * http://www.neftechimia.ru/en/  -- business site
  * http://review.samara.ru/   -- newspaper site

Note that the module is filter-aware and on Neftechimia there is AxKit
postprocessing
(that slowers down overall request performance six(!!!) times (I think this
may be changed
with new AxKit's Provider) but simplifies site supporting for
non-professional webmaster
-- all templates may be changed through the web-interface)

III. THE FUTURE

Though we need some advices:
  * is there any need for such thing?
  * if so, which name we should choose (it's Apache::Site for now)?
  * what features must it also have?
  * what do you think about it?

IV. THE CODE

As I said above it is very early beta. No POD, Comments only.
  * http://www.webzavod.ru/software/Apache-Site-0.36.tar.gz

V. THE AUTHOR

Gregory Grishace [gree-shah-s] Belenky
WebZavod (http://www.webzavod.ru/) programmer







Segmentation fault

2002-02-08 Thread Gregory Belenky

Just found that Apache::Util::unescape_uri when gets undefined value as
parameter not returns undefined value, but make SUBJ!
Why that's happens?

And one more question.

We have well-known-2-apaches-config and when the power one gets SF, the
simple returns and logs 502 Proxy error to the _virtual host_ error_log.
And  mod_perl-powered server logs SF to the _server_ log. Comparing time of
two errors we can get request, that leads to this error.

And the question is: if we have to use one mod_perl-powered Apache - how we
can find request, that breaks server?
(we have more than 100 virtual hosts of our customers and that will be
PITA - found the error request)

Gregory Belenky
WebZavod (http://www.webzavod.ru) programmer









[BUG] Can't use parameters-refernces in $r-print using Apache::Filter

2002-02-06 Thread Gregory Belenky

One of the $r-print()'s declared abilities is to pass reference in place of
scalar value (to prevent unneeded copying of large strings).

But when I use Apache::Filter and pass my output to another handler (module)
I can't use this feature.
IMHO that's because Apache::Filter-print uses

print STDOUT @_

in place of

print STDOUT ref $_ ? $$_ : $_ foreach (@_)

Am I right or what?
Dirty hack on Apache::Filter sources solved the problem.

P.S.
$Apache::Filter::VERSION == '1.019'