Apache-Reload
view release on metacpan or search on metacpan
181920212223242526272829303132333435363738
1;
DESCRIPTION
This module is two things. First it is an adaptation of Randal
Schwartz's Stonehenge::Reload module that attempts to be a
little more intuitive and makes the usage easier.
Stonehenge::Reload was written by Randal to make specific
modules reload themselves
when
they changed. Unlike
Apache::StatINC, Stonehenge::Reload only checked the change
time
of modules that registered themselves
with
Stonehenge::Reload,
thus reducing
stat
() calls. Apache::Reload also offers the exact
same functionality as Apache::StatINC, and is thus designed to
be a drop-in replacement. Apache::Reload only checks modules
that register themselves
with
Apache::Reload
if
you explicitly
turn off the StatINC emulation method (see below). Like
Apache::StatINC, Apache::Reload must be installed as an Init
Handler.
StatINC Replacement
lib/Apache/Reload.pm view on Meta::CPAN
767778798081828384858687888990919293949596my
$r
=
shift
;
my
$DEBUG
=
ref
(
$r
) && (
lc
(
$r
->dir_config(
"ReloadDebug"
) ||
''
) eq
'on'
);
my
$TouchFile
=
ref
(
$r
) &&
$r
->dir_config(
"ReloadTouchFile"
);
my
$TouchModules
;
if
(
$TouchFile
) {
warn
"Checking mtime of $TouchFile\n"
if
$DEBUG
;
my
$touch_mtime
= (
stat
(
$TouchFile
))[9] ||
return
1;
return
1
unless
$touch_mtime
>
$TouchTime
;
$TouchTime
=
$touch_mtime
;
my
$sym
= Apache->gensym;
open
(
$sym
,
$TouchFile
) ||
die
"Can't open '$TouchFile': $!"
;
$TouchModules
= <
$sym
>;
chomp
$TouchModules
;
}
if
(
ref
(
$r
) && (
lc
(
$r
->dir_config(
"ReloadAll"
) ||
'on'
) eq
'on'
)) {
*Apache::Reload::INCS
= \
%INC
;
lib/Apache/Reload.pm view on Meta::CPAN
201202203204205206207208209210211212213214215216217218219220221
1;
=head1 DESCRIPTION
This module is two things. First it is an adaptation of Randal
Schwartz's Stonehenge::Reload module that attempts to be a little
more intuitive and makes the usage easier. Stonehenge::Reload was
written by Randal to make specific modules reload themselves when
they changed. Unlike Apache::StatINC, Stonehenge::Reload only checked
the change time of modules that registered themselves with
Stonehenge::Reload, thus reducing stat() calls. Apache::Reload also
offers the exact same functionality as Apache::StatINC, and is thus
designed to be a drop-in replacement. Apache::Reload only checks modules
that register themselves with Apache::Reload if you explicitly turn off
the StatINC emulation method (see below). Like Apache::StatINC,
Apache::Reload must be installed as an Init Handler.
=head2 StatINC Replacement
To use as a StatINC replacement, simply add the following configuration
to your httpd.conf:
lib/Apache2/Reload.pm view on Meta::CPAN
372373374375376377378379380381382383384385386387388389390391392393394This module is perfectly suited
for
a development environment. Though
environment, since
with
C<Apache2::Reload> you don't have to restart
the server in order to reload changed modules during software
updates. Though this convenience comes at a price:
=over
=item *
If the "touch" file feature is used, C<Apache2::Reload> has to stat(2)
the touch file on each request, which adds a slight but most likely
insignificant overhead to response times. Otherwise C<Apache2::Reload>
will stat(2) each registered module or even worse--all modules in
C<%INC>, which will significantly slow everything down.
=item *
Once the child process reloads the modules, the memory used by these
modules is not shared with the parent process anymore. Therefore the
memory consumption may grow significantly.
=back
( run in 1.504 second using v1.01-cache-2.11-cpan-49f99fa48dc )