Changeset 1779
- Timestamp:
- 04/05/08 02:21:23 (5 months ago)
- Files:
-
- branches/release-33/lib/MT/CMS/Blog.pm (modified) (1 diff)
- branches/release-33/lib/MT/FileMgr.pm (modified) (1 diff)
- branches/release-33/lib/MT/FileMgr/Local.pm (modified) (1 diff)
- branches/release-33/lib/MT/WeblogPublisher.pm (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/release-33/lib/MT/CMS/Blog.pm
r1778 r1779 559 559 my $done = 0; 560 560 my $type = $order[$next]; 561 my $archiver = $app->publisher->archiver($type); 561 562 my $pub = $app->publisher; 563 $pub->start_time( $start_time ); # force start time to parameter start_time 564 565 my $archiver = $pub->archiver($type); 562 566 my $archive_label = $archiver ? $archiver->archive_label : ''; 563 567 branches/release-33/lib/MT/FileMgr.pm
r1174 r1779 36 36 sub delete; 37 37 sub content_is_updated { 1 } 38 sub file_mod_time { undef } 38 39 39 40 sub is_handle { branches/release-33/lib/MT/FileMgr/Local.pm
r1174 r1779 120 120 } 121 121 122 sub file_mod_time { 123 my $fmgr = shift; 124 my ($file) = @_; 125 if (-e $file) { 126 return (stat($file))[9]; # modification timestamp 127 } 128 return undef; 129 } 130 122 131 sub content_is_updated { 123 132 my $fmgr = shift; branches/release-33/lib/MT/WeblogPublisher.pm
r1754 r1779 29 29 my $this = {@_}; 30 30 my $cfg = MT->config; 31 if ( !exists $this->{start_time} ) { 32 $this->{start_time} = time; 33 } 31 34 if ( !exists $this->{NoTempFiles} ) { 32 35 $this->{NoTempFiles} = $cfg->NoTempFiles; … … 109 112 }; 110 113 114 } 115 116 sub start_time { 117 my $pub = shift; 118 $pub->{start_time} = shift if @_; 119 return $pub->{start_time}; 111 120 } 112 121 … … 809 818 } 810 819 820 # Calculate file path and URL for the new entry. 821 my $file = File::Spec->catfile( $root_path, $map->{__saved_output_file} ); 822 823 ## Untaint. We have to assume that we can trust the user's setting of 824 ## the archive_path, and nothing else is based on user input. 825 ($file) = $file =~ /(.+)/s; 826 827 # compare file modification time to start of build process. if it 828 # is greater than the start_time, then we shouldn't need to build this 829 # file again 830 my $fmgr = $blog->file_mgr; 831 if (my $mod_time = $fmgr->file_mod_time($file)) { 832 return 1 if $mod_time >= $mt->start_time; 833 } 834 811 835 if ( $archiver->category_based ) { 812 836 $category = $specifier{Category}; … … 850 874 local $ctx->{current_timestamp_end} = $end if $end; 851 875 852 my $fmgr = $blog->file_mgr;853 876 $ctx->{__stash}{blog} = $blog; 854 877 855 # Calculate file path and URL for the new entry.856 my $file = File::Spec->catfile( $root_path, $map->{__saved_output_file} );857 878 require MT::FileInfo; 858 879 … … 907 928 my ($rel_url) = ( $url =~ m|^(?:[^:]*\:\/\/)?[^/]*(.*)| ); 908 929 $rel_url =~ s|//+|/|g; 909 910 ## Untaint. We have to assume that we can trust the user's setting of911 ## the archive_path, and nothing else is based on user input.912 ($file) = $file =~ /(.+)/s;913 930 914 931 # Clear out all the FileInfo records that might point at the page
