@@ -36,6 +36,7 @@ use Apache2::Log ();
3636use  Apache2::Access ();
3737
3838use  APR::Table ();
39+ use  APR::Finfo ();
3940use  APR::Status ();
4041
4142use  ModPerl::Util ();
@@ -45,6 +46,7 @@ use File::Spec::Functions ();
4546use  File::Basename ();
4647
4748use  Apache2::Const -compile  =>  qw( :common &OPT_EXECCGI)  ;
49+ use  APR::Const -compile  =>  qw( FILETYPE_REG)  ;
4850use  ModPerl::Const -compile  =>  ' EXIT'  ;
4951
5052unless  (defined  $ModPerl::Registry::MarkLine ) {
@@ -256,9 +258,10 @@ sub can_compile {
256258    my  $self  = shift ;
257259    my  $r  = $self -> {REQ };
258260
259-     return  Apache2::Const::DECLINED if  -d  $r -> my_finfo;
261+     return  Apache2::Const::DECLINED
262+         unless  $r -> finfo-> filetype==APR::Const::FILETYPE_REG;
260263
261-     $self -> {MTIME } = -M  _ ;
264+     $self -> {MTIME } = $r -> finfo -> mtime ;
262265
263266    if  (!($r -> allow_options & Apache2::Const::OPT_EXECCGI)) {
264267        $r -> log_error(" Options ExecCGI is off in this directory"  ,
@@ -485,9 +488,9 @@ sub is_cached {
485488#  wasn't modified
486489sub  should_compile_if_modified  {
487490    my  $self  = shift ;
488-     $self -> {MTIME } ||= -M   $self -> {REQ }-> my_finfo ;
491+     $self -> {MTIME } ||= $self -> {REQ }-> finfo -> mtime ;
489492    !($self -> is_cached &&
490-       $self -> cache_table-> { $self -> {PACKAGE } }{mtime } < = $self -> {MTIME });
493+       $self -> cache_table-> { $self -> {PACKAGE } }{mtime } = = $self -> {MTIME });
491494}
492495
493496#  return false if the package is cached already
@@ -780,14 +783,5 @@ sub uncache_myself {
780783}
781784
782785
783- #  XXX: should go away when finfo() is ported to 2.0 (don't want to
784- #  depend on compat.pm)
785- sub  Apache2 ::RequestRec::my_finfo {
786-     my  $r  = shift ;
787-     stat  $r -> filename;
788-     \*_;
789- }
790- 
791- 
7927861;
793787__END__ 
0 commit comments