You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl-cvs@perl.apache.org by ri...@apache.org on 2002/02/11 18:01:08 UTC
cvs commit: embperl/Embperl/Syntax POD.pm
richter 02/02/11 09:01:08
Modified: . Tag: Embperl2c Changes.pod ep.h epapinit.c
epcgiinit.c epmain.c epprovider.c eputil.c
Embperl/Recipe Tag: Embperl2c Embperl.pm EmbperlXSLT.pm
Embperl/Syntax Tag: Embperl2c POD.pm
Log:
-
Revision Changes Path
No revision
No revision
1.129.4.45 +25 -0 embperl/Changes.pod
Index: Changes.pod
===================================================================
RCS file: /home/cvs/embperl/Changes.pod,v
retrieving revision 1.129.4.44
retrieving revision 1.129.4.45
diff -u -r1.129.4.44 -r1.129.4.45
--- Changes.pod 11 Dec 2001 09:06:40 -0000 1.129.4.44
+++ Changes.pod 11 Feb 2002 17:01:05 -0000 1.129.4.45
@@ -2,6 +2,31 @@
=head1 2.0b6
+ - Rewrote Embperl internal data structures. The Embperl request
+ structure is now splitted into thread, application, request
+ and component structure.
+ - Moved nearly all of the per request/component initialization code
+ from Perl to C. Together with the optimized data structures, this
+ speeds up request/component initialization, which is especialy a
+ performance improvmenet for pages that call do a lot calls to
+ Execute.
+ - All members of these structures now available form Perl
+ which avoids using mod_perl Apache object and enviroment
+ variables in most cases, makeing the resulting pages more
+ independend from the environment they run under. On the other
+ side this gives quite a few new possibilities to influence
+ what Embperl is doing, especialy together with Embperl::Object.
+ - Introduced new idea of an application which holds together a set
+ of pages and allows to configure the Embperl logfile and session
+ handling different for each application.
+ - Added [= foo =] block and $r -> gettext method for page localization.
+ When the page is executed the 'foo' is replaced with a localizied
+ message for the current language.
+ - Added Embperl::Object application object, which is invoked during
+ request initialization. Any application code can now go there.
+ This allows a proper separation of Code and Design and building of
+ MVC (Model, Controller, View), 2-Tier and 3-Tier applications
+ with Embperl.
- Enhanced POD parser. Now generates a similar output as pod2xml,
which is better suitable for XSLT processing. Also the POD
parser now can pasers POD out of other Embperl files.
1.27.4.42 +2 -0 embperl/ep.h
Index: ep.h
===================================================================
RCS file: /home/cvs/embperl/ep.h,v
retrieving revision 1.27.4.41
retrieving revision 1.27.4.42
diff -u -r1.27.4.41 -r1.27.4.42
--- ep.h 5 Feb 2002 09:04:03 -0000 1.27.4.41
+++ ep.h 11 Feb 2002 17:01:05 -0000 1.27.4.42
@@ -588,6 +588,8 @@
char * embperl_PathSearch (/*i/o*/ register req * r,
/*in*/ tMemPool * pPool,
/*in*/ char * sFilename) ;
+char * embperl_PathStr (/*i/o*/ register req * r,
+ /*in*/ char * sFilename) ;
AV * embperl_String2AV (/*in*/ tApp * pApp,
/*in*/ const char * sData,
/*in*/ const char * sSeparator) ;
1.1.2.16 +10 -8 embperl/epapinit.c
Index: epapinit.c
===================================================================
RCS file: /home/cvs/embperl/epapinit.c,v
retrieving revision 1.1.2.15
retrieving revision 1.1.2.16
diff -u -r1.1.2.15 -r1.1.2.16
--- epapinit.c 10 Feb 2002 21:26:14 -0000 1.1.2.15
+++ epapinit.c 11 Feb 2002 17:01:05 -0000 1.1.2.16
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: epapinit.c,v 1.1.2.15 2002/02/10 21:26:14 richter Exp $
+# $Id: epapinit.c,v 1.1.2.16 2002/02/11 17:01:05 richter Exp $
#
###################################################################################*/
@@ -282,13 +282,15 @@
pParam -> sUri = r -> uri ;
pParam -> sPathInfo = r -> path_info ;
pParam -> sQueryInfo = r -> args ;
- p = ep_pstrdup (pPool, ap_table_get (r -> headers_in, "Accept-Language")) ;
- while (isspace(*p))
- p++ ;
- pParam -> sLanguage = p ;
- while (isalpha(*p))
- p++ ;
- *p = '\0' ;
+ if (p = ep_pstrdup (pPool, ap_table_get (r -> headers_in, "Accept-Language")))
+ {
+ while (isspace(*p))
+ p++ ;
+ pParam -> sLanguage = p ;
+ while (isalpha(*p))
+ p++ ;
+ *p = '\0' ;
+ }
return ok ;
}
1.1.2.8 +10 -8 embperl/Attic/epcgiinit.c
Index: epcgiinit.c
===================================================================
RCS file: /home/cvs/embperl/Attic/epcgiinit.c,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -u -r1.1.2.7 -r1.1.2.8
--- epcgiinit.c 10 Feb 2002 21:26:14 -0000 1.1.2.7
+++ epcgiinit.c 11 Feb 2002 17:01:05 -0000 1.1.2.8
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: epcgiinit.c,v 1.1.2.7 2002/02/10 21:26:14 richter Exp $
+# $Id: epcgiinit.c,v 1.1.2.8 2002/02/11 17:01:05 richter Exp $
#
###################################################################################*/
@@ -158,13 +158,15 @@
pParam -> sUri = GetHashValueStrDup (aTHX_ pPool, pThread -> pEnvHash, "SCRIPT_NAME", "") ;
pParam -> sPathInfo = GetHashValueStrDup (aTHX_ pPool, pThread -> pEnvHash, "PATH_INFO", "") ;
pParam -> sQueryInfo = GetHashValueStrDup (aTHX_ pPool, pThread -> pEnvHash, "QUERY_STRING", "") ;
- p = GetHashValueStrDup (aTHX_ pPool, pThread -> pEnvHash, "HTTP_ACCEPT_LANGUAGE", "") ;
- while (isspace(*p))
- p++ ;
- pParam -> sLanguage = p ;
- while (isalpha(*p))
- p++ ;
- *p = '\0' ;
+ if (p = GetHashValueStrDup (aTHX_ pPool, pThread -> pEnvHash, "HTTP_ACCEPT_LANGUAGE", NULL))
+ {
+ while (isspace(*p))
+ p++ ;
+ pParam -> sLanguage = p ;
+ while (isalpha(*p))
+ p++ ;
+ *p = '\0' ;
+ }
return ok ;
}
1.75.4.98 +2 -2 embperl/epmain.c
Index: epmain.c
===================================================================
RCS file: /home/cvs/embperl/epmain.c,v
retrieving revision 1.75.4.97
retrieving revision 1.75.4.98
diff -u -r1.75.4.97 -r1.75.4.98
--- epmain.c 10 Feb 2002 21:26:14 -0000 1.75.4.97
+++ epmain.c 11 Feb 2002 17:01:05 -0000 1.75.4.98
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: epmain.c,v 1.75.4.97 2002/02/10 21:26:14 richter Exp $
+# $Id: epmain.c,v 1.75.4.98 2002/02/11 17:01:05 richter Exp $
#
###################################################################################*/
@@ -152,7 +152,7 @@
case rcExecCGIMissing: msg ="[%d]ERR: %d: %s Forbidden %s: Options ExecCGI not set in your Apache configs%s" ; break ;
case rcIsDir: msg ="[%d]ERR: %d: %s Forbidden %s is a directory%s" ; break ;
case rcXNotSet: msg ="[%d]ERR: %d: %s Forbidden %s X Bit not set%s" ; break ;
- case rcNotFound: msg ="[%d]ERR: %d: %s Not found %s%s" ; break ;
+ case rcNotFound: msg ="[%d]ERR: %d: %s Not found '%s', searched: %s" ; break ;
case rcUnknownVarType: msg ="[%d]ERR: %d: %s Type for Variable %s is unknown %s" ; break ;
case rcPerlWarn: msg ="[%d]ERR: %d: %s Warning in Perl code: %s%s" ; break ;
case rcVirtLogNotSet: msg ="[%d]ERR: %d: %s EMBPERL_VIRTLOG must be set, when dbgLogLink is set %s%s" ; break ;
1.1.2.29 +3 -1 embperl/Attic/epprovider.c
Index: epprovider.c
===================================================================
RCS file: /home/cvs/embperl/Attic/epprovider.c,v
retrieving revision 1.1.2.28
retrieving revision 1.1.2.29
diff -u -r1.1.2.28 -r1.1.2.29
--- epprovider.c 29 Jan 2002 09:13:46 -0000 1.1.2.28
+++ epprovider.c 11 Feb 2002 17:01:06 -0000 1.1.2.29
@@ -9,7 +9,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: epprovider.c,v 1.1.2.28 2002/01/29 09:13:46 richter Exp $
+# $Id: epprovider.c,v 1.1.2.29 2002/02/11 17:01:06 richter Exp $
#
###################################################################################*/
@@ -311,6 +311,7 @@
if (!pNew -> sFilename)
{
strncpy (r -> errdat1, sFilename, sizeof (r -> errdat1) - 1) ;
+ strncpy (r -> errdat2, embperl_PathStr(r, sFilename), sizeof (r -> errdat2) - 1) ;
return rcNotFound ;
}
@@ -369,6 +370,7 @@
if (!sAbsFilename)
{
strncpy (r -> errdat1, sFilename, sizeof (r -> errdat1) - 1) ;
+ strncpy (r -> errdat2, embperl_PathStr(r, sFilename), sizeof (r -> errdat2) - 1) ;
return rcNotFound ;
}
1.15.4.42 +38 -2 embperl/eputil.c
Index: eputil.c
===================================================================
RCS file: /home/cvs/embperl/eputil.c,v
retrieving revision 1.15.4.41
retrieving revision 1.15.4.42
diff -u -r1.15.4.41 -r1.15.4.42
--- eputil.c 10 Feb 2002 21:26:15 -0000 1.15.4.41
+++ eputil.c 11 Feb 2002 17:01:06 -0000 1.15.4.42
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: eputil.c,v 1.15.4.41 2002/02/10 21:26:15 richter Exp $
+# $Id: eputil.c,v 1.15.4.42 2002/02/11 17:01:06 richter Exp $
#
###################################################################################*/
@@ -1561,12 +1561,48 @@
fn = ep_pstrcat(r -> pPool, SvPV(*av_fetch (pPathAV, i, 0), l), PATH_SEPARATOR_STR, sFilename, NULL) ;
if (stat (fn, &st) == 0)
{
- r -> Component.nPathNdx = i ;
+ r -> Component.nPathNdx = skip ;
return embperl_File2Abs (r, pPool, fn) ;
}
}
return NULL ;
+ }
+
+/* ---------------------------------------------------------------------------- */
+/* */
+/* Path str */
+/* */
+/* ---------------------------------------------------------------------------- */
+
+char * embperl_PathStr (/*i/o*/ register req * r,
+ /*in*/ char * sFilename)
+
+ {
+ epTHX_
+ AV *pPathAV = r -> Config.pPathAV ;
+ int skip = r -> Component.pPrev?r -> Component.pPrev -> nPathNdx:0 ;
+ int i ;
+ char * fn ;
+ char * pPath = "" ;
+ STRLEN l ;
+
+ if (isAbsPath(sFilename) || !pPathAV || AvFILL (pPathAV) < r -> Component.nPathNdx)
+ return embperl_File2Abs (r, r -> pPool, sFilename) ;
+
+ while (sFilename[0] == '.' && sFilename[1] == '.' && (sFilename[2] == '/' || sFilename[2] == '\\'))
+ {
+ skip++ ;
+ sFilename += 3 ;
+ }
+
+ for (i = skip ; i <= AvFILL (pPathAV); i++)
+ {
+ fn = ep_pstrcat(r -> pPool, SvPV(*av_fetch (pPathAV, i, 0), l), PATH_SEPARATOR_STR, sFilename, NULL) ;
+ pPath = ep_pstrcat(r -> pPool, pPath, fn, ";", NULL) ;
+ }
+
+ return pPath ;
}
No revision
No revision
1.1.2.14 +21 -19 embperl/Embperl/Recipe/Attic/Embperl.pm
Index: Embperl.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl/Recipe/Attic/Embperl.pm,v
retrieving revision 1.1.2.13
retrieving revision 1.1.2.14
diff -u -r1.1.2.13 -r1.1.2.14
--- Embperl.pm 7 Feb 2002 06:56:20 -0000 1.1.2.13
+++ Embperl.pm 11 Feb 2002 17:01:07 -0000 1.1.2.14
@@ -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.1.2.13 2002/02/07 06:56:20 richter Exp $
+# $Id: Embperl.pm,v 1.1.2.14 2002/02/11 17:01:07 richter Exp $
#
###################################################################################
@@ -33,34 +33,36 @@
sub new
{
- my ($class, $r, $recipe) = @_ ;
+ my ($class, $r, $recipe, $src, $syntax) = @_ ;
my $self ;
- my $src ;
my $param = $r -> component -> param ;
my $config = $r -> component -> config ;
my $file = $param -> inputfile ;
die "no filename" if (!$file) ;
- if (ref $param -> input)
+ if (!$src)
{
- $src =
+ if (ref $param -> input)
{
- 'type' => 'memory',
- #'name' => $param -> inputfile,
- #'source' => $param -> input,
- #'mtime' => $param -> mtime,
- } ;
- }
- else
- {
- $src =
+ $src =
+ {
+ 'type' => 'memory',
+ #'name' => $param -> inputfile,
+ #'source' => $param -> input,
+ #'mtime' => $param -> mtime,
+ } ;
+ }
+ else
{
- 'type' => 'file',
- #'filename' => $file,
- 'cache' => 0,
- } ;
+ $src =
+ {
+ 'type' => 'file',
+ #'filename' => $file,
+ 'cache' => 0,
+ } ;
+ }
}
my $import =
@@ -75,7 +77,7 @@
'provider' =>
{
'type' => 'epparse',
- #'syntax' => $config -> syntax || 'Embperl',
+ $syntax?('syntax' => $syntax):(),
'source' =>
{
'cache' => 0,
1.1.2.9 +3 -7 embperl/Embperl/Recipe/Attic/EmbperlXSLT.pm
Index: EmbperlXSLT.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl/Recipe/Attic/EmbperlXSLT.pm,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -u -r1.1.2.8 -r1.1.2.9
--- EmbperlXSLT.pm 7 Feb 2002 06:56:20 -0000 1.1.2.8
+++ EmbperlXSLT.pm 11 Feb 2002 17:01:07 -0000 1.1.2.9
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: EmbperlXSLT.pm,v 1.1.2.8 2002/02/07 06:56:20 richter Exp $
+# $Id: EmbperlXSLT.pm,v 1.1.2.9 2002/02/11 17:01:07 richter Exp $
#
###################################################################################
@@ -35,9 +35,9 @@
sub new
{
- my ($class, $r, $recipe) = @_ ;
+ my ($class, $r, $recipe, $src, $syntax) = @_ ;
- my $ep = Embperl::Recipe::Embperl -> new ($r, $recipe) ;
+ my $ep = Embperl::Recipe::Embperl -> new ($r, $recipe, $src, $syntax) ;
#return $ep if ($r -> IsImport) ;
my $param = $r -> component -> param ;
return $ep if ($param -> import >= 0) ;
@@ -46,10 +46,6 @@
my $file = $param -> inputfile ;
my $xsltproc = $config -> xsltproc ;
my $xsltparam = $param -> xsltparam || \%Embperl::fdat ;
-
- use Data::Dumper ;
- print Embperl::LOG 'xsltparam = ', Dumper ($xsltparam, $xsltproc, $config -> xsltstylesheet) ;
-
my $self =
{
No revision
No revision
1.1.2.9 +2 -1 embperl/Embperl/Syntax/Attic/POD.pm
Index: POD.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl/Syntax/Attic/POD.pm,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -u -r1.1.2.8 -r1.1.2.9
--- POD.pm 22 Jan 2002 09:29:56 -0000 1.1.2.8
+++ POD.pm 11 Feb 2002 17:01:08 -0000 1.1.2.9
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: POD.pm,v 1.1.2.8 2002/01/22 09:29:56 richter Exp $
+# $Id: POD.pm,v 1.1.2.9 2002/02/11 17:01:08 richter Exp $
#
###################################################################################
@@ -54,6 +54,7 @@
$self -> {-PODTags} = $self -> CloneHash (\%Search) ;
$self -> AddToRoot ($self -> {-PODTags}) ;
+ $self -> AddInitCode (undef, '$escmode = 15;', undef) ;
#$self -> AddToRoot ({'-defnodetype' => ntypText,}) ;
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-cvs-help@perl.apache.org