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 2004/04/02 07:10:41 UTC

cvs commit: embperl/xsbuilder/maps ep_structure.map

richter     2004/04/01 21:10:41

  Modified:    .        Changes.pod Embperl.pm epcfg.h epdat2.h
               Embperl  Object.pm
               podsrc   Config.spod
               xsbuilder/maps ep_structure.map
  Log:
  embperl_object_reqpath
  
  Revision  Changes    Path
  1.239     +7 -0      embperl/Changes.pod
  
  Index: Changes.pod
  ===================================================================
  RCS file: /home/cvs/embperl/Changes.pod,v
  retrieving revision 1.238
  retrieving revision 1.239
  diff -u -r1.238 -r1.239
  --- Changes.pod	15 Mar 2004 06:21:31 -0000	1.238
  +++ Changes.pod	2 Apr 2004 05:10:41 -0000	1.239
  @@ -1,5 +1,12 @@
   =pod
   
  +=head1 2.0b12
  +
  +This version is currently under developement. You can get it from the L<CVS|CVS.pod>.
  +
  +   - Addeded configuration directive Embperl_Object_Reqpath, which allows to
  +     search serveral directories for the file of the initial request.
  +
   =head1 2.0b11  15. March 2004
   
      - Fixed problem with JavaScript code in Form::Validate, when fields names
  
  
  
  1.188     +2 -3      embperl/Embperl.pm
  
  Index: Embperl.pm
  ===================================================================
  RCS file: /home/cvs/embperl/Embperl.pm,v
  retrieving revision 1.187
  retrieving revision 1.188
  diff -u -r1.187 -r1.188
  --- Embperl.pm	15 Mar 2004 06:21:31 -0000	1.187
  +++ Embperl.pm	2 Apr 2004 05:10:41 -0000	1.188
  @@ -218,8 +218,7 @@
   
       my $cgi = new CGI ;
       my $fdat = $self -> thread -> form_hash ;
  -    my $fdatsplit = $self -> thread -> form_split_hash ;
  -    $fdatsplit -> {'___CGI___'} = $cgi ; # keep it until then end of the request
  +    $self -> param -> cgi ($cgi) ;       # keep it until then end of the request
   					 # otherwsie templ files be
   					 # destroyed in CGI.pm 3.01+
       my $ffld = $self -> thread -> form_array ;
  
  
  
  1.6       +1 -0      embperl/epcfg.h
  
  Index: epcfg.h
  ===================================================================
  RCS file: /home/cvs/embperl/epcfg.h,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- epcfg.h	22 Jan 2004 22:44:13 -0000	1.5
  +++ epcfg.h	2 Apr 2004 05:10:41 -0000	1.6
  @@ -71,6 +71,7 @@
   EPCFG_STR(AppConfig,     char *,  sObjectBase,      OBJECT_BASE)
   EPCFG_STR(AppConfig,     char *,  sObjectApp,       OBJECT_APP)
   EPCFG_AV (AppConfig,     AV *,    pObjectAddpathAV, OBJECT_ADDPATH, SEPARATOR)
  +EPCFG_AV (AppConfig,     AV *,    pObjectReqpathAV, OBJECT_REQPATH, SEPARATOR)
   EPCFG_STR(AppConfig,     char *,  sObjectStopdir,   OBJECT_STOPDIR)
   EPCFG_STR(AppConfig,     char *,  sObjectFallback,  OBJECT_FALLBACK)
   EPCFG_STR(AppConfig,     char *,  sObjectHandlerClass, OBJECT_HANDLER_CLASS)
  
  
  
  1.8       +4 -2      embperl/epdat2.h
  
  Index: epdat2.h
  ===================================================================
  RCS file: /home/cvs/embperl/epdat2.h,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- epdat2.h	23 Jan 2004 06:50:55 -0000	1.7
  +++ epdat2.h	2 Apr 2004 05:10:41 -0000	1.8
  @@ -125,6 +125,7 @@
       char *  sQueryInfo ;
       char *  sLanguage ;         /**< Language for the current request */
       HV *    pCookies ;          /**< Received Cookies */
  +    SV *    pCGISV ;            /**< CGI Object which hold upload data */
       } tReqParam ;
   
   typedef struct tAppConfig
  @@ -156,7 +157,8 @@
       int     nMailErrorsResendTime ;
       char *  sObjectBase ;
       char *  sObjectApp ;
  -    AV *    pObjectAddpathAV ;
  +    AV *    pObjectAddpathAV ;  /**< add to search path */
  +    AV *    pObjectReqpathAV ;  /**< search this directries for requested documents */
       char *  sObjectStopdir ;
       char *  sObjectFallback ;
       char *  sObjectHandlerClass ;
  
  
  
  1.7       +24 -1     embperl/Embperl/Object.pm
  
  Index: Object.pm
  ===================================================================
  RCS file: /home/cvs/embperl/Embperl/Object.pm,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Object.pm	15 Mar 2004 06:21:31 -0000	1.6
  +++ Object.pm	2 Apr 2004 05:10:41 -0000	1.7
  @@ -165,6 +165,7 @@
       my $basename  = $appcfg -> object_base || '_base.epl' ;
       ##$basename     =~ s/%modifier%/$req->{object_base_modifier}/ ;
       my $addpath   = $appcfg -> object_addpath ;
  +    my $reqpath   = $appcfg -> object_reqpath ;
       my $directory ;
       my $rootdir   = $apr?norm_path ($apr -> document_root, $cwd):"$volume/" ;
       my $stopdir   = norm_path ($appcfg -> object_stopdir, $cwd) ;
  @@ -309,7 +310,29 @@
                   }
               }
   
  +
  +
  +        my $file_not_found = 0 ;
           if (!-f $filename)
  +            {
  +            $file_not_found = 1 ;
  +            if ($reqpath)
  +                {
  +                my $file = basename ($filename) ;
  +                foreach my $path (@$reqpath)
  +                    {
  +                    my $testfn = "$path/$file" ;
  +                    if (-f $testfn)
  +                        {
  +                        $filename = $testfn ;
  +                        $file_not_found = 0 ;
  +                        last ;
  +                        }
  +                    }
  +                }
  +            }
  +
  +        if ($file_not_found)
               {
               if ($appcfg -> object_fallback)
                   {
  
  
  
  1.11      +22 -1     embperl/podsrc/Config.spod
  
  Index: Config.spod
  ===================================================================
  RCS file: /home/cvs/embperl/podsrc/Config.spod,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Config.spod	7 Mar 2004 19:44:14 -0000	1.10
  +++ Config.spod	2 Apr 2004 05:10:41 -0000	1.11
  @@ -594,13 +594,29 @@
   
   =head2 *CFG $application / Embperl_OBJECT_ADDPATH / object_addpath / 1.3b1 / no 
   
  -Additional directories where Embperl::Object searches for pages. 
  +Additional directories where Embperl::Object searches for pages.
  +This search through the searchpath is always performed if in a call to Execute no path for the
  +file is given.
  + 
   In F<httpd.conf> or as evironment variable directories are
   separated by C<;> (on Unix C<:> works also). The parameter for C<Execute> and
   the application object method expects/returns an array reference.
   This path is
   B<always> appended to the searchpath.
   
  +=head2 *CFG $application / Embperl_OBJECT_REQPATH / object_reqpath / 2.0b12 / no 
  +
  +Additional directories where Embperl::Object searches for files for the inital request.
  +If a file is requested, but cannot be found at the given location, the directories
  +given in the this path are additionaly search for the file. This applies only to
  +the initial filename given to Embperl::Object and B<not> to files called via
  +Execute.  
  + 
  +In F<httpd.conf> or as evironment variable directories are
  +separated by C<;> (on Unix C<:> works also). The parameter for C<Execute> and
  +the application object method expects/returns an array reference.
  +
  +
   
   =head2 *CFG $application / Embperl_OBJECT_STOPDIR / object_stopdir / 1.3b1 / no 
   
  @@ -1216,6 +1232,11 @@
   
   A hashref that contains all cookies send by the browser to the server.
   
  +=head2 *PARAM $request / / cgi  / 2.0b12 / no
  +
  +Holds the CGI.pm object, which is used for file upload. If no file uploaded data
  +is send tho the request, this member is undefined.
  +
   =head2 *PARAM $component / / inputfile / 1.0.0 / no
   
   Give the name of the file that should be processed, e.g.
  
  
  
  1.6       +4 -2      embperl/xsbuilder/maps/ep_structure.map
  
  Index: ep_structure.map
  ===================================================================
  RCS file: /home/cvs/embperl/xsbuilder/maps/ep_structure.map,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ep_structure.map	22 Jan 2004 22:44:13 -0000	1.5
  +++ ep_structure.map	2 Apr 2004 05:10:41 -0000	1.6
  @@ -46,7 +46,7 @@
      lastwarn[ERRDATLEN] | lastwarn
   !   pDomTreeAV | dom_tree_av
      pCleanupAV | cleanup_vars
  -   pCleanupPackagesHV | cleanup_packages
  +   pCleanupPackagesHV | cleanup_packages
      sInitialCWD | initial_cwd
      pMessages | messages
      pDefaultMessages | default_messages
  @@ -108,7 +108,8 @@
      nMailErrorsResendTime | mail_errors_resend_time
      sObjectBase | object_base
      sObjectApp | object_app
  -   pObjectAddpathAV | object_addpath
  +   pObjectAddpathAV | object_addpath
  +   pObjectReqpathAV | object_reqpath
      sObjectStopdir | object_stopdir
      sObjectFallback | object_fallback
      sObjectHandlerClass | object_handler_class
  @@ -249,6 +250,7 @@
      sQueryInfo | query_info
      sLanguage | language
      pCookies | cookies
  +   pCGISV | cgi
      new
   !   private
    </tReqParam>
  
  
  

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