richter 00/08/23 22:43:41
Modified: . Changes.pod Embperl.pm Embperl.pod EmbperlD.pod
EmbperlObject.pm MANIFEST test.pl
test/conf httpd.conf.src
Log:
- Changed EmbperlObject search order:
* If EMBPERL_OBJECT_STOPDIR is set, this directory is taken as
the last directory in the normal search path, instead of the
directory where the base template (EMBPERL_OBJECT_BASE) is found.
* EMBPERL_OBJECT_ADDPATH is _always_ added to the search path
- Added Test for pnotes ('EMBPERL_ERRORS')
Revision Changes Path
1.126 +6 -0 embperl/Changes.pod
Index: Changes.pod
===================================================================
RCS file: /home/cvs/embperl/Changes.pod,v
retrieving revision 1.125
retrieving revision 1.126
diff -u -r1.125 -r1.126
--- Changes.pod 2000/08/21 04:22:47 1.125
+++ Changes.pod 2000/08/24 05:43:39 1.126
@@ -6,6 +6,12 @@
NOTE: This version is only available via L<"CVS"|CVS/"INTRO">
+ - Changed EmbperlObject search order:
+ * If EMBPERL_OBJECT_STOPDIR is set, this directory is taken as
+ the last directory in the normal search path, instead of the
+ directory where the base template (EMBPERL_OBJECT_BASE) is found.
+ * EMBPERL_OBJECT_ADDPATH is _always_ added to the search path
+ - Added Test for pnotes ('EMBPERL_ERRORS')
- Fixed a problem with importing files that contains foreach and
do until loops, which may caused a syntax error or endless
loop. Spotted by Steffen Geschke.
1.114 +5 -0 embperl/Embperl.pm
Index: Embperl.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl.pm,v
retrieving revision 1.113
retrieving revision 1.114
diff -u -r1.113 -r1.114
--- Embperl.pm 2000/08/21 04:22:47 1.113
+++ Embperl.pm 2000/08/24 05:43:39 1.114
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: Embperl.pm,v 1.113 2000/08/21 04:22:47 richter Exp $
+# $Id: Embperl.pm,v 1.114 2000/08/24 05:43:39 richter Exp $
#
###################################################################################
@@ -1245,6 +1245,11 @@
$req_rec -> pnotes ('EMBPERL_ERRORS', \@errors) if (defined (&Apache::pnotes))
;
my $rc = Execute (\%req) ;
+
+ print LOG "errors1=@errors\n" ;
+
+ my $e = $req_rec -> pnotes ('EMBPERL_ERRORS') ;
+ print LOG "errors2=@$e\n" ;
#log_svs ("handler exit") ;
return $rc ;
1.54 +6 -1 embperl/Embperl.pod
Index: Embperl.pod
===================================================================
RCS file: /home/cvs/embperl/Embperl.pod,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- Embperl.pod 2000/08/20 18:56:52 1.53
+++ Embperl.pod 2000/08/24 05:43:39 1.54
@@ -561,7 +561,12 @@
With this option set Embperl sends no output in case of an error, instead
it returns the error back to Apache or the calling programm. When running
under mod_perl this gives you the chance to use the Apache I<ErrorDocument>
-directive to show a custom error-document.
+directive to show a custom error-document. Inside the ErrorDocument
+you can retrieve the error messages with
+
+ $errors = $req_rec -> prev -> pnotes('EMBPERL_ERRORS') ;
+
+where C<$errors> is a array reference. (1.3b5+)
=item optSafeNamespace = 4
1.27 +7 -1 embperl/EmbperlD.pod
Index: EmbperlD.pod
===================================================================
RCS file: /home/cvs/embperl/EmbperlD.pod,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- EmbperlD.pod 2000/08/20 18:56:52 1.26
+++ EmbperlD.pod 2000/08/24 05:43:39 1.27
@@ -502,7 +502,13 @@
Wenn diese Option gesetzt ist, sendet Embperl keine Fehlerseite, sondern
liefert den Fehlercode an Apache oder das aufrufende Programm zur�ck.
Unter I<Apache> erm�glicht dies die C<ErrorDocument> Anweisung zu benutzen,
-um eine eigene Fehlerseite anzuzeigen.
+um eine eigene Fehlerseite anzuzeigen. Innerhalb des ErrorDokuments ist es
+m�glich die Embperlfehlermeldungen mittels
+
+ $errors = $req_rec -> prev -> pnotes('EMBPERL_ERRORS') ;
+
+zu ermitteln, wobei C<$errors> eine Arrayreferenz ist. (1.3b5+)
+
=item optSafeNamespace = 4
1.36 +14 -4 embperl/EmbperlObject.pm
Index: EmbperlObject.pm
===================================================================
RCS file: /home/cvs/embperl/EmbperlObject.pm,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- EmbperlObject.pm 2000/08/17 07:31:57 1.35
+++ EmbperlObject.pm 2000/08/24 05:43:40 1.36
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: EmbperlObject.pm,v 1.35 2000/08/17 07:31:57 richter Exp $
+# $Id: EmbperlObject.pm,v 1.36 2000/08/24 05:43:40 richter Exp $
#
###################################################################################
@@ -180,7 +180,7 @@
my $fn ;
my $ap ;
- my $ldir ;
+ my $ldir = '' ;
my $found = 0 ;
my $fallback = 0 ;
@@ -203,13 +203,20 @@
}
while (!$found && $ldir ne $rootdir && $ldir ne $stopdir && $directory ne '/'
&& $directory ne '.' && $directory ne $ldir) ;
+ while ($found && $stopdir && $stopdir ne $directory && $directory ne '/' &&
$directory ne '.' && $directory ne $ldir)
+ {
+ $ldir = $directory ;
+ $directory = dirname ($directory) ;
+ $searchpath .= ";$directory" ;
+ }
+
+ $searchpath .= ";$addpath" if ($addpath) ;
if (!$found)
{
foreach $ap (@addpath)
{
next if (!$ap) ;
$fn = "$ap/$basename" ;
- $searchpath .= ";$ap" ;
print HTML::Embperl::LOG "[$$]EmbperlObject Check for base: $fn\n" if
($debug);
if (-e $fn)
{
@@ -309,13 +316,15 @@
offline and helps you to
build a whole page out of smaller parts. Basicly it does the following:
-When a request comes in a page, which name is specified by L<EMBPERL_OBJECT_BASE>,
is
+When a request comes in, a page, which name is specified by L<EMBPERL_OBJECT_BASE>,
is
searched in the same directory as the requested page. If the pages isn't found,
I<EmbperlObject> walking up the directory tree until it finds the page, or it
reaches C<DocumentRoot> or the directory specified by L<EMBPERL_OBJECT_STOPDIR>.
This page is then called as frame for building the real page. Addtionaly
I<EmbperlObject>
sets the search path to contain all directories it had to walk before finding that
page.
+If L<EMBPERL_OBJECT_STOPDIR> is set the path contains all directories up to the
+in EMBPERL_OBJECT_STOPDIR specified one.
This frame page can now include other pages, using the C<HTML::Embperl::Execute>
method.
Because the search path is set by I<EmbperlObject> the included files are searched
in
@@ -362,7 +371,8 @@
=head2 EMBPERL_OBJECT_ADDPATH
Additional directories where to search for pages. Directories are
-separated by C<;> (on Unix C<:> works also)
+separated by C<;> (on Unix C<:> works also). This path is
+B<always> appended to the searchpath.
=head2 EMBPERL_OBJECT_FALLBACK
1.47 +9 -0 embperl/MANIFEST
Index: MANIFEST
===================================================================
RCS file: /home/cvs/embperl/MANIFEST,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- MANIFEST 2000/08/21 04:22:48 1.46
+++ MANIFEST 2000/08/24 05:43:40 1.47
@@ -61,6 +61,7 @@
test/html/notallow.xhtm
test/html/noerr/noerrpage.htm
test/html/errdoc/errdoc.htm
+test/html/errdoc/epl/errdoc2.htm
test/html/errmsg.htm
test/html/escape.htm
test/html/spaces.htm
@@ -146,6 +147,11 @@
test/html/EmbperlObject/obj/epoobj2.htm
test/html/EmbperlObject/obj/epoobj3.htm
test/html/EmbperlObject/obj/epoobj4.htm
+test/html/EmbperlObject/base2/epobase2.htm
+test/html/EmbperlObject/base2/epostopdir.htm
+test/html/EmbperlObject/base3/epobaselib.htm
+test/html/EmbperlObject/lib/epobase3.htm
+test/html/EmbperlObject/lib/epolib.htm
test/cmp/ascii
test/cmp/pure.htm
test/cmp/plain.htm
@@ -212,6 +218,7 @@
test/cmp/mdatsess.htm
test/cmp/execgetsess.htm
test/cmp/errdoc.htm
+test/cmp/errdoc2.htm
test/cmp/clearsess.htm
test/cmp/epopage1.htm
test/cmp/epodiv.htm
@@ -221,6 +228,8 @@
test/cmp/epoobj3.htm
test/cmp/epoobj4.htm
test/cmp/eponotfound.htm
+test/cmp/epostopdir.htm
+test/cmp/epobaselib.htm
test/conf/httpd.conf.src
test/conf/startup.pl
test/conf/startup_dso.pl
1.67 +3 -0 embperl/test.pl
Index: test.pl
===================================================================
RCS file: /home/cvs/embperl/test.pl,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -r1.66 -r1.67
--- test.pl 2000/08/21 04:22:48 1.66
+++ test.pl 2000/08/24 05:43:40 1.67
@@ -19,6 +19,7 @@
'notallow.xhtm???1',
'noerr/noerrpage.htm???8?2',
'errdoc/errdoc.htm???8?262144',
+ 'errdoc/epl/errdoc2.htm???8?262144',
'rawinput/rawinput.htm????16',
'var.htm',
'varerr.htm???-1',
@@ -103,6 +104,8 @@
'EmbperlObject/obj/epoobj2.htm',
'EmbperlObject/obj/epoobj3.htm',
'EmbperlObject/obj/epoobj4.htm',
+ 'EmbperlObject/base2/epostopdir.htm',
+ 'EmbperlObject/base3/epobaselib.htm',
) ;
@tests2 = (
1.23 +29 -1 embperl/test/conf/httpd.conf.src
Index: httpd.conf.src
===================================================================
RCS file: /home/cvs/embperl/test/conf/httpd.conf.src,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- httpd.conf.src 2000/08/16 05:34:58 1.22
+++ httpd.conf.src 2000/08/24 05:43:41 1.23
@@ -185,6 +185,14 @@
ErrorDocument 500 /html/errmsg.htm
</Location>
+<Location /embperl/errdoc/epl>
+SetHandler perl-script
+PerlHandler HTML::Embperl
+Options ExecCGI
+PerlSetEnv EMBPERL_OPTIONS 262144
+ErrorDocument 500 /embperl/errmsg2.htm
+</Location>
+
<Location /embperl/match>
@@ -281,7 +289,28 @@
Options ExecCGI
</Location>
+<Location /embperl/EmbperlObject/base3>
+PerlSetEnv EMBPERL_OBJECT_BASE epobase3.htm
+PerlSetEnv EMBPERL_OBJECT_STOPDIR $EPPATH/test/html/EmbperlObject
+PerlSetEnv EMBPERL_OBJECT_ADDPATH $EPPATH/test/html/EmbperlObject/lib
+PerlSetEnv EMBPERL_OBJECT_FALLBACK epofallback.htm
+PerlSetEnv EMBPERL_FILESMATCH \"\\.htm.?\$|\\.epl\$\"
+SetHandler perl-script
+PerlHandler HTML::EmbperlObject
+Options ExecCGI
+</Location>
+<Location /embperl/EmbperlObject/base2>
+PerlSetEnv EMBPERL_OBJECT_BASE epobase2.htm
+PerlSetEnv EMBPERL_OBJECT_STOPDIR $EPPATH/test/html/EmbperlObject
+PerlSetEnv EMBPERL_OBJECT_ADDPATH $EPPATH/test/html/EmbperlObject/lib
+PerlSetEnv EMBPERL_OBJECT_FALLBACK epofallback.htm
+PerlSetEnv EMBPERL_FILESMATCH \"\\.htm.?\$|\\.epl\$\"
+SetHandler perl-script
+PerlHandler HTML::EmbperlObject
+Options ExecCGI
+</Location>
+
<Location /embperl/EmbperlObject>
PerlSetEnv EMBPERL_OBJECT_BASE epobase.htm
PerlSetEnv EMBPERL_OBJECT_FALLBACK epofallback.htm
@@ -290,7 +319,6 @@
PerlHandler HTML::EmbperlObject
Options ExecCGI
</Location>
-
<Location /eg>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]