view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
@exts = $self->{admin}->load_all_extensions;
}
my %seen;
foreach my $obj ( @exts ) {
while (my ($method, $glob) = each %{ref($obj) . '::'}) {
next unless $obj->can($method);
next if $method =~ /^_/;
next if $method eq uc($method);
$seen{$method}++;
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
@exts = $self->{admin}->load_all_extensions;
}
my %seen;
foreach my $obj ( @exts ) {
while (my ($method, $glob) = each %{ref($obj) . '::'}) {
next unless $obj->can($method);
next if $method =~ /^_/;
next if $method eq uc($method);
$seen{$method}++;
}
view all matches for this distribution
view release on metacpan or search on metacpan
# better error checking ?
$filename ||= $r->filename();
# using _ is optimized to use last stat() record
return(404) if (! -e $filename or -d _);
# alias $0 to filename, bind to glob for bug workaround
local *0 = \$filename;
# ASP object creation, a lot goes on in there!
# method call used for speed optimization, as OO calls are slow
my $self = &Apache::ASP::new('Apache::ASP', $r, $filename);
# for runtime use/require library loads from global/INCDir
# do this in the handler section to cover all the execution stages
# following object set up as possible.
local @INC = ($self->{global}, $INCDir, @INC);
# Execute if no errors
$self->{errs} || &Run($self);
# moved print of object to the end, so we'll pick up all the
# do not want the object to be DESTROY()'d
my $dir_config = $r->dir_config;
my $headers_in = $r->headers_in;
my $self = { r => $r, dir_config => $dir_config };
# global is the default for the state dir and also
# a default lib path for perl, as well as where global.asa
# can be found
my $global = &get_dir_config($dir_config, 'Global') || '.';
$global = &AbsPath($global, $dirname);
# asp object is handy for passing state around
$self = bless
{
'basename' => $basename,
'dbg' => &get_dir_config($dir_config, 'Debug') || 0, # debug level
'destroy' => 1,
'dir_config' => $dir_config,
'headers_in' => $headers_in,
filename => $filename,
global => $global,
global_package => &get_dir_config($dir_config, 'GlobalPackage'),
inode_names => &get_dir_config($dir_config, 'InodeNames'),
no_cache => &get_dir_config($dir_config, 'NoCache'),
'r' => $r, # apache request object
start_time => $start_time,
stat_scripts => &config($self, 'StatScripts', undef, 1),
if($self->LoadModule('Gzip','Compress::Zlib')) {
$self->{compressgzip} = 1;
}
}
# must have global directory into which we put the global.asa
# and possibly state files, optimize out the case of . or ..
if($self->{global} !~ /^(\.|\.\.)$/) {
-d $self->{global} or
$self->Error("global path, $self->{global}, is not a directory");
}
# includes_dir calculation
if($filename =~ m,^((/|[a-zA-Z]:).*[/\\])[^/\\]+?$,) {
$self->{dirname} = $1;
} else {
$self->{dirname} = '.';
}
$self->{includes_dir} = [
$self->{dirname},
$self->{global},
split(/;/, &config($self, 'IncludesDir') || ''),
];
# register cleanup before the state files get set in InitObjects
# this way DESTROY gets called every time this script is done
#### WAS INIT OBJECTS, REMOVED DECOMP FOR SPEED
# GLOBALASA, RESPONSE, REQUEST, SERVER
# always create these
# global_asa assigns itself to parent object automatically
my $global_asa = &Apache::ASP::GlobalASA::new($self);
$self->{Request} = &Apache::ASP::Request::new($self);
$self->{Response} = &Apache::ASP::Response::new($self);
# Server::new() is just one line, so execute directly
$self->{Server} = bless {asp => $self}, 'Apache::ASP::Server';
#&Apache::ASP::Server::new($self);
# id is not generally useful for the ASP object now, so calculate
# it here now, only to twist the package object for this script
# pass in basename for where to find the file for InodeNames, and the full path
# for the FileId otherwise
my $package = $global_asa->{'package'}.'::'.&FileId($self, $self->{basename}, $self->{filename});
$self->{'package'} = $package;
$self->{init_packages} = ['main', $global_asa->{'package'}, $self->{'package'}];
} else {
$self->{'package'} = $global_asa->{'package'};
$self->{init_packages} = ['main', $global_asa->{'package'}];
}
$self->{state_dir} = &config($self, 'StateDir', undef, $self->{global}.'/.state');
$self->{state_dir} =~ tr///; # untaint
# if no state has been config'd, then set up none of the
# state objects: Application, Internal, Session
unless(&get_dir_config($dir_config, 'NoState')) {
if($has_args) {
$args = $has_args;
$args =~ s/^\s+args\s*\=\s*\"?//sgo;
}
# global directory, as well as includes dirs
my $include = &SearchDirs($self, $file);
unless(defined $include) {
$self->Error("include file with name $file does not exist");
return;
}
# trap the includes here, at 100 levels like perl debugger
if(defined($args) || $self->{compile_includes}) {
# because the script is literally different whether there
# are includes or not, whether we are compiling includes
# need to be part of the script identifier, so the global
# caching does not return a script with different preferences.
$args ||= '';
$self->{dbg} && $self->Debug("runtime exec of dynamic include $file args (".
($args).')');
$data .= "<% \$Response->Include('$include', $args); %>";
# must have all the variabled defined outside the scope
# of the eval in case End() jumps to the goto below, since
# the variables in the local eval{} scope will be cleared
# upon return.
my $global_asa = $self->{GlobalASA};
eval {
$global_asa->{'exists'} && $global_asa->ScriptOnStart;
$self->{errs} || $self->Execute($compiled->{code});
APACHE_ASP_EXECUTE_END:
$self->{errs} || ( $global_asa->{'exists'} && $global_asa->ScriptOnEnd() );
$self->{errs} || $self->{Response}->EndSoft();
};
if($@) {
# its not really a compile time error, but might be useful
sub Execute {
my($self, $code) = @_;
$code || die("no subroutine passed to Execute()");
$self->{dbg} && $self->Debug("executing $code");
# set up globals as early as Application_OnStart, also
# allows variables to be changed in Script_OnStart for running script
&InitPackageGlobals($self);
if(my $ref = ref $code) {
if($ref eq 'CODE') {
You may use a <Files ...> directive in your httpd.conf
Apache configuration file to make Apache::ASP start ticking. Configure the
optional settings if you want, the defaults are fine to get started.
The settings are documented below.
Make sure Global is set to where your web applications global.asa is
if you have one!
PerlModule Apache::ASP
<Files ~ (\.asp)>
SetHandler perl-script
=head2 Core
=item Global
Global is the nerve center of an Apache::ASP application, in which
the global.asa may reside defining the web application's
event handlers.
This directory is pushed onto @INC, so you will be able
to "use" and "require" files in this directory, and perl modules
developed for this application may be dropped into this directory,
PerlSetVar Global /tmp
=item GlobalPackage
Perl package namespace that all scripts, includes, & global.asa
events are compiled into. By default, GlobalPackage is some
obscure name that is uniquely generated from the file path of
the Global directory, and global.asa file. The use of explicitly
naming the GlobalPackage is to allow scripts access to globals
and subs defined in a perl module that is included with commands like:
in perl script: use Some::Package;
in apache conf: PerlModule Some::Package
default 0. Set to 1 to compile each script into its own perl package,
so that subroutines defined in one script will not collide with another.
By default, ASP scripts in a web application are compiled into the
*same* perl package, so these scripts, their includes, and the
global.asa events all share common globals & subroutines defined by each other.
The problem for some developers was that they would at times define a
subroutine of the same name in 2+ scripts, and one subroutine definition would
redefine the other one because of the namespace collision.
PerlSetVar UniquePackages 0
Using IncludesDir in this way creates an includes search
path that would look like ., Global, ../shared, /usr/local/asp/shared
The current directory of the executing script is checked first
whenever an include is specified, then the Global directory
in which the global.asa resides, and finally the IncludesDir
setting.
=item NoCache
Default 0, if set to 1 will make it so that neither script nor
=item StateManager
default 10, this number specifies the numbers of times per SessionTimeout
that timed out sessions are garbage collected. The bigger the number,
the slower your system, but the more precise Session_OnEnd's will be
run from global.asa, which occur when a timed out session is cleaned up,
and the better able to withstand Session guessing hacking attempts.
The lower the number, the faster a normal system will run.
The defaults of 20 minutes for SessionTimeout and 10 times for
StateManager, has dead Sessions being cleaned up every 2 minutes.
; domain=$CookieDomain
part to the Set-Cookie: header set for the session-id cookie.
PerlSetVar CookieDomain .your.global.domain
=item SessionTimeout
Default 20 minutes, when a user's session has been inactive for this
period of time, the Session_OnEnd event is run, if defined, for
=head2 Developer Environment
=item UseStrict
default 0, if set to 1, will compile all scripts, global.asa
and includes with "use strict;" inserted at the head of
the file, saving you from the painful process of strictifying
code that was not strict to begin with.
Because of how essential "use strict" programming is in
PerlSetVar StatINCMatch .*
=item StatScripts
default 1, if set to 0, changed scripts, global.asa, and includes
will not be reloaded. Coupled with Apache mod_perl startup and restart
handlers executing Apache::ASP->Loader() for your application
this allows your application to be frozen, and only reloaded on the
next server restart or stop/start.
There are a few advantages for not reloading scripts and modules
in production. First there is a slight performance improvement
by not having to stat() the script, its includes and the global.asa
every request.
From an application deployment standpoint, you
also gain the ability to deploy your application as a
snapshot taken when the server starts and restarts.
=head2 Overview
The ASP platform allows developers to create Web Applications.
In fulfillment of real software requirements, ASP allows
event-triggered actions to be taken, which are defined in
a global.asa file. The global.asa file resides in the
Global directory, defined as a config option, and may
define the following actions:
Action Event
------ ------
Session_OnEnd End of user Session.
* These are API extensions that are not portable, but were
added because they are incredibly useful
These actions must be defined in the $Global/global.asa file
as subroutines, for example:
sub Session_OnStart {
$Application->{$Session->SessionID()} = started;
}
the Application_OnEnd event may never occur.
=head2 Script_OnStart & Script_OnEnd
The script events are used to run any code for all scripts
in an application defined by a global.asa. Often, you would
like to run the same code for every script, which you would
otherwise have to add by hand, or add with a file include,
but with these events, just add your code to the global.asa,
and it will be run.
There is one caveat. Code in Script_OnEnd is not guaranteed
to be run when $Response->End() is called, since the program
execution ends immediately at this event. To always run critical
=head2 Script_OnFlush
API extension. This event will be called prior to flushing
the $Response buffer to the web client. At this time,
the $Response->{BinaryRef} buffer reference may be used to modify
the buffered output at runtime to apply global changes to scripts
output without having to modify all the scripts.
sub Script_OnFlush {
my $ref = $Response->{BinaryRef};
$$ref =~ s/\s+/ /sg; # to strip extra white space
}
Check out the ./site/eg/global.asa for an example of its use.
=head2 Script_OnParse
This event allows one to set up a source filter on the script text,
allowing one to change the script on the fly before the compilation
For straight Apache::ASP programming, there are some
equivalents, say Script_OnStart event instead of Init/Fixup
stages, or $Server->RegisterCleanup() for Log/Cleanup stages,
but you can do things in the mod_perl handlers that you
cannot do in Apache::ASP, especially if you want to handle
all files globally, and not just ASP scripts.
For many Apache::* modules for use with mod_perl, of which
Apache::ASP is just one, check out
http://perl.apache.org/src/apache-modlist.html
The beauty of the ASP Object Model is that it takes the
burden of CGI and Session Management off the developer,
and puts them in objects accessible from any
ASP script & include. For the perl programmer, treat these objects
as globals accessible from anywhere in your ASP application.
The Apache::ASP object model supports the following:
Object Function
------ --------
$Server - general methods
These objects, and their methods are further defined in the
following sections.
If you would like to define your own global objects for use
in your scripts and includes, you can initialize them in
the global.asa Script_OnStart like:
use vars qw( $Form $Site ); # declare globals
sub Script_OnStart {
$Site = My::Site->new; # init $Site object
$Form = $Request->Form; # alias form data
$Server->RegisterCleanup(sub { # garbage collection
$Site->DESTROY;
=item $Response->{BinaryRef}
API extension. This is a perl reference to the buffered output of
the $Response object, and can be used in the Script_OnFlush
global.asa event to modify the buffered output at runtime
to apply global changes to scripts output without having to
modify all the scripts. These changes take place before
content is flushed to the client web browser.
sub Script_OnFlush {
my $ref = $Response->{BinaryRef};
$$ref =~ s/\s+/ /sg; # to strip extra white space
}
Check out the ./site/eg/global.asa for an example of its use.
=item $Response->{Buffer}
Default 1, when TRUE sends output from script to client only at
the end of processing the script. When 0, response is not buffered,
$Response->Flush() is called. If BufferingOn is
set, by default $Response->Flush() will only be
called at the end of the HTML output.
As of version 2.23 this value is updated correctly
before global.asa Script_OnStart is called, so
global script termination may be correctly handled
during that event, which one might want to do
with excessive user STOP/RELOADS when the web
server is very busy.
An API extension $Response->IsClientConnected
Returns the value of the input of name $name used in a form
with POST method. If $name is not specified, returns a ref to
a hash of all the form data. One can use this hash to
create a nice alias to the form data like:
# in global.asa
use vars qw( $Form );
sub Script_OnStart {
$Form = $Request->Form;
}
# then in ASP scripts
object is created with combined contents of $Request->QueryString
and $Request->Form. This is for developer convenience simlar
to CGI.pm's param() method. Just like for $Response->Form,
one could create a nice alias like:
# in global.asa
use vars qw( $Params );
sub Script_OnStart {
$Params = $Request->Params;
}
creating a session manager, for example, you could create
some other id to reference the SessionID internally, which
would allow you to control the sessions. This kind of application
would best be served under a secure web server.
The ./site/eg/global_asa_demo.asp script makes use of this routine
to display all the data in current user sessions.
=item $Application->SessionCount()
This NON-PORTABLE method returns the current number of active sessions
recompiled.
Includes go a great length to promote good decomposition
and code sharing in ASP scripts, but they are still
fairly static. As of version .09, includes may have dynamic
runtime execution, as subroutines compiled into the global.asa
namespace. The first way to invoke includes dynamically is
<!--#include file=filename.inc args=@args-->
If @args is specified, Apache::ASP knows to execute the
best practices on Apache::ASP development if you will.
=head2 UseStrict
One of perl's blessings is also its bane, variables do not need to be
declared, and are by default globally scoped. The problem with this in
mod_perl is that global variables persist from one request to another
even if a different web browser is viewing a page.
To avoid this problem, perl programmers have often been advised to
add to the top of their perl scripts:
In Apache::ASP, you can do this better by setting:
PerlSetVar UseStrict 1
which will cover both script & global.asa compilation and will catch
"use strict" errors correctly. For perl modules, please continue to
add "use strict" to the top of them.
Because its so essential in catching hard to find errors, this
configuration will likely become the default in some future release.
please read up on them & "Nested Subroutines" at:
http://perl.apache.org/docs/general/perl_reference/perl_reference.html
Instead of defining subroutines in scripts, you may add them to your sites
global.asa, or you may create a perl package or module to share
with your scripts. For more on perl objects & modules, please see:
http://perldoc.perl.org/perlobj.html
=head2 Use global.asa's Script_On* Events
Chances are that you will find yourself doing the same thing repeatedly
in each of your web application's scripts. You can use Script_OnStart
and Script_OnEnd to automate these routine tasks. These events are
called before and after each script request.
For example, let's say you have a header & footer you would like to
include in the output of every page, then you might:
# global.asa
sub Script_OnStart {
$Response->Include('header.inc');
}
sub Script_OnEnd {
$Response->Include('footer.inc');
}
Or let's say you want to initialize a global database connection
for use in your scripts:
# global.asa
use Apache::DBI; # automatic persistent database connections
use DBI;
use vars qw($dbh); # declare global $dbh
sub Script_OnStart {
# initialize $dbh
$dbh = DBI->connect(...);
keywords: segmentation fault, segfault seg fault
=item Why do variables retain their values between requests?
Unless scoped by my() or local(), perl variables in mod_perl
are treated as globals, and values set may persist from one
request to another. This can be seen in as simple a script
as this:
<HTML><BODY>
$counter++;
$Response->Write("<BR>Counter: $counter");
</BODY></HTML>
The value for $counter++ will remain between requests.
Generally use of globals in this way is a BAD IDEA,
and you can spare yourself many headaches if do
"use strict" perl programming which forces you to
explicity declare globals like:
use vars qw($counter);
You can make all your Apache::ASP scripts strict by
default by setting:
$main::Response->Write("html output");
This notation can be used from anywhere in perl, including routines
registered with $Server->RegisterCleanup().
You use the normal notation in your scripts, includes, and global.asa:
$Response->Write("html output");
=item Can I print() in ASP?
On Win32 systems, where mod_perl requests are serialized, you
can freely use SessionSerialize to make your $Session requests
faster, and you can achieve similar performance benefits for
$Application if you call $Application->Lock() in your
global.asa's Script_OnStart.
=head2 Low MaxClients
Set your MaxClients low, such that if you have that
many httpd servers running, which will happen on busy site,
is that these script will have a performance penalty having to be
recompiled each invocation, but this will kill many closure caching
bugs that are hard to detect.
- $Request->FileUpload('upload_file', 'BrowserFile') would return
a glob before that would be the file name in scalar form. However
this would be interpreted as a reference incorrectly. The fix
is to make sure this is always a scalar by stringifying
this data internally. Thanks to Richard Curtis for pointing
out this bug.
+ Added automatic load of "use Apache2" for compat with mod_perl2
request objects when Apache::ASP is loaded via "PerlModule Apache::ASP"
Thanks to Richard Curtis for reporting bug & subsequent testing.
- When GlobalPackage config changes, but global.asa has not, global.asa
will be recompiled anyway to update the GlobalPackage correctly.
Changing GlobalPackage before would cause errors if global.asa was
already compiled.
++ For ANY PerlSetVar type config, OFF/Off/off will be assumed
to have value of 0 for that setting. Before, only a couple settings
had this semantics, but they all do now for consistency.
- Default path for $Response->{Cookies} was from CookiePath
config, but this was incorrect as CookiePath config is only
for $Session cookie, so now path for $Response->{Cookies}
defaults to /
- Fixed bug where global.asa events would get undefined with
StatINC and GlobalPackage set when the GlobalPackage library
changed & get reloaded.
(d) Documented long time config NoCache.
added t/cgi_headers.t to cover this config.
+ removed $Apache::ASP::CompressGzip setting ability, used to possibly
set CompressGzip in the module before, not documented anyway
+ removed $Apache::ASP::Filter setting ability to set Filter globally,
not documented anyway
+ removed old work around for setting ServerStarting to 0
at runtime, which was bad for Apache::DBI on win32 a long
time ago:
by XSLT would both be compiled as normal ASP script first, so
now this will happen if they really are ASP scripts with embedded
<% %> code blocks & XMLSubs being executed.
+Consolidate some config data for Apache::ASP->Loader to use
globals in @Apache::ASP::CompileChecksumKeys to know which
config data is important for precompiling ASP scripts.
+Further streamlined code compilation. Now both base
scripts and includes use the internal CompileInclude() API
to generate code.
-Fixed runtime HTML error output when Debug is set to -2/2,
so that script correctly again gets rendered in final perl form.
Added compile time error output to ./site/eg/syntax_error.asp
when a special link is clicked for a quick visual test.
-Cleaned up some bad coding practices in ./site/eg/global.asa
associated changes in other example files. Comment example
global.asa some for the first time reader
-DemoASP.pm examples module needed "use strict" fix, thanks
to Allan Vest for bug report
--$rv = $Response->Include({ File => ..., Cache => 1});
+removed cgi/asp link to ../asp-perl from distribution. This
link was for the deprecated asp script which is now asp-perl
=item $VERSION = 2.39; $DATE="09/10/2002"
-Turn off $^W explicitly before reloading global.asa. Reloading
global.asa when $^W is set will trigger subroutine redefinition
warnings. Reloading global.asa should occur without any problems
under normal usage of the system, thus this work around.
This fix is important to UseStrict functionality because warnings
automatically become thrown as die() errors with UseStrict enabled,
so we have to disable normal soft warnings here.
-$Response->Include() runtime errors now throw a die() that
can be trapped. This was old functionality that has been restored.
Other compile time errors should still trigger a hard error
like script compilation, global.asa, or $Response->Include()
without an eval()
+Some better error handling with Debug 3 or -3 set, cleaned
up developer errors messages somewhat.
CC & BCC headers/recipients.
+ Removed $Apache::ASP::Register definition which defined the current
executing Apache::ASP object. Only one part of the application was
using it, and this has been fixed. This would have been an unsafe
use of globals for a threaded environment.
+ Decreased latency when doing Application_OnStart, used to sleep(1)
for CleanupMaster sync, but this is not necessary for Application_OnStart
scenario
- Script_OnEnd guaranteed to run after $Response->End, but
it will not run if there was an error earlier in the request.
+ lots of new test cases covering behaviour of $Response->End
and $Response->Redirect under various conditions like XMLSubs
and SoftRedirect and global.asa Script_OnStart
+ asp-perl will be installed into the bin executables when
Apache::ASP is installed. asp-perl is the command line version
of Apache::ASP that can also be used to run script in CGI mode.
Test case covering asp-perl functionality.
loaded at runtime via $Response->Include(). Added test case for
this at t/include_change.t. If an inline include of a dynamic include
changes, the dynamic include should get recompiled now.
-Make OK to use again with PerlTaintCheck On, with MLDBM::Sync 2.25.
Fixed in ASP.pm, t/global.asa, and created new t/taint_check.t test script
+Load more modules when Apache::ASP is loaded so parent will share more
with children httpd:
Apache::Symbol
Devel::Symdump
=item $VERSION = 2.25; $DATE="10/11/2001";
+ Improved ./site/apps/search application, for better
search results at Apache::ASP site. Also, reengineered
application better, with more perl code moved to global.asa.
Make use of MLDBM::Sync::SDBM_File, where search database
before was engineering around SDBM_File's shortcomings.
- Fix for SessionSerialize config, which broke in 2.23
Also, added t/session_serialize.t to test suite to catch
-XMLSubs args parsing fix so an arg like z-index
does not error under UseStrict. This is OK now:
<my:layer z-index=3 top=0 left=0> HTML </my:layer>
-Only remove outermost <SCRIPT> tags from global.asa
for IIS/PerlScript compatibility. Used to remove
all <SCRIPT> tags, which hurt when some subs in globa.asa
would be printing some JavaScript.
+$Response->{IsClientConnected} now updated correctly
before global.asa Script_OnStart. $Response->IsClientConnect()
can be used for accurate accounting, while
$Response->{IsClientConnected} only gets updated
after $Response->Flush(). Added test cases to response.t
+$Server->HTMLEncode(\$data) API extension, now can take
In the above example, $Session would be the same $Session
object created later while running the ASP script for this
same request.
Added t/asp_object.t test for this. Fixed global.asa to only
init StateDir when application.asp starts which is the first
test script to run.
-Fixed on Win32 to make Apache::ASP->new($r) able to create
multiple master ASP objects per request. Was not reentrant
+Documented new XSLT caching directives.
+Updated ./site/eg/.htaccess XSLT example config
to use XSLTCache setting.
+New FAQ section on why perl variables are sticky globals,
suggested by Mark Seger.
-push Global directory onto @INC during ASP script execution
Protect contents of original @INC with local. This makes
things compatible with .09 Apache::ASP where we always had
+Added ASP perl mmm-mode subclass and configuration
in editors/mmm-asp-perl.el file for better emacs support.
Updated SYNTAX/Editors documentation.
+Better debugging error message for Debug 2 or 3 settings
for global.asa errors. Limit debug output for lines
preceding rendered script.
-In old inline include mode, there should no longer
be the error "need id for includes" when using
$Response->Include() ... if DynamicIncludes were
=item $VERSION = 2.11; $DATE="05/29/2001";
+Parser optimization from Dariusz Pietrzak
-work around for global destruction error message for perl 5.6
during install
+$Response->{IsClientConnected} now will be set
correctly with ! $r->connection->aborted after each
$Response->Flush()
try creating the same state directory at the same time, with
one winning, and one generating an error. Now, web process
will recheck for directory existence and error if
it doesn't.
-global.asa compilation will be cached correctly, not
sure when this broke. It was getting reloaded every request.
-StateAllWrite config, when set creates state files
with a+rw or 0666 permissions, and state directories
with a+rwx or 0777 permissions. This allows web servers
but keeps the current ASP objects for the next script.
Added examples, transfer.htm, and modified dynamic_includes.htm.
+Better compile time error debugging with Debug 2 or -2.
Will hilite/link the buggy line for global.asa errors,
include errors, and XML/XSLT errors just like with
ASP scripts before.
+Nice source hiliting when viewing source for the example
scripts.
be returned if the presented one is invalid or expired.
-$Application->GetSession will only return a session if
one already existed. It would create one before by default.
+Script_OnFlush global.asa event handler, and $Response->{BinaryRef}
member which is a scalar reference to the content about to be flushed.
See ./site/eg/global.asa for example usage, used in this case to
insert font tags on the fly into the output.
+Highlighting and linking of line error when Debug is set to 2 or -2.
--removed fork() call from flock() backup routine? How did
in a new SESSIONS section. Also documented new
FileUpload configs and $Request->FileUpload collection.
Documented StatScripts.
+StatScripts setting which if set to 0 will not reload
includes, global.asa, or scripts when changed.
+FileUpload file handles cleanup at garbage collection
time so developer does not have to worry about lazy coding
and undeffing filehandles used in code. Also set
uploaded filehandles to binmode automatically on Win32
-If buffering, Content-Length will again be set.
It broke, probably while I was tuning in the past
couple versions.
+UseStrict setting compiles all scripts including
global.asa with "use strict" turned on for catching
more coding errors. With this setting enabled,
use strict errors die during compilation forcing
Apache::ASP to try to recompile the script until
successful.
is used with state objects like $Session or $Application,
MLDBM must also be made taint friendly with:
$MLDBM::RemoveTaint = 1;
which could be put in the global.asa. Documented.
+Added $Response->ErrorDocument($error_code, $uri_or_string)
API extension which allows for setting of Apache's error
document at runtime. This is really just a wrapper
for Apache->custom_response() renamed so it syncs with
because it was not going to be used. It bound
$Request->* collections/hashes to Tie::IxHash, so that data
in those collections would be read in the order the
browser sent it, when eaching through or with keys.
-global.asa will be reloaded when changed. This broke
when I optimized the modification times with (stat($file))[9]
rather than "use File::stat; stat($file)->mtime"
-Make Apache::ASP->Loader() PerlRestartHandler safe,
had some unstrict code that was doing the wrong thing.
section in the ASP docs.
-Added UniquePackages config option, that if set brings back
the old method of compiling each ASP script into its own
separate package. As of v.10, scripts are compiled by default
into the same package, so that scripts, dynamic includes & global.asa
can share globals. This BROKE scripts in the same ASP Application
that defined the same sub routines, as their subs would redefine
each other.
UniquePackages has scripts compiled into separate perl packages,
so they may define subs with the same name, w/o fear of overlap.
Under this settings, scripts will not be able to share globals.
-Secure field for cookies in $Response->Cookies() must be TRUE to
force cookie to be secure. Before, it just had to be defined,
which gave wrong behavior for Secure => 0.
haven't $Response->Flush()'d. This broke when I introduce
the Script_OnEnd event handler.
+Optimized reloading of the GlobalPackage perl module upon changes,
so that scripts and dynamic includes don't have to be recompiled.
The global.asa will still have to be though. Since we started
compiling all routines into a package that can be named with
GlobalPackage, we've been undeffing compiled scripts and includes
when the real GlobalPackage changed on disk, as we do a full sweep
through the namespace. Now, we skip those subs that we know to
be includes or scripts.
wantarray() context like @vals = $Request->QueryString('dupkey'),
@vals will store whatever values where associated with dupkey
in the query string like (1,2) from: ?dupkey=1&dupkey=2
+The GlobalPackage config directive may be defined
to explicitly set the perl module that all scripts and global.asa
are compiled into.
-Dynamic includes may be in the Global directory, just like
normal includes.
-Script_OnEnd may now send output to the browser. Before
$main::Response->End() was being called at the end of the
main script preventing further output.
++All scripts are compiled as routines in a namespace uniquely
defined by the global.asa of the ASP application. Thus,
scripts, includes, and global.asa routines will share
all globals defined in the global.asa namespace. This means
that globals between scripts will be shared, and globals
defined in a global.asa will be available to scripts.
Scripts used to have their own namespace, thus globals
were not shared between them.
+a -o $output_dir switch on the ./cgi/asp script allows
it to execute scripts and write their output to an output
directory. Useful for building static html sites, based on
+Naming of CompileIncludes switched over to DynamicIncludes
for greater clarity.
+Dynamic includes can now reference ASP objects like $Session
w/o the $main::* syntax. These subs are no longer anonymous
subs, and are now compiled into the namespace of the global.asa package.
+Apache::ASP->Loader() precompiles dynamic includes too. Making this work
required fixing some subtle bugs / dependencies in the compiling process.
+Added Apache::ASP->Loader() similar to Apache::RegistryLoader for
-$Request->Form() now reads file uploads correctly with
the latest CGI.pm, where $Request->Form('file_field') returns
the actual file name uploaded, which can be used as a file handle
to read in the data. Before, $Request->Form('file_field') would
return a glob that looks like *Fh::filename, so to get the file
name, you would have to parse it like =~ s/^\*Fh\:\://,
which you no longer have to do. As long as parsing was done as
mentioned, the change should be backwards compatible.
+Updated +enhanced documentation on file uploads. Created extra
-Multiple cookies may be set per script execution.
+file upload implemented via CGI.pm
++global.asa implemented with events Session_OnStart and Session_OnEnd
working appropriately.
+StateDir configuration directive implemented.
StateDir allows the session state directory to be specified separately
from the Global directory, useful for operating systems with caching file
view all matches for this distribution
view release on metacpan or search on metacpan
{
push @{ $PATH_TO_HEADERS{ $p } }, $h->{'id'}[0] ;
}
}
# create a global array of paths/regexes for efficiency
# ( so this doesn't have to be done each time through the handler )
@PATH_REGEXES = sort keys %PATH_TO_HEADERS ;
# set header prefix if needed
if ( $ref->{'header_authz'}[0]{'headers'}[0]{'prefix'} )
view all matches for this distribution
view release on metacpan or search on metacpan
t/httpd.conf-dist view on Meta::CPAN
# unless you have overridden these with ResourceConfig and/or
# AccessConfig directives here.
#
# The configuration directives are grouped into three basic sections:
# 1. Directives that control the operation of the Apache server process as a
# whole (the 'global environment').
# 2. Directives that define the parameters of the 'main' or 'default' server,
# which responds to requests that aren't handled by a virtual host.
# These directives also provide default values for the settings
# of all virtual hosts.
# 3. Settings for virtual hosts, which allow Web requests to be sent to
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/AppSamurai.pm view on Meta::CPAN
B<IMPORTANT NOTE> - The I<AuthName> is omitted in the configuration
descriptions below for brevity. "Example" is used as the I<AuthName> in the
L</EXAMPLES> section.
Most setups will include a set of global configuration values to setup the
Apache::AppSamurai instance. Each protected area then points to a specific
AuthName and Apache::AppSamurai methods for authentication and
authorization.
=head2 GENERAL CONFIGURATION
lib/Apache/AppSamurai.pm view on Meta::CPAN
# RELEVANT VirtualHost SECTIONS (For most Apache2 setups, this would be
# the "<VirtualHost _default_:443>" section inside ssl.conf)
#
## Enable rewrite engine inside virtualhost
#RewriteEngine on
## Inherit rewrite settings from parent (global)
#RewriteOptions inherit
## Enable proxy connections to SSL
#SSLProxyEngine on
view all matches for this distribution
view release on metacpan or search on metacpan
Apache::Auth::UserDB:
+ Added support for overwriting user DB files in-place as opposed to writing
a new file and renaming it over the old one. This way file ownership and
permissions can be preserved.
* Turned global constants into object methods, thereby improving mod_perl
compatibility.
* Use version module.
* Sign distribution with the proper PGP key (closes: rt.cpan.org #16851).
Debian:
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
if (
defined( my $cur = _version_check( _load($mod), $arg ||= 0 ) ) )
{
print "loaded. ($cur" . ( $arg ? " >= $arg" : '' ) . ")\n";
push @Existing, $mod => $arg;
$DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
}
else {
print "missing." . ( $arg ? " (would need $arg)" : '' ) . "\n";
push @required, $mod => $arg;
}
inc/Module/AutoInstall.pm view on Meta::CPAN
) =~ /^[Yy]/
)
)
{
push( @Missing, @required );
$DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
}
elsif ( !$SkipInstall
and $default
and $mandatory
and
_prompt( qq{==> The module(s) are mandatory! Really skip?}, 'n', )
=~ /^[Nn]/ )
{
push( @Missing, @required );
$DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
}
else {
$DisabledTests{$_} = 1 for map { glob($_) } @tests;
}
}
$UnderCPAN = _check_lock(); # check for $UnderCPAN
inc/Module/AutoInstall.pm view on Meta::CPAN
}
$args{test}{TESTS} ||= 't/*.t';
$args{test}{TESTS} = join( ' ',
grep { !exists( $DisabledTests{$_} ) }
map { glob($_) } split( /\s+/, $args{test}{TESTS} ) );
my $missing = join( ',', @Missing );
my $config =
join( ',', UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} )
if $Config;
view all matches for this distribution
view release on metacpan or search on metacpan
generic_reg_auth_scheme.txt view on Meta::CPAN
Jacob> This could be accomplished by making a little script to install
the necessary CGI scripts and stuff.
Configuration features:
In global section of virtualhost:
PerlModule Apache::AuthCookieDBI
PerlSetVar AuthNamePath /
# this login script must use another cookie to set the destination
# and we probably need to hack authcookie to look at the cookie
view all matches for this distribution
view release on metacpan or search on metacpan
generic_reg_auth_scheme.txt view on Meta::CPAN
Jacob> This could be accomplished by making a little script to install
the necessary CGI scripts and stuff.
Configuration features:
In global section of virtualhost:
PerlModule Apache::AuthCookieDBI
PerlSetVar AuthNamePath /
# this login script must use another cookie to set the destination
# and we probably need to hack authcookie to look at the cookie
view all matches for this distribution
view release on metacpan or search on metacpan
0.07 Sat Sep 3 2004
- Applied patch from Steve Keay for 'POST' data
0.06 Mon Nov 11 10:11 2003
- Changed the way this module should be inherited (see docs)
as I'd forgotten about the global, much cleaner now.
- Found bug in the way I'd suggested to inherit - it didn't
work!
0.05 Mon Nov 10 11:39 2003
- REMOTE_USER is now set if 'username' and 'domainname' are
view all matches for this distribution
view release on metacpan or search on metacpan
AuthCookieURL.pm view on Meta::CPAN
PerlSetVar WhateverExpires +90d
"Whatever" is whatever the current AuthName is set. I think I might remove this
and instead just use the settings as Apache dir_merge returns them. In other words,
if you want a setting to override a global setting, then use it within a E<lt>directoryE<gt>,
E<lt>fileE<gt>, or E<lt>locationE<gt> section.
=over 4
=item * AuthCookieURLDebug
view all matches for this distribution
view release on metacpan or search on metacpan
contrib/AuthDigestDBI.pm view on Meta::CPAN
# stores the configuration of current URL.
# initialized during authentication, eventually re-used for authorization.
my $Attr = { };
# global cache: all records are put into one string.
# record separator is a newline. Field separator is $;.
# every record is a list of id, time of last access, password, groups (authorization only).
# the id is a comma separated list of user_id, data_source, pwd_table, uid_field.
# the first record is a timestamp, which indicates the last run of the CleanupHandler followed by the child counter.
contrib/AuthDigestDBI.pm view on Meta::CPAN
# sanity check
$CleanupTime = $cleanup_time if ($cleanup_time =~ /\-*\d+/);
}
# optionally the string with the global cache can be stored in a shared memory segment.
# the segment will be created from the first child and it will be destroyed if the last child exits.
# the reason for not handling everything in the main server is simply, that there is no way to setup
# an ExitHandler which runs in the main server and which would remove the shared memory and the semaphore.
# hence we have to keep track about the number of children, so that the last one can do all the cleanup.
# creating the shared memory in the first child also has the advantage, that we don't have to cope
# with changing the ownership.
# if a shm-function fails, the global cache will automatically fall back to one string per process.
my $SHMKEY = 0; # unique key for shared memory segment and semaphore set
my $SEMID = 0; # id of semaphore set
my $SHMID = 0; # id of shared memory segment
my $SHMSIZE = 50000; # default size of shared memory segment
contrib/AuthDigestDBI.pm view on Meta::CPAN
# get username
my ($user_sent) = $r->connection->user;
print STDERR "$prefix user sent = >$user_sent<\n" if $Apache::AuthDigestDBI::DEBUG > 1;
# do we use shared memory for the global cache ?
print STDERR "$prefix cache in shared memory, shmid $SHMID, shmsize $SHMSIZE, semid $SEMID \n" if ($SHMID and $Apache::AuthDigestDBI::DEBUG > 1);
# get configuration
while(($key, $val) = each %Config) {
$val = $r->dir_config($key) || $val;
view all matches for this distribution
view release on metacpan or search on metacpan
our $VERSION = '0.01';
our $MODNAME = 'Apache::AuthPAM';
#
# I use this global to pass user info to the conversation function
# if you know a better way to do it, please tell me and/or fix it.
#
our %pw;
# Preloaded methods go here.
unless($service) {
$log->alert("$MODNAME: no PAM service name supplied", $r->uri);
return SERVER_ERROR;
}
# DAMN! I shouldn't use globals this way!
$pw{$$}=$pw;
# start PAM dialog
my $pamh;
my $result = pam_start($service, $username, \&my_conv_func, $pamh);
If you are going to use your system password database, you
B<MUST> also use B<mod_ssl>.
=head1 BUGS
I'am using a global symbol.
Apache::AuthPAM is running as the same user mod_perl is running
(on RedHat Linux it is apache). It is running without privileges.
=head1 AUTHOR
view all matches for this distribution
view release on metacpan or search on metacpan
inc/ExtUtils/AutoInstall.pm view on Meta::CPAN
# XXX: check for conflicts and uninstalls(!) them.
if (defined(my $cur = _version_check(_load($mod), $arg ||= 0))) {
print "loaded. ($cur".($arg ? " >= $arg" : '').")\n";
push @Existing, $mod => $arg;
$DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
}
else {
print "missing." . ($arg ? " (would need $arg)" : '') . "\n";
push @required, $mod => $arg;
}
inc/ExtUtils/AutoInstall.pm view on Meta::CPAN
qq{==> Auto-install the }. (@required / 2).
($mandatory ? ' mandatory' : ' optional').
qq{ module(s) from CPAN?}, $default ? 'y' : 'n',
) =~ /^[Yy]/)) {
push (@Missing, @required);
$DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
}
elsif (!$SkipInstall and $default and $mandatory and _prompt(
qq{==> The module(s) are mandatory! Really skip?}, 'n',
) =~ /^[Nn]/) {
push (@Missing, @required);
$DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
}
else {
$DisabledTests{$_} = 1 for map { glob($_) } @tests;
}
}
_check_lock(); # check for $UnderCPAN
inc/ExtUtils/AutoInstall.pm view on Meta::CPAN
}
$args{test}{TESTS} ||= 't/*.t';
$args{test}{TESTS} = join(' ', grep {
!exists($DisabledTests{$_})
} map { glob($_) } split(/\s+/, $args{test}{TESTS}));
my $missing = join(',', @Missing);
my $config = join(',',
UNIVERSAL::isa($Config, 'HASH') ? %{$Config} : @{$Config}
) if $Config;
view all matches for this distribution
view release on metacpan or search on metacpan
smb/smbval/.svn/text-base/smblib-priv.h.svn-base view on Meta::CPAN
UWORD access;
off_t fileloc;
};
/* global Variables for the library */
extern SMB_State_Types SMBlib_State;
#ifndef SMBLIB_ERRNO
extern int SMBlib_errno;
view all matches for this distribution
view release on metacpan or search on metacpan
AuthzNetLDAP.pm view on Meta::CPAN
#will determine if an entry in LDAP server is a member of a givengroup
#will handle groupofmembers, groupofuniquemembers, or Netscape's dynamic group
#eventually will handle LDAP url to add support for LDAP servers that don't support
#dynamic groups
#in future we should store user's DN in global cache to reduce searches on LDAP server
#also share LDAP connection
#proccesses a require directive
sub handler
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
if (
defined( my $cur = _version_check( _load($mod), $arg ||= 0 ) ) )
{
print "loaded. ($cur" . ( $arg ? " >= $arg" : '' ) . ")\n";
push @Existing, $mod => $arg;
$DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
}
else {
print "missing." . ( $arg ? " (would need $arg)" : '' ) . "\n";
push @required, $mod => $arg;
}
inc/Module/AutoInstall.pm view on Meta::CPAN
) =~ /^[Yy]/
)
)
{
push( @Missing, @required );
$DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
}
elsif ( !$SkipInstall
and $default
and $mandatory
and
_prompt( qq{==> The module(s) are mandatory! Really skip?}, 'n', )
=~ /^[Nn]/ )
{
push( @Missing, @required );
$DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
}
else {
$DisabledTests{$_} = 1 for map { glob($_) } @tests;
}
}
$UnderCPAN = _check_lock(); # check for $UnderCPAN
inc/Module/AutoInstall.pm view on Meta::CPAN
}
$args{test}{TESTS} ||= 't/*.t';
$args{test}{TESTS} = join( ' ',
grep { !exists( $DisabledTests{$_} ) }
map { glob($_) } split( /\s+/, $args{test}{TESTS} ) );
my $missing = join( ',', @Missing );
my $config =
join( ',', UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} )
if $Config;
view all matches for this distribution
view release on metacpan or search on metacpan
clean-sessions.pl view on Meta::CPAN
# config options from httpd.conf
my $sessiondir = '/www/sessions'; # session directory
my $locksdir = '/www/sessions/locks'; # locks directory
my $expire = '30'; # timeout period
my $globals = 'Tie::SymlinkTree,/tmp/globals'; # global file name
# safety measure
die "Run this script in your session dir!" if ! -f $globals;
# Get global data
my @tie = split(/,/,$globals);
eval "require $tie[0];";
tie my %global, @tie;
chdir($sessiondir);
foreach (glob("*")) {
next unless -f $_;
my $sessionfile = $_;
# Get session data
tie my %session, 'Apache::Session::File', $sessionfile, {
Directory => $sessiondir,
LockDirectory => $locksdir,
};
# remove expired session files and update globals
if (int(time()/300) > $session{'auth_last_access'}+$expire) {
delete($global{'auth_online_users'}{$session{'auth_access_user'}});
unlink($sessionfile);
unlink($locksdir.'/Apache-Session-'.$sessionfile.'.lock');
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
dtds/office.mod view on Meta::CPAN
<!ATTLIST office:document xmlns:xlink CDATA #FIXED "&nXLink;">
<!ATTLIST office:document xmlns:svg CDATA #FIXED "&nSVG;">
<!ATTLIST office:document xmlns:dc CDATA #FIXED "&nDC;">
<!ATTLIST office:document office:class
(text|text-global|
drawing|presentation|
spreadsheet|chart) #REQUIRED>
<!ATTLIST office:document office:version %string; #IMPLIED>
dtds/office.mod view on Meta::CPAN
<!ATTLIST office:document-content xmlns:xlink CDATA #FIXED "&nXLink;">
<!ATTLIST office:document-content xmlns:svg CDATA #FIXED "&nSVG;">
<!ATTLIST office:document-content xmlns:dc CDATA #FIXED "&nDC;">
<!ATTLIST office:document-content office:class
(text|text-global|
drawing|presentation|
spreadsheet|chart) #REQUIRED>
<!ATTLIST office:document-content office:version %string; #IMPLIED>
view all matches for this distribution
view release on metacpan or search on metacpan
configuration/dbconf/globalconf.pl view on Meta::CPAN
# to see if it has failed a DBI execute. Typically DBI::BabyConnect methods return undef
# whenever a DBI execute fails and therefore the caller can check the return
# value and decide on whether to call the DBI::BabyConnect object method rollback himself or not,
# therefore allowing the caller to continue to work with the instance of DBI::BabyConnect object
# and its open DBI connection.
# Yet, you can configure the behavior of the DBI::BabyConnect object methods globally
# and tell the object methods to automatically rollback and exit on failure.
# This option is settable and will work only if AutoRollback is in effect for the
# DBI, because DBI::BabyConnect objects delegate all rollbacks to the DBI itself.
# DBI rollback is in effect if and only if:
view all matches for this distribution
view release on metacpan or search on metacpan
Backhand.pm view on Meta::CPAN
Apache::Backhand::SERVER_TIMEOUT;
=head1 DESCRIPTION
Apache::Backhand ties mod_perl together with mod_backhand, in two major ways.
First, the Apache::Backhand module itself provides access to the global and
shared state information provided by mod_backhand (most notably serverstats).
Second, the byPerl C function (which is not part of the Apache::Backhand
module, but is distributed together with it) allows you to write candidacy
functions in Perl.
Backhand.pm view on Meta::CPAN
resides. You can call load_serverstats() once, and use the returned structure
as much as you want - it will always reflect the contents of the underlying
shared structure. This has one drawback, however, which is that you cannot
call load_serverstats() until after the shared memory segment has been created
and attached. I recommend a PerlChildInit handler to do load_serverstats()
into a global variable.
=item B<load_personal_arriba>
This function returns a reference to a scalar variable which is magically
tied to the global mod_backhand_personal_arriba integer. This contains the
arriba speed of the local machine.
=back
=head1 CAVEATS
view all matches for this distribution
view release on metacpan or search on metacpan
# need a filename. we start at 1 and move upwards. there's
# almost certainly a race condition here, but this is written
# for my site where i get about one comment a week. if yours is
# so busy you're worried about this breaking, then feel free to
# fix it.
my @existing_files = glob("$comment_dir/*");
my $new_basename = scalar(@existing_files) + 1;
open (COMMENT, ">$comment_dir/$new_basename");
print COMMENT "$name\n";
print COMMENT scalar(localtime)."\n";
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
@exts = $self->{admin}->load_all_extensions;
}
my %seen;
foreach my $obj ( @exts ) {
while (my ($method, $glob) = each %{ref($obj) . '::'}) {
next unless $obj->can($method);
next if $method =~ /^_/;
next if $method eq uc($method);
$seen{$method}++;
}
view all matches for this distribution
view release on metacpan or search on metacpan
Apache Directives
=item * PerlSetVar Bwlog active
This value is required if plan to use the module at all. This can be placed globally
to effect all virtual hosts on the machine, or in a single VirtualHost context which
only activates logging for that host
=item * PerlSetVar Bwlog_threshold <bytes>
view all matches for this distribution
view release on metacpan or search on metacpan
use Apache::Constants ':common';
use CIPP;
use Config;
use File::Path;
# this global hash holds the timestamps of the compiled perl
# subroutines for this instance
%Apache::CIPP::compiled = ();
sub handler {
view all matches for this distribution