Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Ivlev
bugzilla
Commits
f59ece67
Commit
f59ece67
authored
Jan 28, 2005
by
travis%sedsystems.ca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 278791 : Move ModTime() to Bugzilla::Util
Patch by Max K-A <mkanat@kerio.com> r=vladd a=justdave
parent
b61cb720
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
15 deletions
+23
-15
Util.pm
Bugzilla/Util.pm
+20
-1
globals.pl
globals.pl
+1
-13
showdependencygraph.cgi
showdependencygraph.cgi
+2
-1
No files found.
Bugzilla/Util.pm
View file @
f59ece67
...
...
@@ -33,7 +33,8 @@ use base qw(Exporter);
css_class_quote
lsearch max min
trim diff_strings
format_time format_time_decimal)
;
format_time format_time_decimal
file_mod_time)
;
use
Bugzilla::
Config
;
use
Bugzilla::
Error
;
...
...
@@ -223,6 +224,14 @@ sub format_time_decimal {
return
$newtime
;
}
sub
file_mod_time
($)
{
my
(
$filename
)
=
(
@_
);
my
(
$dev
,
$ino
,
$mode
,
$nlink
,
$uid
,
$gid
,
$rdev
,
$size
,
$atime
,
$mtime
,
$ctime
,
$blksize
,
$blocks
)
=
stat
(
$filename
);
return
$mtime
;
}
sub
ValidateDate
{
my
(
$date
,
$format
)
=
@_
;
...
...
@@ -272,6 +281,9 @@ Bugzilla::Util - Generic utility functions for bugzilla
# Functions for formatting time
format_time($time);
# Functions for dealing with files
$time = file_mod_time($filename);
=head1 DESCRIPTION
This package contains various utility functions which do not belong anywhere
...
...
@@ -408,6 +420,13 @@ shown in different formats.
Returns a number with 2 digit precision, unless the last digit is a 0. Then it
returns only 1 digit precision.
=head2 Files
=over 4
=item C<file_mod_time($filename)>
Takes a filename and returns the modification time. It returns it in the format of the "mtime" parameter of the perl "stat" function.
=back
globals.pl
View file @
f59ece67
...
...
@@ -352,22 +352,10 @@ sub GetKeywordIdFromName {
}
# Returns the modification time of a file.
sub
ModTime
{
my
(
$filename
)
=
(
@_
);
my
(
$dev
,
$ino
,
$mode
,
$nlink
,
$uid
,
$gid
,
$rdev
,
$size
,
$atime
,
$mtime
,
$ctime
,
$blksize
,
$blocks
)
=
stat
(
$filename
);
return
$mtime
;
}
$::VersionTableLoaded
=
0
;
sub
GetVersionTable
{
return
if
$::VersionTableLoaded
;
my
$mtime
=
ModT
ime
(
"$datadir/versioncache"
);
my
$mtime
=
file_mod_t
ime
(
"$datadir/versioncache"
);
if
(
!
defined
$mtime
||
$mtime
eq
""
||
!-
r
"$datadir/versioncache"
)
{
$mtime
=
0
;
}
...
...
showdependencygraph.cgi
View file @
f59ece67
...
...
@@ -28,6 +28,7 @@ use lib qw(.);
use
File::
Temp
;
use
Bugzilla
;
use
Bugzilla::
Config
qw(:DEFAULT $webdotdir)
;
use
Bugzilla::
Util
;
require
"CGI.pl"
;
...
...
@@ -271,7 +272,7 @@ foreach my $f (@files)
# symlinks), this can't escape to delete anything it shouldn't
# (unless someone moves the location of $webdotdir, of course)
trick_taint
(
$f
);
if
(
ModT
ime
(
$f
)
<
$since
)
{
if
(
file_mod_t
ime
(
$f
)
<
$since
)
{
unlink
$f
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment