~ubuntu-branches/debian/sid/libembperl-perl/sid

« back to all changes in this revision

Viewing changes to Config.pod

  • Committer: Bazaar Package Importer
  • Author(s): Angus Lees
  • Date: 2004-02-15 14:23:39 UTC
  • Revision ID: james.westby@ubuntu.com-20040215142339-n21gqf7mx9tmyb8d
Tags: upstream-2.0b10
ImportĀ upstreamĀ versionĀ 2.0b10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
 
 
3
=head1 NAME
 
4
 
 
5
Configuration and calling
 
6
 
 
7
=head1 Operating-Modes
 
8
 
 
9
Embperl can operate in one of four modes:
 
10
 
 
11
=over
 
12
 
 
13
=item mod_perl
 
14
 
 
15
The mostly used way is to use Embperl together with mod_perl and Apache.
 
16
This gives the best performance and the most possibilities.
 
17
 
 
18
=item CGI/FastCGI
 
19
 
 
20
When you want to run Embperl on a machine that doesn't have mod_perl, you
 
21
can run Embperl also as normal CGI script. Due to the overhead of CGI,
 
22
this mode is much slower. To get a better performance you should consider
 
23
using Embperl together with FastCGI. (http://www.fastcgi.com). 
 
24
 
 
25
=item Offline
 
26
 
 
27
You can use Embperl also on the command line. This is usefull for generating
 
28
static content out of dynamic pages and can sometime be helpfull for testing.
 
29
 
 
30
=item Call it from other Perl programms
 
31
 
 
32
If you have your own application and want to use Embperl's capbilities you can
 
33
do so by calling Embperl::Execute. This allows to build your own application
 
34
logic and useing Embperl possibilites for rendering content.
 
35
 
 
36
=back
 
37
 
 
38
 
 
39
=head2 mod_perl 
 
40
 
 
41
To use Embperl under mod_perl you must have installed Apache and mod_perl on your system.
 
42
Then you add some directives to your F<httpd.conf> to load Embperl and add C<Embperl>
 
43
as the C<PerlHandler>. The following directives will cause all file with extetion F<epl>
 
44
to be handled by Embperl:
 
45
 
 
46
    PerlModule Embperl
 
47
 
 
48
    AddType text/html .epl
 
49
 
 
50
    <Files *.epl>
 
51
    SetHandler  perl-script
 
52
    PerlHandler Embperl
 
53
    Options     ExecCGI
 
54
    </files>
 
55
 
 
56
 
 
57
Another possibility is to have all files under a special location processed by Embperl:
 
58
 
 
59
    PerlModule Embperl
 
60
 
 
61
    Alias /embperl /path/to/embperl/eg
 
62
 
 
63
    <Location /embperl/x>
 
64
    SetHandler  perl-script
 
65
    PerlHandler Embperl
 
66
    Options     ExecCGI
 
67
    </Location>
 
68
 
 
69
In this setup you should make sure that non Embperl files like images doesn't served 
 
70
from this directory.
 
71
 
 
72
For B<mod_perl 2.0> you need addtionaly to load the dynamic object library of Embperl. This is
 
73
necessary so Embperl is loaded early enough to register the configuration directives
 
74
with Apache. After installing, search underneath your Perl site directory for the
 
75
library. On Unix it is mostly called F<Embperl.so> on Windows it is called C<Embperl.dll>.
 
76
Now add the following line to your httpd.conf B<before> any of the Embperl configuration
 
77
directives, but B<after> F<mod_perl.so> is loaded:
 
78
 
 
79
    LoadModule  embperl_module  /path/to/perl/site/lib/Embperl/Embperl.so
 
80
 
 
81
To use I<Embperl::Object> you use the C<Embperl::Object> as C<PerlHandler>:
 
82
 
 
83
    <Location /foo>
 
84
        Embperl_AppName     unique-name
 
85
        Embperl_Object_Base base.htm
 
86
        Embperl_UriMatch    "\.htm.?|\.epl$"
 
87
        SetHandler          perl-script
 
88
        PerlHandler         Embperl::Object 
 
89
        Options             ExecCGI
 
90
    </Location>
 
91
 
 
92
Addtionaly you can setup other parameters for I<Embperl::Object>. If you do so
 
93
inside a container (like C<<Location>, <Directory>, <Files>>) you need to
 
94
set C<Embperl_AppName> to a unique-name (the actual value doesn't matter). 
 
95
The C<Embperl_UriMatch> makes sure that only files of the requested type are
 
96
served by I<Embperl::Object>, while all others are served by Apache as usual.
 
97
 
 
98
For more information see: L<"perldoc Embperl::Object"|"EmbperlObject.pod">. 
 
99
 
 
100
Embperl accepts a lot of configuration directives to customize it's behaviour. See the next
 
101
section for a description.
 
102
 
 
103
=head2 CGI/FastCGI
 
104
 
 
105
To use this mode you must copy B<embpcgi.pl> to your cgi-bin
 
106
directory.  You can invoke it with the URL
 
107
http://www.domain.xyz/cgi-bin/embpcgi.pl/url/of/your/document.
 
108
 
 
109
The /url/of/your/document will be passed to Embperl by the web server.
 
110
Normal processing (aliasing, etc.) takes place before the URI makes it
 
111
to PATH_TRANSLATED.
 
112
 
 
113
If you are running the Apache httpd, you can also define
 
114
B<embpcgi.pl> as a handler for a specific file extension or
 
115
directory.
 
116
 
 
117
Example of Apache C<httpd.conf>:
 
118
 
 
119
    <Directory /path/to/your/html/docs>
 
120
    Action text/html /cgi-bin/embperl/embpcgi.pl
 
121
    </Directory>
 
122
 
 
123
 
 
124
B<NOTE>: Via CGI Scripts it maybe possible to bypass some of the Apache setup. To avoid this
 
125
use L<Embperl_Allow> to restrict access to the files, which should be processed by Embperl.
 
126
 
 
127
For I<Embperl::Object> you have to use F<epocgi.pl> instead of F<embpcgi.pl>.
 
128
 
 
129
You can also run Embperl with B<FastCGI>, in this case use embpfastcgi.pl
 
130
as cgi script. You must have FCGI.pm installed.
 
131
 
 
132
 
 
133
=head2 Offline
 
134
 
 
135
Run Embperl from the comannd line use F<embpexec.pl> on unix and F<embpexec.bat> on windows:
 
136
 
 
137
 
 
138
    B<embpexec.pl [options] htmlfile [query_string]>
 
139
 
 
140
    B<embpexec.bat [options] htmlfile [query_string]>
 
141
 
 
142
=over 4
 
143
 
 
144
=item B<htmlfile>
 
145
 
 
146
The full pathname of the source file which should be processed by
 
147
Embperl.
 
148
 
 
149
=item B<query_string>
 
150
 
 
151
Optional. Has the same meaning as the environment variable
 
152
QUERY_STRING when invoked as a CGI script.  That is, QUERY_STRING
 
153
contains everything following the first "?" in a URL.  <query_string>
 
154
should be URL-encoded.  The default is no query string.
 
155
 
 
156
=back
 
157
 
 
158
Options:
 
159
 
 
160
=over
 
161
 
 
162
=item -o outputfile
 
163
 
 
164
Optional. Gives the filename to which the output is written.  The
 
165
default is stdout.
 
166
 
 
167
=item -l logfile
 
168
 
 
169
Optional. Gives the filename of the logfile.  The default is
 
170
F</tmp/embperl.log> on unix and F<\embperl.log> on windows.
 
171
 
 
172
=item -d debugflags
 
173
 
 
174
Optional. Specifies the level of debugging (what is written to the
 
175
log file). The default is nothing.  See L<"EMBPERL_DEBUG"> for exact values.
 
176
 
 
177
=item -o options
 
178
 
 
179
See L<"EMBPERL_OPTIONS"> for option values.
 
180
 
 
181
=item -s syntax
 
182
 
 
183
Defines the syntax of the source. See See L<"EMBPERL_SYNTAX">
 
184
 
 
185
=back
 
186
 
 
187
 
 
188
=head2 By calling Embperl::Execute (\%param)
 
189
 
 
190
 
 
191
C<Execute> can be used to call Embperl from your own modules/scripts (for example
 
192
from a Apache::Registry or CGI script) or from within another Embperl page to nest multiple
 
193
Embperl pages (for example to store a common header or
 
194
footer in a different file). 
 
195
 
 
196
(See B<eg/x/Excute.pl> for more detailed examples)
 
197
 
 
198
When you want to use I<Embperl::Object> call C<Embperl::Object::Execute>, when you
 
199
want I<Embperl::Mail>, call C<Embperl::Mail::Execute>.
 
200
 
 
201
There are two forms you can use for calling Execute. A short form which only takes a
 
202
filename and optional additional parameters or a long form which
 
203
takes a hash reference as its argument. 
 
204
 
 
205
  Execute($filename, $p1, $p2, $pn) ;
 
206
 
 
207
This will cause Embperl to interpret the file with the name C<$filename> and, if specified, pass
 
208
any additional parameters in the array C<@param> (just like C<@_> in a Perl subroutine).
 
209
The above example could also be written in the long form:
 
210
 
 
211
  Execute ({inputfile => $filename,
 
212
            param     => [$p1, $p2, $pn]}) ;
 
213
 
 
214
The possible items for hash of the long form are are descriped in the 
 
215
configuration section and parameter section.
 
216
 
 
217
 
 
218
 
 
219
=head3 EXAMPLES for Execute:
 
220
 
 
221
 # Get source from /path/to/your.html and
 
222
 # write output to /path/to/output'
 
223
 
 
224
 Embperl::Execute ({ inputfile  => '/path/to/your.html',
 
225
                     outputfile => '/path/to/output'}) ;
 
226
 
 
227
 
 
228
 # Get source from scalar and write output to stdout
 
229
 # Don't forget to modify mtime if $src changes
 
230
 
 
231
 $src = '<html><head><title>Page [+ $no +]</title></head>' ;
 
232
 
 
233
 Embperl::Execute ({ inputfile  => 'some name',
 
234
                     input      => \$src,
 
235
                     mtime      => 1 }) ;
 
236
 
 
237
 # Get source from scalar and write output to another scalar
 
238
 
 
239
 my $src = '<html><head><title>Page [+ $no +]</title></head>' ;
 
240
 my $out ;
 
241
 
 
242
 Embperl::Execute ({ inputfile  => 'another name',
 
243
                     input      => \$src,
 
244
                     mtime      => 1,
 
245
                     output     => \$out }) ;
 
246
 
 
247
 print $out ;
 
248
 
 
249
 
 
250
 # Include a common header in an Embperl page, 
 
251
 # which is stored in /path/to/head.html
 
252
 
 
253
 [- Execute ('/path/to/head.html') -]
 
254
 
 
255
 
 
256
 
 
257
 
 
258
 
 
259
=head1 Configuration
 
260
 
 
261
Configuration can be setup in different ways, depending how you run Embperl.
 
262
When you run under mod_perl, Embperl add a set of new configuration directives
 
263
to the Apache configuration, so you can set them in your F<httpd.conf>.
 
264
When you run Embperl as CGI it takes the configuration from environment variables. 
 
265
For compatibility reason that
 
266
can also be turned on under mod_perl, by adding C<Embperl_UseEnv on> in your 
 
267
F<httpd.conf>. When you call Embperl from another Perl programm, by calling
 
268
the C<Execute> function, you can pass your configuration along with other parameters
 
269
as a hash reference. If you pass C<use_env =&lt; 1> als parameter Embperl will
 
270
also scan the environment for configuration informations. Last but not least
 
271
you can pass configuration informations as options when you run Embperl via
 
272
embpexec.pl from the command line. Some of the configuration options are
 
273
also setable inside the page via the Empberl objects and you can read the 
 
274
current configuration from these objects.
 
275
 
 
276
You can not only pass configuration in different ways, there are also three different
 
277
contexts: I<Application>, I<Request> and I<Component>. 
 
278
A application describes a
 
279
set of pages/files that belongs together and form the application. Application level
 
280
configuration are the same for all files that belongs to an application. These
 
281
configuration information need to be known before any request processing takes place,
 
282
so they can't be modified during a request. Every application has it's own name.
 
283
You can refer the configuration of an application, by simply setting the name
 
284
of the application to use.
 
285
 
 
286
Request level configuration information applies to one request, some of them must 
 
287
be known before the request starts, some of them can still be modified during the request.
 
288
 
 
289
Configuration for components can be setup before the request, but can also be passed
 
290
as argument when you call the component via C<Execute>.
 
291
 
 
292
 
 
293
=head2 Embperl_Useenv
 
294
 
 
295
=over
 
296
 
 
297
=item Env:
 
298
 
 
299
EMBPERL_USEENV
 
300
 
 
301
=item Method:
 
302
 
 
303
$application -> config -> use_env I<[read only]>
 
304
 
 
305
=item Default:
 
306
 
 
307
off unless runing as CGI script
 
308
 
 
309
=item Since:
 
310
 
 
311
2.0b6
 
312
 
 
313
=back
 
314
 
 
315
 
 
316
Tells Embperl to scan the enviromemt for configuration settings.
 
317
 
 
318
=head2 use_redirect_env
 
319
 
 
320
=over
 
321
 
 
322
=item Method:
 
323
 
 
324
$application -> config -> use_redirect_env I<[read only]>
 
325
 
 
326
=item Default:
 
327
 
 
328
off unless runing as CGI script
 
329
 
 
330
=item Since:
 
331
 
 
332
2.0b6
 
333
 
 
334
=back
 
335
 
 
336
 
 
337
Tells Embperl to scan the enviromemt for configuration settings which has the
 
338
prefix C<REDIRECT_>. This is normaly the case when the request is not the main request,
 
339
but a subrequest.
 
340
 
 
341
=head2 Embperl_Appname
 
342
 
 
343
=over
 
344
 
 
345
=item Env:
 
346
 
 
347
EMBPERL_APPNAME
 
348
 
 
349
=item Method:
 
350
 
 
351
$application -> config -> app_name I<[read only]>
 
352
 
 
353
=item Since:
 
354
 
 
355
2.0b6
 
356
 
 
357
=back
 
358
 
 
359
 
 
360
Specifies the name for an application. The name is basicly used to refer to this application
 
361
elsewhere in httpd.conf without the need to setup the parameters for the apllication again.
 
362
 
 
363
 
 
364
=head2 Embperl_App_Handler_Class
 
365
 
 
366
=over
 
367
 
 
368
=item Env:
 
369
 
 
370
EMBPERL_APP_HANDLER_CLASS
 
371
 
 
372
=item Method:
 
373
 
 
374
$application -> config -> app_handler_class I<[read only]>
 
375
 
 
376
=item Since:
 
377
 
 
378
2.0b6
 
379
 
 
380
=back
 
381
 
 
382
 
 
383
Embperl will call the C<init> method of the given class at the start of the request,
 
384
but after all request parameters are setup. This give the class a chance to 
 
385
do any necessary computation and modify the request parameters, before the request 
 
386
is actualy executed. See L<internationalization> for an example.
 
387
 
 
388
 
 
389
=head2 Embperl_Session_Handler_Class
 
390
 
 
391
=over
 
392
 
 
393
=item Env:
 
394
 
 
395
EMBPERL_SESSION_HANDLER_CLASS
 
396
 
 
397
=item Method:
 
398
 
 
399
$application -> config -> session_handler_class I<[read only]>
 
400
 
 
401
=item Default:
 
402
 
 
403
Apache::SessionX
 
404
 
 
405
=item Since:
 
406
 
 
407
1.3b3
 
408
 
 
409
=item See also:
 
410
 
 
411
Session Handling
 
412
 
 
413
=back
 
414
 
 
415
 
 
416
Set the class that performs the Embperl session handling. This gives you
 
417
the possibility to implement your own session handling.
 
418
 
 
419
NOTE: Default until
 
420
1.3.3 was C<HTML::Embperl::Session>, starting with 1.3.4 it is 
 
421
C<Apache::SessionX>. To get the old session behaviour set it to
 
422
C<HTML::Embperl::Session>. 
 
423
 
 
424
=head2 Embperl_Session_Args
 
425
 
 
426
=over
 
427
 
 
428
=item Env:
 
429
 
 
430
EMBPERL_SESSION_ARGS
 
431
 
 
432
=item Method:
 
433
 
 
434
$application -> config -> session_args I<[read only]>
 
435
 
 
436
=item Since:
 
437
 
 
438
1.3b3
 
439
 
 
440
=item See also:
 
441
 
 
442
Session Handling
 
443
 
 
444
=back
 
445
 
 
446
 
 
447
List of arguments for Apache::Session classes
 
448
Arguments that contains spaces can be quoted.
 
449
Example:
 
450
 
 
451
  EMBPERL_SESSION_ARGS "DataSource=dbi:mysql:session UserName=www 'Password=secret word'"
 
452
 
 
453
 
 
454
=head2 Embperl_Session_Classes
 
455
 
 
456
=over
 
457
 
 
458
=item Env:
 
459
 
 
460
EMBPERL_SESSION_CLASSES
 
461
 
 
462
=item Method:
 
463
 
 
464
$application -> config -> session_classes I<[read only]>
 
465
 
 
466
=item Since:
 
467
 
 
468
1.3b3
 
469
 
 
470
=item See also:
 
471
 
 
472
Session Handling
 
473
 
 
474
=back
 
475
 
 
476
 
 
477
Space separated list of object store and lock manager
 
478
(and optionally the serialization and id generating class)
 
479
for Apache::Session (see L<"Session handling">)
 
480
 
 
481
 
 
482
=head2 Embperl_Session_Config
 
483
 
 
484
=over
 
485
 
 
486
=item Env:
 
487
 
 
488
EMBPERL_SESSION_CONFIG
 
489
 
 
490
=item Method:
 
491
 
 
492
$application -> config -> session_config I<[read only]>
 
493
 
 
494
=item Default:
 
495
 
 
496
given when running Makefile.PL of Apache::SessionX
 
497
 
 
498
=item Since:
 
499
 
 
500
1.3.3
 
501
 
 
502
=item See also:
 
503
 
 
504
Session Handling
 
505
 
 
506
=back
 
507
 
 
508
 
 
509
Selects a session configuration from the configurations you have defined when running
 
510
I<Apache::SessionX>'s C<Makefile.PL>.
 
511
 
 
512
NOTE: Use either C<EMBPERL_SESSION_CONFIG> or C<EMBPERL_SESSION_ARGS> and C<EMBPERL_SESSION_CLASSES> 
 
513
 
 
514
 
 
515
=head2 Embperl_Cookie_Name
 
516
 
 
517
=over
 
518
 
 
519
=item Env:
 
520
 
 
521
EMBPERL_COOKIE_NAME
 
522
 
 
523
=item Method:
 
524
 
 
525
$application -> config -> cookie_name I<[read only]>
 
526
 
 
527
=item Default:
 
528
 
 
529
EMBPERL_UID
 
530
 
 
531
=item Since:
 
532
 
 
533
1.2b4
 
534
 
 
535
=item See also:
 
536
 
 
537
Session Handling
 
538
 
 
539
=back
 
540
 
 
541
 
 
542
Set the name that Embperl uses when it sends the cookie with the session id.
 
543
 
 
544
 
 
545
=head2 Embperl_Cookie_Domain
 
546
 
 
547
=over
 
548
 
 
549
=item Env:
 
550
 
 
551
EMBPERL_COOKIE_DOMAIN
 
552
 
 
553
=item Method:
 
554
 
 
555
$application -> config -> cookie_domain I<[read only]>
 
556
 
 
557
=item Default:
 
558
 
 
559
none
 
560
 
 
561
=item Since:
 
562
 
 
563
1.2b4
 
564
 
 
565
=item See also:
 
566
 
 
567
Session Handling
 
568
 
 
569
=back
 
570
 
 
571
 
 
572
Set the domain that Embperl uses for the cookie with the session id.
 
573
 
 
574
 
 
575
=head2 Embperl_Cookie_Path
 
576
 
 
577
=over
 
578
 
 
579
=item Env:
 
580
 
 
581
EMBPERL_COOKIE_PATH
 
582
 
 
583
=item Method:
 
584
 
 
585
$application -> config -> cookie_path I<[read only]>
 
586
 
 
587
=item Default:
 
588
 
 
589
none
 
590
 
 
591
=item Since:
 
592
 
 
593
1.2b4
 
594
 
 
595
=item See also:
 
596
 
 
597
Session Handling
 
598
 
 
599
=back
 
600
 
 
601
 
 
602
Set the path that Embperl uses for the cookie with the session id.
 
603
 
 
604
 
 
605
=head2 Embperl_Cookie_Expires
 
606
 
 
607
=over
 
608
 
 
609
=item Env:
 
610
 
 
611
EMBPERL_COOKIE_EXPIRES
 
612
 
 
613
=item Method:
 
614
 
 
615
$application -> config -> cookie_expires I<[read only]>
 
616
 
 
617
=item Default:
 
618
 
 
619
at the end of the session
 
620
 
 
621
=item Since:
 
622
 
 
623
1.3b5
 
624
 
 
625
=item See also:
 
626
 
 
627
Session Handling
 
628
 
 
629
=back
 
630
 
 
631
 
 
632
Set the expiration date that Embperl uses for the cookie with the session id.
 
633
You can specify the full date or relativ values. 
 
634
The following forms are all valid times:
 
635
 
 
636
        +30s                              30 seconds from now
 
637
        +10m                              ten minutes from now
 
638
        +1h                               one hour from now
 
639
        -1d                               yesterday (i.e. "ASAP!")
 
640
        now                               immediately
 
641
        +3M                               in three months
 
642
        +10y                              in ten years time
 
643
        Thursday, 25-Apr-1999 00:40:33 GMT  at the indicated time & date
 
644
 
 
645
 
 
646
=head2 Embperl_Cookie_Secure
 
647
 
 
648
=over
 
649
 
 
650
=item Env:
 
651
 
 
652
EMBPERL_COOKIE_SECURE
 
653
 
 
654
=item Method:
 
655
 
 
656
$application -> config -> cookie_secure I<[read only]>
 
657
 
 
658
=item Default:
 
659
 
 
660
at the end of the session
 
661
 
 
662
=item Since:
 
663
 
 
664
2.0b9
 
665
 
 
666
=item See also:
 
667
 
 
668
Session Handling
 
669
 
 
670
=back
 
671
 
 
672
 
 
673
Set the secure flag of cookie that Embperl uses for the session id. If set the
 
674
cookie will only be transfered over a secured connection.
 
675
 
 
676
=head2 Embperl_Log
 
677
 
 
678
=over
 
679
 
 
680
=item Env:
 
681
 
 
682
EMBPERL_LOG
 
683
 
 
684
=item Method:
 
685
 
 
686
$application -> config -> log I<[read only]>
 
687
 
 
688
=item Default:
 
689
 
 
690
Unix: /tmp/embperl.log  Windows: /embperl.log
 
691
 
 
692
=back
 
693
 
 
694
 
 
695
Gives the location of the log file.  This will contain information
 
696
about what Embperl is doing.  The amount of information depends on the
 
697
debug settings (see L<"EMBPERL_DEBUG"> below).  The log output is intended to show what
 
698
your embedded Perl code is doing and to help debug it. 
 
699
 
 
700
 
 
701
=head2 Embperl_Debug
 
702
 
 
703
=over
 
704
 
 
705
=item Env:
 
706
 
 
707
EMBPERL_DEBUG
 
708
 
 
709
=item Method:
 
710
 
 
711
$application -> config -> debug 
 
712
 
 
713
=back
 
714
 
 
715
 
 
716
This is a bitmask which specifies what should be written to the log.
 
717
To specify multiple debugflags, simply add the values together.
 
718
You can give the value a decimal, octal (prefix 0) or hexadecimal (prefix 0x) value.
 
719
You can also use the constants defined in I<Embperl::Constant>.
 
720
The following values are defined:
 
721
 
 
722
=over 4
 
723
 
 
724
=item dbgStd = 1 (0x1)
 
725
 
 
726
Show minimum information.
 
727
 
 
728
=item dbgMem = 2 (0x2)
 
729
 
 
730
Show memory and scalar value allocation.
 
731
 
 
732
=item dbgEval = 4 (0x4)
 
733
 
 
734
Show arguments to and results of evals.
 
735
 
 
736
=item dbgEnv = 16 (0x10) 
 
737
 
 
738
List every request's environment variables.
 
739
 
 
740
=item dbgForm = 32 (0x20)
 
741
 
 
742
List posted form data.
 
743
 
 
744
=item dbgInput = 128 (0x80)
 
745
 
 
746
Show processing of HTML input tags.
 
747
 
 
748
=item dbgFlushOutput = 256 (0x100)
 
749
 
 
750
Flush Embperl's output after every write.  This should only be set to
 
751
help debug Embperl crashes, as it drastically slows down Embperl's
 
752
operation.
 
753
 
 
754
=item dbgFlushLog = 512 (0x200)
 
755
 
 
756
Flush Embperl's logfile output after every write.  This should only be
 
757
set to help debug Embperl crashes, as it drastically slows down
 
758
Embperl's operation.
 
759
 
 
760
 
 
761
=item dbgLogLink = 8192 (0x2000)
 
762
 
 
763
This feature is not yet implemented in Embperl 2.0!
 
764
 
 
765
Inserts a link at the top of each page which can be used to view the
 
766
log for the current HTML file.  See also L<"EMBPERL_VIRTLOG">.
 
767
 
 
768
Example:
 
769
 
 
770
    EMBPERL_DEBUG 10477
 
771
    EMBPERL_VIRTLOG /embperl/log.htm
 
772
 
 
773
    <Location /embperl/log.htm>
 
774
    SetHandler perl-script
 
775
    PerlHandler Embperl
 
776
    Options ExecCGI
 
777
    </Location>
 
778
 
 
779
=item dbgDefEval = 16384 (0x4000)
 
780
 
 
781
Shows every time new Perl code is compiled.
 
782
 
 
783
 
 
784
=item dbgHeadersIn = 262144 (0x40000)
 
785
 
 
786
Log all HTTP headers which are sent from and to the browser.
 
787
 
 
788
=item dbgShowCleanup = 524288 (0x80000)
 
789
 
 
790
Show every variable which is undef'd at the end of the request.  For
 
791
scalar variables, the value before undef'ing is logged.
 
792
 
 
793
 
 
794
=item dbgSession = 2097152 (0x200000) 
 
795
 
 
796
Enables logging of session transactions.
 
797
 
 
798
=item dbgImport =  4194304 (0x400000) 
 
799
 
 
800
Show how subroutines are imported in other namespaces.
 
801
 
 
802
=item dbgOutput = 0x08000
 
803
 
 
804
Logs the process of converting the internal tree strcuture to plain text for output
 
805
 
 
806
=item dbgDOM = 0x10000
 
807
 
 
808
Logs things related to processing the internal tree data structure of documents
 
809
 
 
810
=item dbgRun = 0x20000
 
811
 
 
812
Logs things related to execution of a document
 
813
 
 
814
=item dbgBuildToken = 0x800000
 
815
 
 
816
Logs things related to creating the token tables for source parsing
 
817
 
 
818
=item dbgParse = 0x1000000
 
819
 
 
820
Logs the parseing of the source
 
821
 
 
822
=item dbgObjectSearch = 0x2000000
 
823
 
 
824
Shows how Embperl::Objects seraches sourcefiles
 
825
 
 
826
=item dbgCache = 0x4000000
 
827
 
 
828
Logs cache related things
 
829
 
 
830
=item dbgCompile = 0x8000000
 
831
 
 
832
Gives information about compiling the parsed source to Perl code
 
833
 
 
834
=item dbgXML = 0x10000000
 
835
 
 
836
Logs things related to XML processing
 
837
 
 
838
=item dbgXSLT = 0x20000000
 
839
 
 
840
Logs things related to XSLT processing
 
841
 
 
842
=item dbgCheckpoint = 0x40000000
 
843
 
 
844
Logs things related to checkpoints which are internaly used during execution.
 
845
This information is only usefull if you have a deep knowledge of Embperl
 
846
internals.
 
847
 
 
848
 
 
849
=back
 
850
 
 
851
 
 
852
=head2 Embperl_Maildebug
 
853
 
 
854
=over
 
855
 
 
856
=item Env:
 
857
 
 
858
EMBPERL_MAILDEBUG
 
859
 
 
860
=item Method:
 
861
 
 
862
$application -> config -> maildebug 
 
863
 
 
864
=item Since:
 
865
 
 
866
1.2.1
 
867
 
 
868
=back
 
869
 
 
870
 
 
871
Debug value pass to Net::SMTP.
 
872
 
 
873
 
 
874
=head2 Embperl_Mailhost
 
875
 
 
876
=over
 
877
 
 
878
=item Env:
 
879
 
 
880
EMBPERL_MAILHOST
 
881
 
 
882
=item Method:
 
883
 
 
884
$application -> config -> mailhost 
 
885
 
 
886
=item Default:
 
887
 
 
888
localhost
 
889
 
 
890
=back
 
891
 
 
892
 
 
893
Specifies which host the mail related functions of Embperl uses as SMTP server.
 
894
 
 
895
 
 
896
=head2 Embperl_Mailhelo
 
897
 
 
898
=over
 
899
 
 
900
=item Env:
 
901
 
 
902
EMBPERL_MAILHELO
 
903
 
 
904
=item Method:
 
905
 
 
906
$application -> config -> mailhelo 
 
907
 
 
908
=item Default:
 
909
 
 
910
choosen by Net::SMTP
 
911
 
 
912
=item Since:
 
913
 
 
914
1.3b4
 
915
 
 
916
=back
 
917
 
 
918
 
 
919
Specifies which host/domain all mailrealted function uses
 
920
in the HELO/EHLO command.
 
921
A reasonable default is normaly choosen by I<Net::SMTP>, but
 
922
depending on your installation it may neccessary to set it
 
923
manualy.
 
924
 
 
925
 
 
926
=head2 Embperl_Mailfrom
 
927
 
 
928
=over
 
929
 
 
930
=item Env:
 
931
 
 
932
EMBPERL_MAILFROM
 
933
 
 
934
=item Method:
 
935
 
 
936
$application -> config -> mailfrom 
 
937
 
 
938
=item Default:
 
939
 
 
940
www-server@<server_name>
 
941
 
 
942
=item Since:
 
943
 
 
944
1.2.1
 
945
 
 
946
=back
 
947
 
 
948
 
 
949
Specifies the email address that is used as sender all mailrelted function.
 
950
 
 
951
 
 
952
=head2 Embperl_Mail_Errors_To
 
953
 
 
954
=over
 
955
 
 
956
=item Env:
 
957
 
 
958
EMBPERL_MAIL_ERRORS_TO
 
959
 
 
960
=item Method:
 
961
 
 
962
$application -> config -> mail_errors_to 
 
963
 
 
964
=back
 
965
 
 
966
 
 
967
If set all errors will be send to the email adress given.
 
968
 
 
969
 
 
970
=head2 Embperl_Mail_Errors_Limit
 
971
 
 
972
=over
 
973
 
 
974
=item Env:
 
975
 
 
976
EMBPERL_MAIL_ERRORS_LIMIT
 
977
 
 
978
=item Method:
 
979
 
 
980
$application -> config -> mail_errors_limit I<[read only]>
 
981
 
 
982
=item Since:
 
983
 
 
984
2.0b6
 
985
 
 
986
=back
 
987
 
 
988
 
 
989
Do not mail more then <num> errors. Set to 0 for no limit.
 
990
 
 
991
 
 
992
=head2 Embperl_Mail_Errors_Reset_Time
 
993
 
 
994
=over
 
995
 
 
996
=item Env:
 
997
 
 
998
EMBPERL_MAIL_ERRORS_RESET_TIME
 
999
 
 
1000
=item Method:
 
1001
 
 
1002
$application -> config -> mail_errors_reset_time I<[read only]>
 
1003
 
 
1004
=item Since:
 
1005
 
 
1006
2.0b6
 
1007
 
 
1008
=back
 
1009
 
 
1010
 
 
1011
Reset error counter if for <sec> seconds no error has occured.
 
1012
 
 
1013
 
 
1014
=head2 Embperl_Mail_Errors_Resend_Time
 
1015
 
 
1016
=over
 
1017
 
 
1018
=item Env:
 
1019
 
 
1020
EMBPERL_MAIL_ERRORS_RESEND_TIME
 
1021
 
 
1022
=item Method:
 
1023
 
 
1024
$application -> config -> mail_errors_resend_time I<[read only]>
 
1025
 
 
1026
=item Since:
 
1027
 
 
1028
2.0b6
 
1029
 
 
1030
=back
 
1031
 
 
1032
 
 
1033
Mail errors of <sec> seconds regardless of the error counter.
 
1034
 
 
1035
 
 
1036
=head2 Embperl_Object_Base
 
1037
 
 
1038
=over
 
1039
 
 
1040
=item Env:
 
1041
 
 
1042
EMBPERL_OBJECT_BASE
 
1043
 
 
1044
=item Method:
 
1045
 
 
1046
$application -> config -> object_base I<[read only]>
 
1047
 
 
1048
=item Default:
 
1049
 
 
1050
_base.epl
 
1051
 
 
1052
=item Since:
 
1053
 
 
1054
1.3b1
 
1055
 
 
1056
=back
 
1057
 
 
1058
 
 
1059
Name of the base page that Embperl::Objects searches for.
 
1060
 
 
1061
 
 
1062
=head2 Embperl_Object_App
 
1063
 
 
1064
=over
 
1065
 
 
1066
=item Env:
 
1067
 
 
1068
EMBPERL_OBJECT_APP
 
1069
 
 
1070
=item Method:
 
1071
 
 
1072
$application -> config -> object_app 
 
1073
 
 
1074
=item Since:
 
1075
 
 
1076
2.0b6
 
1077
 
 
1078
=back
 
1079
 
 
1080
 
 
1081
Filename of the application object that Embperl::Object searches for. 
 
1082
The file should contain the Perl code for 
 
1083
the application object. There must be no package name given (as the package is set
 
1084
by Embperl::Object) inside the file, but the @ISA should point to Embperl::App.
 
1085
If set this file is searched throught the same search path as any content file.
 
1086
After a successfull load the init method is called with the Embperl request object
 
1087
as parameter. The init method can change the parameters inside the request object
 
1088
to influence the current request.
 
1089
 
 
1090
 
 
1091
=head2 Embperl_Object_Addpath
 
1092
 
 
1093
=over
 
1094
 
 
1095
=item Env:
 
1096
 
 
1097
EMBPERL_OBJECT_ADDPATH
 
1098
 
 
1099
=item Method:
 
1100
 
 
1101
$application -> config -> object_addpath 
 
1102
 
 
1103
=item Since:
 
1104
 
 
1105
1.3b1
 
1106
 
 
1107
=back
 
1108
 
 
1109
 
 
1110
Additional directories where Embperl::Object searches for pages. 
 
1111
In F<httpd.conf> or as evironment variable directories are
 
1112
separated by C<;> (on Unix C<:> works also). The parameter for C<Execute> and
 
1113
the application object method expects/returns an array reference.
 
1114
This path is
 
1115
B<always> appended to the searchpath.
 
1116
 
 
1117
 
 
1118
=head2 Embperl_Object_Stopdir
 
1119
 
 
1120
=over
 
1121
 
 
1122
=item Env:
 
1123
 
 
1124
EMBPERL_OBJECT_STOPDIR
 
1125
 
 
1126
=item Method:
 
1127
 
 
1128
$application -> config -> object_stopdir 
 
1129
 
 
1130
=item Since:
 
1131
 
 
1132
1.3b1
 
1133
 
 
1134
=back
 
1135
 
 
1136
 
 
1137
Directory where Embperl::Object stops searching for the base page.
 
1138
 
 
1139
 
 
1140
=head2 Embperl_Object_Fallback
 
1141
 
 
1142
=over
 
1143
 
 
1144
=item Env:
 
1145
 
 
1146
EMBPERL_OBJECT_FALLBACK
 
1147
 
 
1148
=item Method:
 
1149
 
 
1150
$application -> config -> object_fallback 
 
1151
 
 
1152
=item Since:
 
1153
 
 
1154
1.3b1
 
1155
 
 
1156
=back
 
1157
 
 
1158
 
 
1159
If the requested file is not found by Embperl::Object, the file given by C<EMBPERL_OBJECT_FALLBACK>
 
1160
is displayed instead. If C<EMBPERL_OBJECT_FALLBACK> isn't set a
 
1161
staus 404, NOT_FOUND is returned as usual. If the fileame given in 
 
1162
C<EMBPERL_OBJECT_FALLBACK> doesn't contain a path, it is searched thru the same
 
1163
directories as C<EMBPERL_OBJECT_BASE>.
 
1164
 
 
1165
 
 
1166
=head2 Embperl_Object_Handler_Class
 
1167
 
 
1168
=over
 
1169
 
 
1170
=item Env:
 
1171
 
 
1172
EMBPERL_OBJECT_HANDLER_CLASS
 
1173
 
 
1174
=item Method:
 
1175
 
 
1176
$application -> config -> object_handler_class 
 
1177
 
 
1178
=item Since:
 
1179
 
 
1180
1.3b1
 
1181
 
 
1182
=back
 
1183
 
 
1184
 
 
1185
If you specify this, the template base and the requested page inherit all
 
1186
methods from this class. This class must contain C<Embperl::Req> in his
 
1187
@ISA array.
 
1188
 
 
1189
 
 
1190
 
 
1191
=head2 Embperl_Useenv
 
1192
 
 
1193
=over
 
1194
 
 
1195
=item Env:
 
1196
 
 
1197
EMBPERL_USEENV
 
1198
 
 
1199
=item Method:
 
1200
 
 
1201
$request -> config -> use_env I<[read only]>
 
1202
 
 
1203
=item Default:
 
1204
 
 
1205
off unless runing as CGI script
 
1206
 
 
1207
=item Since:
 
1208
 
 
1209
2.0b6
 
1210
 
 
1211
=back
 
1212
 
 
1213
 
 
1214
Tells Embperl to scan the enviromemt for configuration settings.
 
1215
 
 
1216
=head2 use_redirect_env
 
1217
 
 
1218
=over
 
1219
 
 
1220
=item Method:
 
1221
 
 
1222
$request -> config -> use_redirect_env I<[read only]>
 
1223
 
 
1224
=item Default:
 
1225
 
 
1226
off unless runing as CGI script
 
1227
 
 
1228
=item Since:
 
1229
 
 
1230
2.0b6
 
1231
 
 
1232
=back
 
1233
 
 
1234
 
 
1235
Tells Embperl to scan the enviromemt for configuration settings which has the
 
1236
prefix C<REDIRECT_>. This is normaly the case when the request is not the main request,
 
1237
but a subrequest.
 
1238
 
 
1239
=head2 Embperl_Allow
 
1240
 
 
1241
=over
 
1242
 
 
1243
=item Env:
 
1244
 
 
1245
EMBPERL_ALLOW
 
1246
 
 
1247
=item Method:
 
1248
 
 
1249
$request -> config -> allow I<[read only]>
 
1250
 
 
1251
=item Default:
 
1252
 
 
1253
no restrictions
 
1254
 
 
1255
=item Since:
 
1256
 
 
1257
1.2b10
 
1258
 
 
1259
=back
 
1260
 
 
1261
 
 
1262
If specified, only files which match the given B<perl regular expression> will be
 
1263
processed by Embperl. All other files will return FORBIDDEN.
 
1264
This is especially useful in a CGI environment by making the server more secure.
 
1265
 
 
1266
 
 
1267
=head2 Embperl_Urimatch
 
1268
 
 
1269
=over
 
1270
 
 
1271
=item Env:
 
1272
 
 
1273
EMBPERL_URIMATCH
 
1274
 
 
1275
=item Method:
 
1276
 
 
1277
$request -> config -> urimatch I<[read only]>
 
1278
 
 
1279
=item Default:
 
1280
 
 
1281
process all files
 
1282
 
 
1283
=item Since:
 
1284
 
 
1285
2.0b6
 
1286
 
 
1287
=back
 
1288
 
 
1289
 
 
1290
If specified, only files which match the given B<perl regular expression> will be
 
1291
processed by Embperl, all other files will be handled by the standard Apache
 
1292
handler. This can be useful if you have Embperl documents and non Embperl
 
1293
documents (e.g. gifs) residing in the same directory. 
 
1294
 
 
1295
 Example: 
 
1296
 # Only files which end with .htm will processed by Embperl
 
1297
 EMBPERL_URIMATCH \.htm$
 
1298
 
 
1299
 
 
1300
=head2 Embperl_Multfieldsep
 
1301
 
 
1302
=over
 
1303
 
 
1304
=item Env:
 
1305
 
 
1306
EMBPERL_MULTFIELDSEP
 
1307
 
 
1308
=item Method:
 
1309
 
 
1310
$request -> config -> mult_field_sep I<[read only]>
 
1311
 
 
1312
=item Default:
 
1313
 
 
1314
\t
 
1315
 
 
1316
=item Since:
 
1317
 
 
1318
2.0b6
 
1319
 
 
1320
=back
 
1321
 
 
1322
 
 
1323
Specifies the charachter that is used to separate multiple form values with the
 
1324
same name.
 
1325
 
 
1326
=head2 Embperl_Path
 
1327
 
 
1328
=over
 
1329
 
 
1330
=item Env:
 
1331
 
 
1332
EMBPERL_PATH
 
1333
 
 
1334
=item Method:
 
1335
 
 
1336
$request -> config -> path I<[read only]>
 
1337
 
 
1338
=item Since:
 
1339
 
 
1340
1.3b6
 
1341
 
 
1342
=back
 
1343
 
 
1344
 
 
1345
Can contain a semicolon (also colon under Unix) separated file search path.
 
1346
When a file is processed and the filename isn't an absolute path or
 
1347
does not start with ./ (or .\ under windows), I<Embperl> searches all
 
1348
the specified directories for that file. 
 
1349
 
 
1350
 
 
1351
A special handling is done if the filename starts with any number
 
1352
of C<../> i.e. refers to an upper directory. Then I<Embperl> strips
 
1353
the same number of entries at the start of the searchpath as the filename
 
1354
contains C<../>.
 
1355
C<Execute> and the method of the request object expects/returns a array ref.
 
1356
 
 
1357
=head2 Embperl_Debug
 
1358
 
 
1359
=over
 
1360
 
 
1361
=item Env:
 
1362
 
 
1363
EMBPERL_DEBUG
 
1364
 
 
1365
=item Method:
 
1366
 
 
1367
$request -> config -> debug 
 
1368
 
 
1369
=back
 
1370
 
 
1371
 
 
1372
See application configuration for an describtion of possible values
 
1373
 
 
1374
=head2 Embperl_Options
 
1375
 
 
1376
=over
 
1377
 
 
1378
=item Env:
 
1379
 
 
1380
EMBPERL_OPTIONS
 
1381
 
 
1382
=item Method:
 
1383
 
 
1384
$request -> config -> options 
 
1385
 
 
1386
=item Since:
 
1387
 
 
1388
yes
 
1389
 
 
1390
=back
 
1391
 
 
1392
 
 
1393
This bitmask specifies some options for the execution of Embperl.
 
1394
To specify multiple options, simply add the values together.
 
1395
 
 
1396
=over 4
 
1397
 
 
1398
=item optDisableVarCleanup = 1
 
1399
 
 
1400
Disables the automatic cleanup of variables at the end of each
 
1401
request.
 
1402
 
 
1403
=item optDisableEmbperlErrorPage = 2
 
1404
 
 
1405
Tells Embperl not to send its own errorpage in case of failure,
 
1406
but instead show as much of the page as possible. Errors are only logged
 
1407
to the log file.
 
1408
Without this option, Embperl sends its
 
1409
own error page, showing all the errors which have occurred.  If you
 
1410
have dbgLogLink enabled, every error will be a link to the
 
1411
corresponding location in the log file. This option has no effect if
 
1412
optReturnError is set.
 
1413
 
 
1414
=item optReturnError = 262144
 
1415
 
 
1416
With this option set, Embperl sends no output in case of an error.
 
1417
It returns the error back to Apache or the calling program. When running
 
1418
under mod_perl this gives you the chance to use the Apache I<ErrorDocument>
 
1419
directive to show a custom error-document. Inside the ErrorDocument
 
1420
you can retrieve the error messages with
 
1421
 
 
1422
  $errors = $req_rec -> prev -> pnotes('EMBPERL_ERRORS') ;
 
1423
 
 
1424
where C<$errors> is a array reference. (1.3b5+)
 
1425
 
 
1426
=item optShowBacktrace = 0x8000000
 
1427
 
 
1428
When set every error message not only show the sourcefiles, but all files
 
1429
from which this file was called by Execute.
 
1430
 
 
1431
 
 
1432
=back
 
1433
 
 
1434
=head2 Embperl_Output_Mode
 
1435
 
 
1436
=over
 
1437
 
 
1438
=item Env:
 
1439
 
 
1440
EMBPERL_OUTPUT_MODE
 
1441
 
 
1442
=item Method:
 
1443
 
 
1444
$request -> config -> output_mode 
 
1445
 
 
1446
=item Default:
 
1447
 
 
1448
HTML
 
1449
 
 
1450
=item Since:
 
1451
 
 
1452
yes
 
1453
 
 
1454
=back
 
1455
 
 
1456
 
 
1457
Set the desired output format. 0 for HTML and 1 XML. If set to XML all tags
 
1458
that are generated by Embperl will contain a closing slash to conform to XML
 
1459
specs. e.g.
 
1460
 
 
1461
    <input type="text" name="foo" />
 
1462
 
 
1463
B<NOTE:> If you set output_mode to XML you should also change L<escmode> to XML escaping.
 
1464
 
 
1465
 
 
1466
=head2 Embperl_Session_Mode
 
1467
 
 
1468
=over
 
1469
 
 
1470
=item Env:
 
1471
 
 
1472
EMBPERL_SESSION_MODE
 
1473
 
 
1474
=item Method:
 
1475
 
 
1476
$request -> config -> session_mode 
 
1477
 
 
1478
=item Default:
 
1479
 
 
1480
smodeUDatCookie = 1
 
1481
 
 
1482
=item Since:
 
1483
 
 
1484
no
 
1485
 
 
1486
=back
 
1487
 
 
1488
 
 
1489
Specifies how the id for the session data is passed between requests.
 
1490
Possible values are:
 
1491
 
 
1492
=over
 
1493
 
 
1494
=item smodeNone = 0
 
1495
 
 
1496
No session id will be passed
 
1497
 
 
1498
=item smodeUDatCookie = 1
 
1499
 
 
1500
The session id for the user session will be passed via cookie
 
1501
 
 
1502
=item smodeUDatParam = 2
 
1503
 
 
1504
The session id for the user session will append as parameter to any URL
 
1505
and inserted as a hidden field in any form.
 
1506
 
 
1507
=item smodeUDatUrl = 4
 
1508
 
 
1509
The session id for the user session will passed as a part of the URL.
 
1510
NOT YET IMPLEMENTED!!
 
1511
 
 
1512
=item smodeSDatParam = 0x20
 
1513
 
 
1514
The session id for the state session will append as parameter to any URL
 
1515
and inserted as a hidden field in any form.
 
1516
 
 
1517
 
 
1518
=back
 
1519
 
 
1520
You may add the UDat and SDat values together to get both sorts of sessions,
 
1521
for example the value 0x21 will pass the id for the user session inside a
 
1522
cookie and the id for the state session as parameters.
 
1523
 
 
1524
 
 
1525
 
 
1526
=head2 Embperl_Useenv
 
1527
 
 
1528
=over
 
1529
 
 
1530
=item Env:
 
1531
 
 
1532
EMBPERL_USEENV
 
1533
 
 
1534
=item Method:
 
1535
 
 
1536
$component -> config -> use_env I<[read only]>
 
1537
 
 
1538
=item Default:
 
1539
 
 
1540
off unless runing as CGI script
 
1541
 
 
1542
=item Since:
 
1543
 
 
1544
2.0b6
 
1545
 
 
1546
=back
 
1547
 
 
1548
 
 
1549
Tells Embperl to scan the enviromemt for configuration settings.
 
1550
 
 
1551
=head2 use_redirect_env
 
1552
 
 
1553
=over
 
1554
 
 
1555
=item Method:
 
1556
 
 
1557
$component -> config -> use_redirect_env I<[read only]>
 
1558
 
 
1559
=item Default:
 
1560
 
 
1561
off unless runing as CGI script
 
1562
 
 
1563
=item Since:
 
1564
 
 
1565
2.0b6
 
1566
 
 
1567
=back
 
1568
 
 
1569
 
 
1570
Tells Embperl to scan the enviromemt for configuration settings which has the
 
1571
prefix C<REDIRECT_>. This is normaly the case when the request is not the main request,
 
1572
but a subrequest.
 
1573
 
 
1574
=head2 Embperl_Package
 
1575
 
 
1576
=over
 
1577
 
 
1578
=item Env:
 
1579
 
 
1580
EMBPERL_PACKAGE
 
1581
 
 
1582
=item Method:
 
1583
 
 
1584
$component -> config -> package 
 
1585
 
 
1586
=back
 
1587
 
 
1588
 
 
1589
The name of the package where your code will be executed.  By default, 
 
1590
Embperl generates a unique package name for every file.  This ensures
 
1591
that variables and functions from one file do not conflict with those of  
 
1592
another file.  (Any package's variables will still be accessible with
 
1593
explicit package names.)
 
1594
 
 
1595
=head2 Embperl_Debug
 
1596
 
 
1597
=over
 
1598
 
 
1599
=item Env:
 
1600
 
 
1601
EMBPERL_DEBUG
 
1602
 
 
1603
=item Method:
 
1604
 
 
1605
$component -> config -> debug 
 
1606
 
 
1607
=back
 
1608
 
 
1609
 
 
1610
See application configuration for an describtion of possible values
 
1611
 
 
1612
=head2 Embperl_Options
 
1613
 
 
1614
=over
 
1615
 
 
1616
=item Env:
 
1617
 
 
1618
EMBPERL_OPTIONS
 
1619
 
 
1620
=item Method:
 
1621
 
 
1622
$component -> config -> options 
 
1623
 
 
1624
=back
 
1625
 
 
1626
 
 
1627
This bitmask specifies some options for the execution of Embperl.
 
1628
To specify multiple options, simply add the values together.
 
1629
 
 
1630
=over 4
 
1631
 
 
1632
=item optDisableVarCleanup = 1
 
1633
 
 
1634
Disables the automatic cleanup of variables at the end of each
 
1635
request.
 
1636
 
 
1637
=item optDisableEmbperlErrorPage = 2
 
1638
 
 
1639
Tells Embperl not to send its own errorpage in case of failure,
 
1640
but instead show as much of the page as possible. Errors are only logged
 
1641
to the log file.
 
1642
Without this option, Embperl sends its
 
1643
own error page, showing all the errors which have occurred.  If you
 
1644
have dbgLogLink enabled, every error will be a link to the
 
1645
corresponding location in the log file. This option has no effect if
 
1646
optReturnError is set.
 
1647
 
 
1648
=item optReturnError = 262144
 
1649
 
 
1650
With this option set, Embperl sends no output in case of an error.
 
1651
It returns the error back to Apache or the calling program. When running
 
1652
under mod_perl this gives you the chance to use the Apache I<ErrorDocument>
 
1653
directive to show a custom error-document. Inside the ErrorDocument
 
1654
you can retrieve the error messages with
 
1655
 
 
1656
  $errors = $req_rec -> prev -> pnotes('EMBPERL_ERRORS') ;
 
1657
 
 
1658
where C<$errors> is a array reference. (1.3b5+)
 
1659
 
 
1660
=item optShowBacktrace = 0x8000000
 
1661
 
 
1662
When set every error message not only show the sourcefiles, but all files
 
1663
from which this file was called by Execute.
 
1664
 
 
1665
 
 
1666
=item optSafeNamespace = 4
 
1667
 
 
1668
Tells Embperl to execute the embedded code in a safe namespace so the
 
1669
code cannot access data or code in any other package.  (See the
 
1670
chapter about L<"(Safe-)Namespaces and opcode restrictions"> below for more details.)
 
1671
 
 
1672
=item optOpcodeMask = 8
 
1673
 
 
1674
Tells Embperl to apply an operator mask.  This gives you the chance to
 
1675
disallow special (unsafe) opcodes.  (See the Chapter about 
 
1676
L<"(Safe-)Namespaces and opcode restrictions">
 
1677
below for more details.)
 
1678
 
 
1679
=item optDisableFormData = 256
 
1680
 
 
1681
This option disables the setup of %fdat and @Z<>ffld. Embperl will not do anything
 
1682
with the posted form data.
 
1683
Set this when using Execute from your perl script and you have already read the Form Data (via eg. CGI.pm).
 
1684
 
 
1685
 
 
1686
=item optAllFormData = 8192
 
1687
 
 
1688
This option will cause Embperl to insert all formfields in %fdat and @Z<>ffld, even if they
 
1689
are empty. Empty formfields will be inserted with an empty string. Without this option,
 
1690
empty formfields will be absent from %fdat and @Z<>ffld.
 
1691
 
 
1692
 
 
1693
=item optRedirectStdout = 16384
 
1694
 
 
1695
Redirects STDOUT to the Embperl output stream before every request and resets it afterwards.
 
1696
If set, you can use a normal Perl B<print> inside any Perl block to output data. 
 
1697
Without this option you can only use output data by using the [+ ... +] block, or printing
 
1698
to the filehandle B<OUT>.
 
1699
 
 
1700
 
 
1701
=item optNoHiddenEmptyValue = 65536 (only 1.2b2 and above)
 
1702
 
 
1703
Normally, if there is a value defined in %fdat for a specific input field, Embperl
 
1704
will output a hidden input element for it when you use B<hidden>. When this option
 
1705
is set, Embperl will not output a hidden input element for this field when the
 
1706
value is a blank string.
 
1707
 
 
1708
 
 
1709
=item optKeepSpaces = 1048576 (only 1.2b5 and above)           = 0x100000,
 
1710
 
 
1711
Disable the removal of spaces and empty lines from the output. This is useful
 
1712
for sources other than HTML.
 
1713
 
 
1714
 
 
1715
=back
 
1716
 
 
1717
 
 
1718
 
 
1719
=head2 Embperl_Escmode
 
1720
 
 
1721
=over
 
1722
 
 
1723
=item Env:
 
1724
 
 
1725
EMBPERL_ESCMODE
 
1726
 
 
1727
=item Method:
 
1728
 
 
1729
$component -> config -> escmode 
 
1730
 
 
1731
=item Default:
 
1732
 
 
1733
7
 
1734
 
 
1735
=back
 
1736
 
 
1737
 
 
1738
Turn HTML and URL escaping on and off. 
 
1739
 
 
1740
NOTE: If you want to output binary data, you must set the escmode
 
1741
to zero.
 
1742
 
 
1743
For convenience you can change the escmode inside a page by setting 
 
1744
the variable C<$escmode>.
 
1745
 
 
1746
 
 
1747
=over 4
 
1748
 
 
1749
=item escXML = 8 (or 15) (2.0b4 and above)
 
1750
 
 
1751
The result of a Perl expression is always XML-escaped (e.g., `>'
 
1752
becomes `&gt;' and ' become &apos;).
 
1753
 
 
1754
=item escUrl + escHtml = 3 (or 7)
 
1755
 
 
1756
The result of a Perl expression is HTML-escaped (e.g., `>' becomes
 
1757
`&gt;') in normal text and URL-escaped (e.g., `&' becomes `%26')
 
1758
within of C<A>, C<EMBED>, C<IMG>, C<IFRAME>, C<FRAME> and C<LAYER> tags.
 
1759
 
 
1760
=item escUrl = 2 (or 6)
 
1761
 
 
1762
The result of a Perl expression is always URL-escaped (e.g., `&'
 
1763
becomes `%26').
 
1764
 
 
1765
=item escHtml = 1 (or 5)
 
1766
 
 
1767
The result of a Perl expression is always HTML-escaped (e.g., `>'
 
1768
becomes `&gt;').
 
1769
 
 
1770
=item escNode = 0
 
1771
 
 
1772
No escaping takes place.
 
1773
 
 
1774
=item escEscape = 4
 
1775
 
 
1776
If you add this value to the above Embperl will always perform the
 
1777
escaping. Without it is possible to disable escaping by preceeding the item that
 
1778
normaly is escaped with a backslash. While this is a handy thing, it could
 
1779
be very dangerous in situations, where content that is inserted by some
 
1780
user is redisplayed, because they can enter arbitary HTML and preceed them
 
1781
with a backslash to avoid correct escaping when their input is redisplayed
 
1782
again.
 
1783
 
 
1784
=back
 
1785
 
 
1786
NOTE: You can localize $escmode inside a [+ +] block, e.g. to turn escaping
 
1787
temporary off and output C<$data> write
 
1788
 
 
1789
    [+ do { local $escmode = 0 ; $data } +]
 
1790
 
 
1791
 
 
1792
=head2 Embperl_Input_Escmode
 
1793
 
 
1794
=over
 
1795
 
 
1796
=item Env:
 
1797
 
 
1798
EMBPERL_INPUT_ESCMODE
 
1799
 
 
1800
=item Method:
 
1801
 
 
1802
$component -> config -> input_escmode I<[read only]>
 
1803
 
 
1804
=item Default:
 
1805
 
 
1806
 
1807
 
 
1808
=item Since:
 
1809
 
 
1810
2.0b6
 
1811
 
 
1812
=back
 
1813
 
 
1814
 
 
1815
Tells Embperl how to handle escape sequences that are found in the source.
 
1816
 
 
1817
=over 
 
1818
 
 
1819
=item 0
 
1820
 
 
1821
don't interpret input (default)
 
1822
 
 
1823
 
 
1824
=item 1   
 
1825
 
 
1826
unescape html escapes to their characters (i.e. &lt; becomes < )
 
1827
inside of Perl code
 
1828
 
 
1829
=item 2
 
1830
 
 
1831
unescape url escapes to their characters (i.e. %26; becomes & )
 
1832
inside of Perl code
 
1833
 
 
1834
=item 3
 
1835
 
 
1836
unescape html and url escapes, depending on the context
 
1837
 
 
1838
=back
 
1839
 
 
1840
Add 4 to remove html tags inside of Perl code. This is helpfull when
 
1841
an html editor insert html tags like <br> inside your Perl code.
 
1842
 
 
1843
Set EMBPERL_INPUT_ESCMODE to 7 to get the old default of Embperl < 2.0b6
 
1844
 
 
1845
Set EMBPERL_INPUT_ESCMODE to 0 to get the old behaviour when optRawInput was set.
 
1846
 
 
1847
 
 
1848
=head2 Embperl_Input_Charset
 
1849
 
 
1850
=over
 
1851
 
 
1852
=item Env:
 
1853
 
 
1854
EMBPERL_INPUT_CHARSET
 
1855
 
 
1856
=item Method:
 
1857
 
 
1858
$component -> config -> input_charset 
 
1859
 
 
1860
=back
 
1861
 
 
1862
 
 
1863
NOT YET IMPLEMENTED!
 
1864
 
 
1865
 
 
1866
 
 
1867
=head2 Embperl_Top_Include
 
1868
 
 
1869
=over
 
1870
 
 
1871
=item Env:
 
1872
 
 
1873
EMBPERL_TOP_INCLUDE
 
1874
 
 
1875
=item Method:
 
1876
 
 
1877
$component -> config -> top_include 
 
1878
 
 
1879
=item Since:
 
1880
 
 
1881
2.0b10
 
1882
 
 
1883
=back
 
1884
 
 
1885
 
 
1886
Give a pieces of code that is include at the very top of every file.
 
1887
 
 
1888
Example:
 
1889
 
 
1890
    Embperl_Top_Include "use MY::Module;"
 
1891
 
 
1892
This will cause MY::Module to be used in every page. Note that 
 
1893
Embperl_Top_Include must contain valid Perl code and must be
 
1894
ended with a semikolon.
 
1895
 
 
1896
B<NOTE:> If you pass top_include as parameter to Execute it is
 
1897
only used in case the code is compiled (or recompiled) and not cached.
 
1898
 
 
1899
 
 
1900
=head2 Embperl_Cache_Key
 
1901
 
 
1902
=over
 
1903
 
 
1904
=item Env:
 
1905
 
 
1906
EMBPERL_CACHE_KEY
 
1907
 
 
1908
=item Method:
 
1909
 
 
1910
$component -> config -> cache_key I<[read only]>
 
1911
 
 
1912
=item Since:
 
1913
 
 
1914
2.0b1
 
1915
 
 
1916
=back
 
1917
 
 
1918
 
 
1919
literal string that is appended to the cache key
 
1920
 
 
1921
 
 
1922
=head2 Embperl_Cache_Key_Options
 
1923
 
 
1924
=over
 
1925
 
 
1926
=item Env:
 
1927
 
 
1928
EMBPERL_CACHE_KEY_OPTIONS
 
1929
 
 
1930
=item Method:
 
1931
 
 
1932
$component -> config -> cache_key_options I<[read only]>
 
1933
 
 
1934
=item Default:
 
1935
 
 
1936
all options set 
 
1937
 
 
1938
=item Since:
 
1939
 
 
1940
2.0b1
 
1941
 
 
1942
=back
 
1943
 
 
1944
 
 
1945
Tells Embperl how to create a key for caching of the output
 
1946
 
 
1947
=over
 
1948
 
 
1949
=item ckoptPathInfo  = 2
 
1950
 
 
1951
include the PathInfo into CacheKey 
 
1952
 
 
1953
=item ckoptQueryInfo = 4
 
1954
 
 
1955
include the QueryInfo into CacheKey 
 
1956
 
 
1957
=item ckoptDontCachePost = 8
 
1958
 
 
1959
don't cache POST requests  (not yet implemented)
 
1960
 
 
1961
=back
 
1962
 
 
1963
 
 
1964
=head2 Embperl_Expires_Func
 
1965
 
 
1966
=over
 
1967
 
 
1968
=item Env:
 
1969
 
 
1970
EMBPERL_EXPIRES_FUNC
 
1971
 
 
1972
=item Method:
 
1973
 
 
1974
$component -> config -> expires_func I<[read only]>
 
1975
 
 
1976
=item Since:
 
1977
 
 
1978
2.0b1
 
1979
 
 
1980
=back
 
1981
 
 
1982
 
 
1983
Function that is called every time before data is taken from the cache.
 
1984
If this funtion returns true, the data from the cache isn't used anymore,
 
1985
but rebuilt.
 
1986
 
 
1987
Function could be either a coderef (when passed to Execute), a name of a
 
1988
subroutine or a string starting with "sub " in which case it is compiled
 
1989
as anonymous subroutine.
 
1990
 
 
1991
NOTE: If C<&EXPIRES> is defined inside the page, it get evaluated before 
 
1992
the excecution of the page
 
1993
 
 
1994
 
 
1995
=head2 Embperl_Cache_Key_Func
 
1996
 
 
1997
=over
 
1998
 
 
1999
=item Env:
 
2000
 
 
2001
EMBPERL_CACHE_KEY_FUNC
 
2002
 
 
2003
=item Method:
 
2004
 
 
2005
$component -> config -> cache_key_func 
 
2006
 
 
2007
=item Since:
 
2008
 
 
2009
2.0b1
 
2010
 
 
2011
=back
 
2012
 
 
2013
 
 
2014
function that should be called when build a cache key. The result is
 
2015
appended to the cache key.
 
2016
 
 
2017
 
 
2018
=head2 Embperl_Expires_In
 
2019
 
 
2020
=over
 
2021
 
 
2022
=item Env:
 
2023
 
 
2024
EMBPERL_EXPIRES_IN
 
2025
 
 
2026
=item Method:
 
2027
 
 
2028
$component -> config -> expires_in I<[read only]>
 
2029
 
 
2030
=item Since:
 
2031
 
 
2032
2.0b1
 
2033
 
 
2034
=back
 
2035
 
 
2036
 
 
2037
Time in seconds that the output should be cached. (0 = never, -1 = forever)
 
2038
 
 
2039
NOTE: If C<$EXPIRES> is set inside the page, it get evaluated before 
 
2040
the excecution of the page
 
2041
 
 
2042
=head2 Embperl_Expires_Filename
 
2043
 
 
2044
=over
 
2045
 
 
2046
=item Env:
 
2047
 
 
2048
EMBPERL_EXPIRES_FILENAME
 
2049
 
 
2050
=item Method:
 
2051
 
 
2052
$component -> config -> expires_filename I<[read only]>
 
2053
 
 
2054
=item Since:
 
2055
 
 
2056
2.0b8
 
2057
 
 
2058
=back
 
2059
 
 
2060
 
 
2061
Cache should be expired when the given file is modified.
 
2062
 
 
2063
=head2 Embperl_Syntax
 
2064
 
 
2065
=over
 
2066
 
 
2067
=item Env:
 
2068
 
 
2069
EMBPERL_SYNTAX
 
2070
 
 
2071
=item Method:
 
2072
 
 
2073
$component -> config -> syntax 
 
2074
 
 
2075
=item Default:
 
2076
 
 
2077
Embperl
 
2078
 
 
2079
=item Since:
 
2080
 
 
2081
2.0b1
 
2082
 
 
2083
=back
 
2084
 
 
2085
 
 
2086
Used to tell Embperl which syntax to use inside a page. Embperl comes with
 
2087
the following syntaxes: 
 
2088
 
 
2089
 
 
2090
=over
 
2091
 
 
2092
=item EmbperlHTML
 
2093
 
 
2094
all the HTML tags that Embperl recognizes by default
 
2095
 
 
2096
=item EmbperlBlocks
 
2097
 
 
2098
all the [ ] blocks that Embperl supports
 
2099
 
 
2100
=item Embperl
 
2101
 
 
2102
(default; contains EmbperlHtml and EmbperlBlocks)
 
2103
 
 
2104
=item ASP
 
2105
 
 
2106
<%  %> and <%=  %>, see perldoc Embperl::Syntax::ASP
 
2107
 
 
2108
=item SSI
 
2109
 
 
2110
Server Side Includes, see perldoc Embperl::Syntax::SSI
 
2111
 
 
2112
=item Perl
 
2113
 
 
2114
File contains pure Perl (similar to Apache::Registry), but
 
2115
can be used inside EmbperlObject
 
2116
 
 
2117
=item Text
 
2118
 
 
2119
File contains only Text, no actions are taken on the Text
 
2120
 
 
2121
=item Mail
 
2122
 
 
2123
Defines the <mail:send> tag, for sending mail. This is an
 
2124
example for a taglib, which could be a base for writing
 
2125
your own taglib to extent the number of available tags
 
2126
 
 
2127
=item POD
 
2128
 
 
2129
translates pod files to XML, which can be converted to 
 
2130
the desired output format by an XSLT transformation
 
2131
 
 
2132
=item RTF
 
2133
 
 
2134
Can be used to process word processing documents in RTF format
 
2135
 
 
2136
=back
 
2137
 
 
2138
You can get a description for each syntax if you type
 
2139
 
 
2140
    perldoc Embperl::Syntax::xxx
 
2141
 
 
2142
where 'xxx' is the name of the syntax.
 
2143
 
 
2144
You can also specify multiple syntaxes e.g.
 
2145
 
 
2146
    EMBPERL_SYNTAX "Embperl SSI"
 
2147
 
 
2148
    Execute ({inputfile => '*', syntax => 'Embperl ASP'}) ;
 
2149
 
 
2150
The 'syntax' metacommand allows to switch the syntax or to 
 
2151
add or subtract syntaxes e.g.
 
2152
 
 
2153
    [$ syntax + Mail $]
 
2154
 
 
2155
will add the Mail taglib so the <mail:send> tag is available after
 
2156
this line.
 
2157
 
 
2158
    [$ syntax - Mail $]
 
2159
 
 
2160
now the <mail:send> tag is unknown again
 
2161
 
 
2162
    [$ syntax SSI $]
 
2163
 
 
2164
now you can only use SSI commands inside your page.
 
2165
 
 
2166
 
 
2167
=head2 Embperl_Recipe
 
2168
 
 
2169
=over
 
2170
 
 
2171
=item Env:
 
2172
 
 
2173
EMBPERL_RECIPE
 
2174
 
 
2175
=item Method:
 
2176
 
 
2177
$component -> config -> recipe I<[read only]>
 
2178
 
 
2179
=item Since:
 
2180
 
 
2181
2.0b4
 
2182
 
 
2183
=back
 
2184
 
 
2185
 
 
2186
Tells Embperl which recipe to use to process this component
 
2187
 
 
2188
=head2 Embperl_Xsltstylesheet
 
2189
 
 
2190
=over
 
2191
 
 
2192
=item Env:
 
2193
 
 
2194
EMBPERL_XSLTSTYLESHEET
 
2195
 
 
2196
=item Method:
 
2197
 
 
2198
$component -> config -> xsltstylesheet I<[read only]>
 
2199
 
 
2200
=item Since:
 
2201
 
 
2202
2.0b5
 
2203
 
 
2204
=back
 
2205
 
 
2206
 
 
2207
Tell the xslt processor which stylsheet to use.
 
2208
 
 
2209
=head2 Embperl_Xsltproc
 
2210
 
 
2211
=over
 
2212
 
 
2213
=item Env:
 
2214
 
 
2215
EMBPERL_XSLTPROC
 
2216
 
 
2217
=item Method:
 
2218
 
 
2219
$component -> config -> xsltproc I<[read only]>
 
2220
 
 
2221
=item Default:
 
2222
 
 
2223
depends on compiltime options
 
2224
 
 
2225
=item Since:
 
2226
 
 
2227
2.0b5
 
2228
 
 
2229
=back
 
2230
 
 
2231
 
 
2232
Tells Embperl which xslt processor to use. Current C<libxslt> and C<xalan>
 
2233
are supported by Embperl, but they must be compiled in to be available.
 
2234
 
 
2235
 
 
2236
=head1 Parameters
 
2237
 
 
2238
Parameters gives addtionaly information about the current request
 
2239
or the execution of the current component. So we have two sorts of
 
2240
parameters I<Request> and I<Component> parameters. Request
 
2241
parameters are automaticly setup by Embperl with information
 
2242
Embperl takes from the current running enviroment. When
 
2243
Embperl is invoked via the C<Execute> function, you can pass any of
 
2244
the parameters to Execute. Component parameters mainly reflect
 
2245
the parameters given to C<Execute>.
 
2246
 
 
2247
=head2 filename
 
2248
 
 
2249
=over
 
2250
 
 
2251
=item Method:
 
2252
 
 
2253
$request -> param -> filename 
 
2254
 
 
2255
=item Since:
 
2256
 
 
2257
2.0b6
 
2258
 
 
2259
=back
 
2260
 
 
2261
 
 
2262
Gives the filename of the file that was actualy requested.
 
2263
Inside of the applications C<init> function it can be changed
 
2264
to force Embperl to serve a different file.
 
2265
 
 
2266
 
 
2267
=head2 unparsed_uri
 
2268
 
 
2269
=over
 
2270
 
 
2271
=item Method:
 
2272
 
 
2273
$request -> param -> unparsed_uri 
 
2274
 
 
2275
=item Since:
 
2276
 
 
2277
2.0b6
 
2278
 
 
2279
=back
 
2280
 
 
2281
 
 
2282
The full unparsed_uri, includeing the query_string and the path_info.
 
2283
 
 
2284
=head2 uri
 
2285
 
 
2286
=over
 
2287
 
 
2288
=item Method:
 
2289
 
 
2290
$request -> param -> uri 
 
2291
 
 
2292
=item Since:
 
2293
 
 
2294
2.0b6
 
2295
 
 
2296
=back
 
2297
 
 
2298
 
 
2299
The decoded path of the unparsed_uri.
 
2300
 
 
2301
=head2 server_addr
 
2302
 
 
2303
=over
 
2304
 
 
2305
=item Method:
 
2306
 
 
2307
$request -> param -> server_addr 
 
2308
 
 
2309
=item Since:
 
2310
 
 
2311
2.0b9
 
2312
 
 
2313
=back
 
2314
 
 
2315
 
 
2316
URL of the server of the current request in the form
 
2317
schema://addr:port/ e.g. http://perl.apache.org/ (port is omitted if it is
 
2318
an default port)
 
2319
 
 
2320
=head2 path_info
 
2321
 
 
2322
=over
 
2323
 
 
2324
=item Method:
 
2325
 
 
2326
$request -> param -> path_info 
 
2327
 
 
2328
=item Since:
 
2329
 
 
2330
2.0b6
 
2331
 
 
2332
=back
 
2333
 
 
2334
 
 
2335
The path_info, that is anything in the path after the file the is currently served.
 
2336
 
 
2337
=head2 query_info
 
2338
 
 
2339
=over
 
2340
 
 
2341
=item Method:
 
2342
 
 
2343
$request -> param -> query_info 
 
2344
 
 
2345
=item Since:
 
2346
 
 
2347
2.0b6
 
2348
 
 
2349
=back
 
2350
 
 
2351
 
 
2352
Any parameters passed in a GET request after the question mark. The hash
 
2353
C<%fdat> will contain these values in a already decoded and easy to use way.
 
2354
So it's normly more convenient to use C<%fdat> instead.
 
2355
 
 
2356
=head2 language
 
2357
 
 
2358
=over
 
2359
 
 
2360
=item Method:
 
2361
 
 
2362
$request -> param -> language 
 
2363
 
 
2364
=item Since:
 
2365
 
 
2366
2.0b6
 
2367
 
 
2368
=back
 
2369
 
 
2370
 
 
2371
The primary langange found in the browser C<Accept-Language> HTTP header.
 
2372
This value is used for all language dependend functions inside Embperl.
 
2373
You can set it change the selection of message returned by C<$request -&gt; gettext>
 
2374
and C<[= =]>.
 
2375
 
 
2376
=head2 cookies
 
2377
 
 
2378
=over
 
2379
 
 
2380
=item Method:
 
2381
 
 
2382
$request -> param -> cookies 
 
2383
 
 
2384
=item Since:
 
2385
 
 
2386
2.0b6
 
2387
 
 
2388
=back
 
2389
 
 
2390
 
 
2391
A hashref that contains all cookies send by the browser to the server.
 
2392
 
 
2393
=head2 inputfile
 
2394
 
 
2395
=over
 
2396
 
 
2397
=item Method:
 
2398
 
 
2399
$component -> param -> inputfile I<[read only]>
 
2400
 
 
2401
=item Since:
 
2402
 
 
2403
1.0.0
 
2404
 
 
2405
=back
 
2406
 
 
2407
 
 
2408
Give the name of the file that should be processed, e.g.
 
2409
 
 
2410
    Execute({inputfile => 'mysource.epl'}) ;
 
2411
 
 
2412
There is a shortcut when you only need to give the input file
 
2413
and no other parameters. The above is will do the same as:
 
2414
 
 
2415
    Execute('mysource.epl') ;
 
2416
 
 
2417
=head2 outputfile
 
2418
 
 
2419
=over
 
2420
 
 
2421
=item Method:
 
2422
 
 
2423
$component -> param -> outputfile I<[read only]>
 
2424
 
 
2425
=item Default:
 
2426
 
 
2427
STDOUT
 
2428
 
 
2429
=item Since:
 
2430
 
 
2431
1.0.0
 
2432
 
 
2433
=back
 
2434
 
 
2435
 
 
2436
Specify a file to which the output should be written. Example:
 
2437
 
 
2438
    Execute({inputfile  => 'mysource.epl',
 
2439
             outputfile => 'myoutput.htm'}) ;
 
2440
 
 
2441
 
 
2442
=head2 input
 
2443
 
 
2444
=over
 
2445
 
 
2446
=item Method:
 
2447
 
 
2448
$component -> param -> input I<[read only]>
 
2449
 
 
2450
=item Since:
 
2451
 
 
2452
1.0.0
 
2453
 
 
2454
=back
 
2455
 
 
2456
 
 
2457
This parameter is used, when you have the source already in memory.
 
2458
You should pass a reference to a scalar that contains the source.
 
2459
Addtionaly you should give the L<inputfile> parameter, to allow
 
2460
Embperl caching to keep track of different in memory sources.
 
2461
The L<mtime> parameter is used to tell Embperl's cache if
 
2462
the source has change since the last call or not. If C<mtime>
 
2463
if C<undef> or of a different value as it was during the last
 
2464
call, the source is considered to be changed and everything 
 
2465
is recompiled. Example:
 
2466
 
 
2467
    # Get source from scalar
 
2468
    # Don't forget to modify mtime if $src changes
 
2469
 
 
2470
    $src = '<html><head><title>Page [+ $no +]</title></head>' ;
 
2471
 
 
2472
    Embperl::Execute ({ inputfile  => 'some name',
 
2473
                     input      => \$src,
 
2474
                     mtime      => 1 }) ;
 
2475
  
 
2476
 
 
2477
=head2 output
 
2478
 
 
2479
=over
 
2480
 
 
2481
=item Method:
 
2482
 
 
2483
$component -> param -> output I<[read only]>
 
2484
 
 
2485
=item Since:
 
2486
 
 
2487
1.0.0
 
2488
 
 
2489
=back
 
2490
 
 
2491
 
 
2492
Gives the possibility to write the output into a scalar
 
2493
instead of sending it to stdout or a file. You should give
 
2494
a reference to a scalar. Example:
 
2495
 
 
2496
    Execute({inputfile  => 'mysource.epl',
 
2497
             output     => \$out}) ;
 
2498
 
 
2499
 
 
2500
=head2 sub
 
2501
 
 
2502
=over
 
2503
 
 
2504
=item Method:
 
2505
 
 
2506
$component -> param -> sub I<[read only]>
 
2507
 
 
2508
=item Since:
 
2509
 
 
2510
1.2.0
 
2511
 
 
2512
=back
 
2513
 
 
2514
 
 
2515
Call the given Embperl subroutine defined with C<[$sub$]> inside the page.
 
2516
A shortcut for this is to append the name of the subroutine after the
 
2517
filename with a hash sign, so the following calls are doing the same thing:
 
2518
 
 
2519
    Execute('mysource.epl#mysub') ;
 
2520
 
 
2521
    Execute({inputfile  => 'mysource.epl',
 
2522
             sub        => 'mysub'}) ;
 
2523
 
 
2524
If you leave out the filename, the sub is called in the current file, so
 
2525
this can only be used inside a file that is already processed by Embperl.
 
2526
 
 
2527
=head2 subreq
 
2528
 
 
2529
=over
 
2530
 
 
2531
=item Method:
 
2532
 
 
2533
$component -> param -> subreq 
 
2534
 
 
2535
=item Since:
 
2536
 
 
2537
2.0b8, Apache 2.x
 
2538
 
 
2539
=back
 
2540
 
 
2541
 
 
2542
This utilizies Apache 2.0 filters to retrieve the output of a sub-request
 
2543
and uses it as input for the current component. For example if you have
 
2544
a CGI-Script and you need to post process it via Embperl or simply
 
2545
want to include it's output in another Embperl/Embperl::Object document
 
2546
you can write:
 
2547
 
 
2548
    [- Execute ({subreq => '/cgi-bin/script.cgi'}) -]
 
2549
 
 
2550
B<NOTE:> You have to specify a URI and not a filename!
 
2551
 
 
2552
=head2 import
 
2553
 
 
2554
=over
 
2555
 
 
2556
=item Method:
 
2557
 
 
2558
$component -> param -> import I<[read only]>
 
2559
 
 
2560
=item Since:
 
2561
 
 
2562
1.3.0
 
2563
 
 
2564
=back
 
2565
 
 
2566
 
 
2567
A value of one tells Embperl to define the subrountines inside the file (if not already
 
2568
done) and to import them as perl subroutines into the current namespace.
 
2569
 
 
2570
See B<[$ sub $]> metacommand and section about subroutines for more info.
 
2571
 
 
2572
A value of zero tells Embperl to simply precompile all code found in the page.
 
2573
(With 2.0 it is B<not> necessary anymore to do it before using the C<sub> parameter
 
2574
on a different file).
 
2575
 
 
2576
=head2 firstline
 
2577
 
 
2578
=over
 
2579
 
 
2580
=item Method:
 
2581
 
 
2582
$component -> param -> firstline I<[read only]>
 
2583
 
 
2584
=item Default:
 
2585
 
 
2586
1
 
2587
 
 
2588
=item Since:
 
2589
 
 
2590
1.2.0
 
2591
 
 
2592
=back
 
2593
 
 
2594
 
 
2595
Specifies the first linenumber of the sourcefile.
 
2596
 
 
2597
=head2 mtime
 
2598
 
 
2599
=over
 
2600
 
 
2601
=item Method:
 
2602
 
 
2603
$component -> param -> mtime I<[read only]>
 
2604
 
 
2605
=item Default:
 
2606
 
 
2607
undef
 
2608
 
 
2609
=item Since:
 
2610
 
 
2611
1.0.0
 
2612
 
 
2613
=back
 
2614
 
 
2615
 
 
2616
Last modification time of parameter L<input>. If undef the code passed
 
2617
by input is always recompiled, else the code is only recompiled if
 
2618
mtime changes.
 
2619
 
 
2620
=head2 param
 
2621
 
 
2622
=over
 
2623
 
 
2624
=item Method:
 
2625
 
 
2626
$component -> param -> param I<[read only]>
 
2627
 
 
2628
=item Since:
 
2629
 
 
2630
1.0.0
 
2631
 
 
2632
=back
 
2633
 
 
2634
 
 
2635
Can be used to pass parameters to the Embperl document and back. Must contain
 
2636
a reference to an array. Example:
 
2637
 
 
2638
    Execute({inputfile  => 'mysource.epl',
 
2639
             param      => [1, 2, 3]}) ;
 
2640
    Execute({inputfile  => 'mysource.epl',
 
2641
             param      => \@parameters}) ;
 
2642
 
 
2643
There is a shortcut, so the following code the aquivalent (NOTE: Don't use a
 
2644
array ref here):
 
2645
 
 
2646
    Execute('mysource.epl', 1, 2, 3) ;
 
2647
    Execute('mysource.epl', @parameters) ;
 
2648
 
 
2649
 
 
2650
The array C<@param> in the Embperl document is setup as an alias to the array.
 
2651
See F<eg/x/Excute.pl> for a more detailed example.
 
2652
 
 
2653
=head2 fdat
 
2654
 
 
2655
=over
 
2656
 
 
2657
=item Method:
 
2658
 
 
2659
$component -> param -> fdat I<[read only]>
 
2660
 
 
2661
=item Since:
 
2662
 
 
2663
1.0.0
 
2664
 
 
2665
=back
 
2666
 
 
2667
 
 
2668
Pass a hash reference to customly set %fdat. If C<ffld> is not given, C<ffld> will
 
2669
be set to C<keys %fdat>.
 
2670
 
 
2671
=head2 ffld
 
2672
 
 
2673
=over
 
2674
 
 
2675
=item Method:
 
2676
 
 
2677
$component -> param -> ffld I<[read only]>
 
2678
 
 
2679
=item Since:
 
2680
 
 
2681
1.0.0
 
2682
 
 
2683
=back
 
2684
 
 
2685
 
 
2686
Pass a array reference to customly set @fdat. Does not affect C<%fdat>.
 
2687
 
 
2688
=head2 object
 
2689
 
 
2690
=over
 
2691
 
 
2692
=item Method:
 
2693
 
 
2694
$component -> param -> object I<[read only]>
 
2695
 
 
2696
=item Since:
 
2697
 
 
2698
1.3.2
 
2699
 
 
2700
=back
 
2701
 
 
2702
 
 
2703
Takes a filename and returns an hashref that is blessed into the package of 
 
2704
the given file. That's usefull, if you want to call the subs inside the 
 
2705
given file, as methods. By using the C<isa> parameter (see below) you
 
2706
are able to provide an inherence tree. Additionaly you can use the returned
 
2707
hashref to store data for that object. Example:
 
2708
 
 
2709
  [# the file eposubs.htm defines two subs: txt1 and txt2 #]
 
2710
  [# first we create a new object #]
 
2711
  [- $subs = Execute ({'object' => 'eposubs.htm'}) -]
 
2712
 
 
2713
  [# then we call methods inside the object #]
 
2714
  txt1: [+ $subs -> txt1 +] <br>
 
2715
 
 
2716
  txt2: [+ $subs -> txt2 +] <br>
 
2717
 
 
2718
 
 
2719
=head2 isa
 
2720
 
 
2721
=over
 
2722
 
 
2723
=item Method:
 
2724
 
 
2725
$component -> param -> isa I<[read only]>
 
2726
 
 
2727
=item Since:
 
2728
 
 
2729
1.3.2
 
2730
 
 
2731
=back
 
2732
 
 
2733
 
 
2734
Takes a name of a file and pushes the package of that file into the @ISA
 
2735
array of the current file. By using this you can setup an inherence tree
 
2736
between Embperl documents. Is is also usefull within I<Embperl::Object>.
 
2737
Example:
 
2738
 
 
2739
    [! Execute ({'isa' => '../eposubs.htm'}) !]
 
2740
 
 
2741
=head2 errors
 
2742
 
 
2743
=over
 
2744
 
 
2745
=item Method:
 
2746
 
 
2747
$component -> param -> errors I<[read only]>
 
2748
 
 
2749
=item Since:
 
2750
 
 
2751
1.3.0
 
2752
 
 
2753
=back
 
2754
 
 
2755
 
 
2756
Takes a reference to an array. Upon return, the array will contain a copy of
 
2757
all errormessages, if any.
 
2758
 
 
2759
=head2 xsltparam
 
2760
 
 
2761
=over
 
2762
 
 
2763
=item Method:
 
2764
 
 
2765
$component -> param -> xsltparam 
 
2766
 
 
2767
=item Default:
 
2768
 
 
2769
%fdat
 
2770
 
 
2771
=item Since:
 
2772
 
 
2773
2.0b6
 
2774
 
 
2775
=back
 
2776
 
 
2777
 
 
2778
Takes a reference to hash which contains key/value pair that are accessable inside
 
2779
the stylesheet via <xsl:param>.
 
2780
 
 
2781
 
 
2782
 
 
2783
=head1 Embperl's Objects
 
2784
 
 
2785
There are three major objects in Embperl: I<application>, I<request> and I<component>.
 
2786
Each of these objects can be used to get information about the processing and
 
2787
control the execution. Each of these objects has a config sub-object, which makes
 
2788
the configuration accessable and, where possible, changeable at runtime. The C<config>
 
2789
method of these three objects returns a reference to the configuation object. The methods
 
2790
of these configurations objects are described in the section L<Configuration>.
 
2791
The request and the component object have addtionaly a parameter sub-object, which holds
 
2792
parameters passed to the current request/component. The C<param> method of these two
 
2793
objects returns the parameter sub-object. The methods of these parameter objects
 
2794
can be found in the section L<Parameters>.
 
2795
Addtionaly each of the three major objects has a set of own methods, which are described
 
2796
here.
 
2797
 
 
2798
=head2 thread
 
2799
 
 
2800
=over
 
2801
 
 
2802
=item Method:
 
2803
 
 
2804
$application -> thread I<[read only]>
 
2805
 
 
2806
=item Since:
 
2807
 
 
2808
2.0b6
 
2809
 
 
2810
=back
 
2811
 
 
2812
 
 
2813
Returns a reference to a object which hold per threads informations. There is only one
 
2814
such object per thread.
 
2815
 
 
2816
=head2 curr_req
 
2817
 
 
2818
=over
 
2819
 
 
2820
=item Method:
 
2821
 
 
2822
$application -> curr_req I<[read only]>
 
2823
 
 
2824
=item Since:
 
2825
 
 
2826
2.0b6
 
2827
 
 
2828
=back
 
2829
 
 
2830
 
 
2831
Returns a reference to the current request object i.e. the object of the
 
2832
request currently running.
 
2833
 
 
2834
=head2 config
 
2835
 
 
2836
=over
 
2837
 
 
2838
=item Method:
 
2839
 
 
2840
$application -> config I<[read only]>
 
2841
 
 
2842
=item Since:
 
2843
 
 
2844
2.0b6
 
2845
 
 
2846
=back
 
2847
 
 
2848
 
 
2849
Returns a reference to the configuration object of the application. See section L<Configuration>.
 
2850
 
 
2851
=head2 user_session
 
2852
 
 
2853
=over
 
2854
 
 
2855
=item Method:
 
2856
 
 
2857
$application -> user_session I<[read only]>
 
2858
 
 
2859
=item Since:
 
2860
 
 
2861
2.0b6
 
2862
 
 
2863
=back
 
2864
 
 
2865
 
 
2866
Returns a reference to the user session object.
 
2867
 
 
2868
=head2 state_session
 
2869
 
 
2870
=over
 
2871
 
 
2872
=item Method:
 
2873
 
 
2874
$application -> state_session I<[read only]>
 
2875
 
 
2876
=item Since:
 
2877
 
 
2878
2.0b6
 
2879
 
 
2880
=back
 
2881
 
 
2882
 
 
2883
Returns a reference to the state session object.
 
2884
 
 
2885
=head2 app_session
 
2886
 
 
2887
=over
 
2888
 
 
2889
=item Method:
 
2890
 
 
2891
$application -> app_session I<[read only]>
 
2892
 
 
2893
=item Since:
 
2894
 
 
2895
2.0b6
 
2896
 
 
2897
=back
 
2898
 
 
2899
 
 
2900
Returns a reference to the application session object.
 
2901
 
 
2902
=head2 udat
 
2903
 
 
2904
=over
 
2905
 
 
2906
=item Method:
 
2907
 
 
2908
$application -> udat I<[read only]>
 
2909
 
 
2910
=item Since:
 
2911
 
 
2912
2.0b6
 
2913
 
 
2914
=back
 
2915
 
 
2916
 
 
2917
Returns a reference to a hash which contains the data of the user session.
 
2918
This has can be used to access and modify user session data. It's the same
 
2919
as accessing the global L<%udat>.
 
2920
 
 
2921
=head2 sdat
 
2922
 
 
2923
=over
 
2924
 
 
2925
=item Method:
 
2926
 
 
2927
$application -> sdat I<[read only]>
 
2928
 
 
2929
=item Since:
 
2930
 
 
2931
2.0b6
 
2932
 
 
2933
=back
 
2934
 
 
2935
 
 
2936
Returns a reference to a hash which contains the data of the state session.
 
2937
This has can be used to access and modify state session data. It's the same
 
2938
as accessing the global L<%sdat>.
 
2939
 
 
2940
=head2 mdat
 
2941
 
 
2942
=over
 
2943
 
 
2944
=item Method:
 
2945
 
 
2946
$application -> mdat I<[read only]>
 
2947
 
 
2948
=item Since:
 
2949
 
 
2950
2.0b6
 
2951
 
 
2952
=back
 
2953
 
 
2954
 
 
2955
Returns a reference to a hash which contains the data of the application session.
 
2956
This has can be used to access and modify application session data. It's the same
 
2957
as accessing the global L<%mdat>.
 
2958
 
 
2959
 
 
2960
=head2 errors_count
 
2961
 
 
2962
=over
 
2963
 
 
2964
=item Method:
 
2965
 
 
2966
$application -> errors_count 
 
2967
 
 
2968
=item Since:
 
2969
 
 
2970
2.0b6
 
2971
 
 
2972
=back
 
2973
 
 
2974
 
 
2975
Contains the number of errors since last time send per mail. See also L<mail_errors_to>.
 
2976
 
 
2977
=head2 errors_last_time
 
2978
 
 
2979
=over
 
2980
 
 
2981
=item Method:
 
2982
 
 
2983
$application -> errors_last_time 
 
2984
 
 
2985
=item Since:
 
2986
 
 
2987
2.0b6
 
2988
 
 
2989
=back
 
2990
 
 
2991
 
 
2992
Time when the last error has occured.  See also L<mail_errors_to>.
 
2993
 
 
2994
=head2 errors_last_send_time
 
2995
 
 
2996
=over
 
2997
 
 
2998
=item Method:
 
2999
 
 
3000
$application -> errors_last_send_time 
 
3001
 
 
3002
=item Since:
 
3003
 
 
3004
2.0b6
 
3005
 
 
3006
=back
 
3007
 
 
3008
 
 
3009
Time when the last mail with error messages was sent.  See also L<mail_errors_to>.
 
3010
 
 
3011
=head2 apache_req
 
3012
 
 
3013
=over
 
3014
 
 
3015
=item Method:
 
3016
 
 
3017
$request -> apache_req I<[read only]>
 
3018
 
 
3019
=item Since:
 
3020
 
 
3021
2.0b6
 
3022
 
 
3023
=back
 
3024
 
 
3025
 
 
3026
Returns a reference to mod_perls Apache request object. In mod_perl 1 this is of
 
3027
type C<Apache::> in mod_perl 2 it's a C<Apache::RequestRec>.
 
3028
 
 
3029
=head2 config
 
3030
 
 
3031
=over
 
3032
 
 
3033
=item Method:
 
3034
 
 
3035
$request -> config I<[read only]>
 
3036
 
 
3037
=item Since:
 
3038
 
 
3039
2.0b6
 
3040
 
 
3041
=back
 
3042
 
 
3043
 
 
3044
Returns a reference to the configuration object of the request. See section L<Configuration>.
 
3045
 
 
3046
=head2 param
 
3047
 
 
3048
=over
 
3049
 
 
3050
=item Method:
 
3051
 
 
3052
$request -> param I<[read only]>
 
3053
 
 
3054
=item Since:
 
3055
 
 
3056
2.0b6
 
3057
 
 
3058
=back
 
3059
 
 
3060
 
 
3061
Returns a reference to the parameter object of the request. See section L<Parameters>.
 
3062
 
 
3063
=head2 component
 
3064
 
 
3065
=over
 
3066
 
 
3067
=item Method:
 
3068
 
 
3069
$request -> component I<[read only]>
 
3070
 
 
3071
=item Since:
 
3072
 
 
3073
2.0b6
 
3074
 
 
3075
=back
 
3076
 
 
3077
 
 
3078
Returns a reference to the object of component currently running. See component methods below.
 
3079
 
 
3080
=head2 app
 
3081
 
 
3082
=over
 
3083
 
 
3084
=item Method:
 
3085
 
 
3086
$request -> app I<[read only]>
 
3087
 
 
3088
=item Since:
 
3089
 
 
3090
2.0b6
 
3091
 
 
3092
=back
 
3093
 
 
3094
 
 
3095
Returns a reference to the object of application to which the current request belongs. 
 
3096
See application methods above.
 
3097
 
 
3098
 
 
3099
=head2 thread
 
3100
 
 
3101
=over
 
3102
 
 
3103
=item Method:
 
3104
 
 
3105
$request -> thread I<[read only]>
 
3106
 
 
3107
=item Since:
 
3108
 
 
3109
2.0b6
 
3110
 
 
3111
=back
 
3112
 
 
3113
 
 
3114
Returns a reference to a object which hold per threads informations. There is only one
 
3115
such object per thread.
 
3116
 
 
3117
=head2 request_count
 
3118
 
 
3119
=over
 
3120
 
 
3121
=item Method:
 
3122
 
 
3123
$request -> request_count I<[read only]>
 
3124
 
 
3125
=item Since:
 
3126
 
 
3127
2.0b6
 
3128
 
 
3129
=back
 
3130
 
 
3131
 
 
3132
Returns the number of request handled so far by this child process.
 
3133
 
 
3134
=head2 request_time
 
3135
 
 
3136
=over
 
3137
 
 
3138
=item Method:
 
3139
 
 
3140
$request -> request_time I<[read only]>
 
3141
 
 
3142
=item Since:
 
3143
 
 
3144
2.0b6
 
3145
 
 
3146
=back
 
3147
 
 
3148
 
 
3149
Start time of the current request.
 
3150
 
 
3151
=head2 session_mgnt
 
3152
 
 
3153
=over
 
3154
 
 
3155
=item Method:
 
3156
 
 
3157
$request -> session_mgnt I<[read only]>
 
3158
 
 
3159
=item Since:
 
3160
 
 
3161
2.0b6
 
3162
 
 
3163
=back
 
3164
 
 
3165
 
 
3166
Set to true if session management is available.
 
3167
 
 
3168
=head2 session_id
 
3169
 
 
3170
=over
 
3171
 
 
3172
=item Method:
 
3173
 
 
3174
$request -> session_id I<[read only]>
 
3175
 
 
3176
=item Since:
 
3177
 
 
3178
2.0b6
 
3179
 
 
3180
=back
 
3181
 
 
3182
 
 
3183
Combined id of current user and state session.
 
3184
 
 
3185
=head2 session_state_id
 
3186
 
 
3187
=over
 
3188
 
 
3189
=item Method:
 
3190
 
 
3191
$request -> session_state_id I<[read only]>
 
3192
 
 
3193
=item Since:
 
3194
 
 
3195
2.0b6
 
3196
 
 
3197
=back
 
3198
 
 
3199
 
 
3200
Id of the current state session as received by the browser, this
 
3201
means this method returns C<undef> for a new session.
 
3202
 
 
3203
=head2 session_user_id
 
3204
 
 
3205
=over
 
3206
 
 
3207
=item Method:
 
3208
 
 
3209
$request -> session_user_id I<[read only]>
 
3210
 
 
3211
=item Since:
 
3212
 
 
3213
2.0b6
 
3214
 
 
3215
=back
 
3216
 
 
3217
 
 
3218
Id of the current user session as received by the browser, this
 
3219
means this method returns C<undef> for a new session.
 
3220
 
 
3221
=head2 had_exit
 
3222
 
 
3223
=over
 
3224
 
 
3225
=item Method:
 
3226
 
 
3227
$request -> had_exit I<[read only]>
 
3228
 
 
3229
=item Since:
 
3230
 
 
3231
2.0b6
 
3232
 
 
3233
=back
 
3234
 
 
3235
 
 
3236
True if exit was called in one of the components processed so far.
 
3237
 
 
3238
=head2 log_file_start_pos
 
3239
 
 
3240
=over
 
3241
 
 
3242
=item Method:
 
3243
 
 
3244
$request -> log_file_start_pos I<[read only]>
 
3245
 
 
3246
=item Since:
 
3247
 
 
3248
2.0b6
 
3249
 
 
3250
=back
 
3251
 
 
3252
 
 
3253
File possition of the log file at the time when the request has started.
 
3254
 
 
3255
=head2 error
 
3256
 
 
3257
=over
 
3258
 
 
3259
=item Method:
 
3260
 
 
3261
$request -> error 
 
3262
 
 
3263
=item Since:
 
3264
 
 
3265
2.0b6
 
3266
 
 
3267
=back
 
3268
 
 
3269
 
 
3270
True if there were any error during the request.
 
3271
 
 
3272
=head2 errors
 
3273
 
 
3274
=over
 
3275
 
 
3276
=item Method:
 
3277
 
 
3278
$request -> errors 
 
3279
 
 
3280
=item Since:
 
3281
 
 
3282
2.0b6
 
3283
 
 
3284
=back
 
3285
 
 
3286
 
 
3287
Reference to an array which holds all error messages occured so far.
 
3288
 
 
3289
=head2 errdat1
 
3290
 
 
3291
=over
 
3292
 
 
3293
=item Method:
 
3294
 
 
3295
$request -> errdat1 
 
3296
 
 
3297
=item Since:
 
3298
 
 
3299
2.0b6
 
3300
 
 
3301
=back
 
3302
 
 
3303
 
 
3304
Additional informations passed to the error handler when an error is reported.
 
3305
 
 
3306
=head2 errdat2
 
3307
 
 
3308
=over
 
3309
 
 
3310
=item Method:
 
3311
 
 
3312
$request -> errdat2 
 
3313
 
 
3314
=item Since:
 
3315
 
 
3316
2.0b6
 
3317
 
 
3318
=back
 
3319
 
 
3320
 
 
3321
Additional informations passed to the error handler when an error is reported.
 
3322
 
 
3323
=head2 lastwarn
 
3324
 
 
3325
=over
 
3326
 
 
3327
=item Method:
 
3328
 
 
3329
$request -> lastwarn 
 
3330
 
 
3331
=item Since:
 
3332
 
 
3333
2.0b6
 
3334
 
 
3335
=back
 
3336
 
 
3337
 
 
3338
Last warning message.
 
3339
 
 
3340
=head2 cleanup_vars
 
3341
 
 
3342
=over
 
3343
 
 
3344
=item Method:
 
3345
 
 
3346
$request -> cleanup_vars 
 
3347
 
 
3348
=item Since:
 
3349
 
 
3350
2.0b6
 
3351
 
 
3352
=back
 
3353
 
 
3354
 
 
3355
Reference to an array which is filled with references to variables that should be
 
3356
cleaned up after the request. You can add your own variables that needs cleanup here,
 
3357
but you should never remove any variables from this array.
 
3358
 
 
3359
=head2 cleanup_packages
 
3360
 
 
3361
=over
 
3362
 
 
3363
=item Method:
 
3364
 
 
3365
$request -> cleanup_packages 
 
3366
 
 
3367
=item Since:
 
3368
 
 
3369
2.0b6
 
3370
 
 
3371
=back
 
3372
 
 
3373
 
 
3374
Refernce to a hash which contains all packages that must be cleaned up after the request.
 
3375
 
 
3376
=head2 initial_cwd
 
3377
 
 
3378
=over
 
3379
 
 
3380
=item Method:
 
3381
 
 
3382
$request -> initial_cwd I<[read only]>
 
3383
 
 
3384
=item Since:
 
3385
 
 
3386
2.0b6
 
3387
 
 
3388
=back
 
3389
 
 
3390
 
 
3391
Working directory when the request started.
 
3392
 
 
3393
=head2 messages
 
3394
 
 
3395
=over
 
3396
 
 
3397
=item Method:
 
3398
 
 
3399
$request -> messages 
 
3400
 
 
3401
=item Since:
 
3402
 
 
3403
2.0b6
 
3404
 
 
3405
=back
 
3406
 
 
3407
 
 
3408
Reference to an array of hashs of messages. This is used by Embperl to translate
 
3409
message into different languages. When a C<[= =]> block is processed or
 
3410
$request -> gettext is called, Embperl searches this array. It starts from the first
 
3411
element in the array (each element in the array must be a hashref) and tries to
 
3412
lookup the text for the given symbol in hash. When it fails it goes to the
 
3413
next array element. This way you can setup multiple translation tables that are search
 
3414
for the symbol. Example:
 
3415
 
 
3416
    %messages =
 
3417
        (
 
3418
        'de' =>
 
3419
            {
 
3420
            'addsel1' => 'Klicken Sie auf die Kategorie zu der Sie etwas hinzufļæ½gen mļæ½chten:',
 
3421
            'addsel2' => 'oder fļæ½gen Sie eine neue Kategorie hinzu. Bitte geben Sie die Beschreibung in so vielen Sprachen wie Ihnen mļæ½glich ein.',
 
3422
            'addsel3' => 'Falls Sie die ļæ½bersetzung nicht wissen, lassen Sie das entsprechende Eingabefeld leer.',
 
3423
            'addsel4' => 'Kategorie hinzufļæ½gen',
 
3424
            },
 
3425
         'en' =>
 
3426
            {
 
3427
            'addsel1' => 'Click on the category for wich you want to add a new item:',
 
3428
            'addsel2' => 'or add new category. Please enter the description in as much languages as possible.',
 
3429
            'addsel3' => 'If you don\'t know the translation leave the corresponding input field empty.',
 
3430
            'addsel4' => 'Add category',
 
3431
            }
 
3432
        ) ;
 
3433
 
 
3434
 
 
3435
    $lang = $request -> param -> language ;
 
3436
    push @{$request -> messages}, $messages{$lang} ;
 
3437
    push @{$request -> default_messages}, $messages{'en'} if ($lang ne 'en') ;
 
3438
 
 
3439
C<$request -> param -> language> retrieves the language as given by the browser
 
3440
language-accept header (or set before in your program). Then it pushes the german
 
3441
or english messages hash onto the message array. Addtionaly it pushes the english
 
3442
messages on the default_messages array. Messages will be taken from this array
 
3443
if nothing can be found in the messages array.
 
3444
 
 
3445
 
 
3446
=head2 default_messages
 
3447
 
 
3448
=over
 
3449
 
 
3450
=item Method:
 
3451
 
 
3452
$request -> default_messages 
 
3453
 
 
3454
=item Since:
 
3455
 
 
3456
2.0b6
 
3457
 
 
3458
=back
 
3459
 
 
3460
 
 
3461
Reference to an array with default messages. Messages will be taken from this array
 
3462
if nothing can be found in the L<messages> array.
 
3463
 
 
3464
 
 
3465
=head2 config
 
3466
 
 
3467
=over
 
3468
 
 
3469
=item Method:
 
3470
 
 
3471
$component -> config I<[read only]>
 
3472
 
 
3473
=item Since:
 
3474
 
 
3475
2.0b6
 
3476
 
 
3477
=back
 
3478
 
 
3479
 
 
3480
Returns an reference to the configuration object of the component.
 
3481
 
 
3482
=head2 param
 
3483
 
 
3484
=over
 
3485
 
 
3486
=item Method:
 
3487
 
 
3488
$component -> param I<[read only]>
 
3489
 
 
3490
=item Since:
 
3491
 
 
3492
2.0b6
 
3493
 
 
3494
=back
 
3495
 
 
3496
 
 
3497
Returns an reference to the parameter object of the component.
 
3498
 
 
3499
=head2 req_running
 
3500
 
 
3501
=over
 
3502
 
 
3503
=item Method:
 
3504
 
 
3505
$component -> req_running I<[read only]>
 
3506
 
 
3507
=item Since:
 
3508
 
 
3509
2.0b6
 
3510
 
 
3511
=back
 
3512
 
 
3513
 
 
3514
True if Embperl is inside of the execution of the request.
 
3515
 
 
3516
=head2 sub_req
 
3517
 
 
3518
=over
 
3519
 
 
3520
=item Method:
 
3521
 
 
3522
$component -> sub_req I<[read only]>
 
3523
 
 
3524
=item Since:
 
3525
 
 
3526
2.0b6
 
3527
 
 
3528
=back
 
3529
 
 
3530
 
 
3531
True is this is not the outermost Embperl component, i.e. this component is
 
3532
called from within another component.
 
3533
 
 
3534
=head2 inside_sub
 
3535
 
 
3536
=over
 
3537
 
 
3538
=item Method:
 
3539
 
 
3540
$component -> inside_sub I<[read only]>
 
3541
 
 
3542
=item Since:
 
3543
 
 
3544
2.0b6
 
3545
 
 
3546
=back
 
3547
 
 
3548
 
 
3549
True is we are inside a Embperl subroutine ([$ sub $] ... [$ endsub $])
 
3550
 
 
3551
=head2 had_exit
 
3552
 
 
3553
=over
 
3554
 
 
3555
=item Method:
 
3556
 
 
3557
$component -> had_exit I<[read only]>
 
3558
 
 
3559
=item Since:
 
3560
 
 
3561
2.0b6
 
3562
 
 
3563
=back
 
3564
 
 
3565
 
 
3566
True if the exit was called during the excution of the component.
 
3567
 
 
3568
=head2 path_ndx
 
3569
 
 
3570
=over
 
3571
 
 
3572
=item Method:
 
3573
 
 
3574
$component -> path_ndx I<[read only]>
 
3575
 
 
3576
=item Since:
 
3577
 
 
3578
2.0b6
 
3579
 
 
3580
=back
 
3581
 
 
3582
 
 
3583
Tells Embperl how much parts of the L<path> should be ignored when searching
 
3584
throught the path.
 
3585
 
 
3586
=head2 cwd
 
3587
 
 
3588
=over
 
3589
 
 
3590
=item Method:
 
3591
 
 
3592
$component -> cwd I<[read only]>
 
3593
 
 
3594
=item Since:
 
3595
 
 
3596
2.0b6
 
3597
 
 
3598
=back
 
3599
 
 
3600
 
 
3601
Directory of the source file of the component.
 
3602
 
 
3603
=head2 sourcefile
 
3604
 
 
3605
=over
 
3606
 
 
3607
=item Method:
 
3608
 
 
3609
$component -> sourcefile I<[read only]>
 
3610
 
 
3611
=item Since:
 
3612
 
 
3613
2.0b6
 
3614
 
 
3615
=back
 
3616
 
 
3617
 
 
3618
Source file of the component.
 
3619
 
 
3620
 
 
3621
=head2 syntax
 
3622
 
 
3623
=over
 
3624
 
 
3625
=item Method:
 
3626
 
 
3627
$component -> syntax 
 
3628
 
 
3629
=item Since:
 
3630
 
 
3631
2.0b6
 
3632
 
 
3633
=back
 
3634
 
 
3635
 
 
3636
Syntax of the component
 
3637
 
 
3638
 
 
3639
=head2 prev
 
3640
 
 
3641
=over
 
3642
 
 
3643
=item Method:
 
3644
 
 
3645
$component -> prev I<[read only]>
 
3646
 
 
3647
=item Since:
 
3648
 
 
3649
2.0b6
 
3650
 
 
3651
=back
 
3652
 
 
3653
 
 
3654
Previous component, e.g. the component which called this component. 
 
3655
 
 
3656
 
 
3657
=head2 import_stash
 
3658
 
 
3659
=over
 
3660
 
 
3661
=item Method:
 
3662
 
 
3663
$component -> import_stash I<[read only]>
 
3664
 
 
3665
=item Since:
 
3666
 
 
3667
2.0b6
 
3668
 
 
3669
=back
 
3670
 
 
3671
 
 
3672
While importing a component this is set to the stash to which symbols are imported. 
 
3673
C<undef> during normal execution.
 
3674
 
 
3675
=head2 exports
 
3676
 
 
3677
=over
 
3678
 
 
3679
=item Method:
 
3680
 
 
3681
$component -> exports 
 
3682
 
 
3683
=item Since:
 
3684
 
 
3685
2.0b6
 
3686
 
 
3687
=back
 
3688
 
 
3689
 
 
3690
Symbols that should be exported by this component.
 
3691
 
 
3692
=head2 curr_package
 
3693
 
 
3694
=over
 
3695
 
 
3696
=item Method:
 
3697
 
 
3698
$component -> curr_package I<[read only]>
 
3699
 
 
3700
=item Since:
 
3701
 
 
3702
2.0b6
 
3703
 
 
3704
=back
 
3705
 
 
3706
 
 
3707
Name of the package the component is executed in.
 
3708
 
 
3709
 
 
3710
=head2 code
 
3711
 
 
3712
=over
 
3713
 
 
3714
=item Method:
 
3715
 
 
3716
$component -> code 
 
3717
 
 
3718
=item Since:
 
3719
 
 
3720
2.0b6
 
3721
 
 
3722
=back
 
3723
 
 
3724
 
 
3725
Only valid during compile phase. Can used to retrive and modify the code
 
3726
Embperl is generating. See Embperl::Syntax for more details and Embperl::Syntax::RTF
 
3727
for an example.
 
3728