Cache expiration isn't an error
[gitphp.git] / include / util.agecmp.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
/*
 *  util.agecmp.php
 *  gitphp: A PHP git repository browser
 *  Component: Utility - project age comparison function
 *
 *  Copyright (C) 2008 Christopher Han <xiphux@gmail.com>
 */
 
 require_once('gitutil.git_read_commit.php');
 require_once('gitutil.git_read_head.php');
 
function agecmp($a,$b)
{
        global $gitphp_conf;
        $ca = git_read_commit($gitphp_conf['projectroot'] . $a, git_read_head($gitphp_conf['projectroot'] . $a));
        $cb = git_read_commit($gitphp_conf['projectroot'] . $b, git_read_head($gitphp_conf['projectroot'] . $b));
        if ($ca['age'] == $cb['age'])
                return 0;
        return ($ca['age'] < $cb['age'] ? -1 : 1);
}
 
?>
 
comments