NAME
Apache2::Util - Perl API for Misc Apache Utility functions
SSyynnooppssiissuse Apache2::Util ();
# OS escape path
$escapedpath = Apache2::Util::escapepath($path, "a 'long' file.html");
# format time as a string
my $fmt = "%a, %D %H:%M:%S %Z";
$fmtdate = Apache2::Util::httime($r->pool, $r->requesttime, $fmt, 0);
DDeessccrriippttiioonn Various Apache utilities that don't fit into any other group. FFuunnccttiioonnss AAPPII"Apache2::Util" provides the following functions and/or methods:
""eessccaappeeppaatthh"" convert an OS path to a URL in an OS dependant way.$escapedpath = Apache2::Util::escapepath($path, $p);
$escapedpath = Apache2::Util::escapepath($path, $p, $partial);
arg1: $path ( string )
The path to convertarg2: $p ( "APR::Pool" )
The pool to allocate fromopt arg3: $partial ( boolean )
if TRUE, assume that the path will be appended to something with a '/' in it (and thus does not prefix "./")if FALSE it prepends "./" unless $path contains ":" optionally
followed by "/". the default is TRUEret: $escapedpath ( string )
The escaped path since: 2.0.00 ""hhttttiimmee"" Convert time from an integer value into a string in a specified format$timestr = Apache2::Util::httime($p);
$timestr = Apache2::Util::httime($p, $time);
$timestr = Apache2::Util::httime($p, $time, $fmt);
$timestr = Apache2::Util::httime($p, $time, $fmt, $gmt);
arg1: $p ( "APR::Pool object" )
The pool to allocate memory fromopt arg2: $time ( number )
The time to convert (e.g., "time()" or "$r->requesttime").
If the value is not passed the current time will be used.opt arg3: $fmt ( string )
The format to use for the conversion, using strftime(3) tokens. If the value is not passed the default format used is:"%a, %d %b %Y %H:%M:%S %Z"
opt arg4: $gmt ( boolean )
The time will be not converted to GMT if FALSE is passed. If the value is not passed TRUE (do convert) is used as a default.ret: $timestr (string)
The string that represents the specified time since: 2.0.00 Examples: Use current time, the default format and convert to GMT:$fmtdate = Apache2::Util::httime($r->pool);
Use my time, the default format and convert to GMT:my $time = time+100;
$fmtdate = Apache2::Util::httime($r->pool, $time);
Use the time the request has started, custom format and don't convert to GMT:my $fmt = "%a, %D %H:%M:%S %Z";
$fmtdate = Apache2::Util::httime($r->pool, $r->requesttime, $fmt, 0);
SSeeee AAllssoo modperl 2.0 documentation. CCooppyyrriigghhtt modperl 2.0 and its core modules are copyrighted under The Apache Software License, Version 2.0. AAuutthhoorrss The modperl development team and numerous contributors.perl v5.8.8apachemodperl-101.1~2:2:0m0o5d-1p0e-r2l0-2.0.2::docs::api::Apache2::Util(3)