posix_getpwuid doesn't exist on windows
[gitphp.git] / include / gitutil.git_project_owner.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
/*
 *  gitutil.git_project_owner.php
 *  gitphp: A PHP git repository browser
 *  Component: Git utility - project owner
 *
 *  Copyright (C) 2008 Christopher Han <xiphux@gmail.com>
 */
 
function git_project_owner($projectroot,$project)
{
        if (function_exists('posix_getpwuid')) {
                $data = posix_getpwuid(fileowner($projectroot . $project));
                if (isset($data['gecos']) && (strlen($data['gecos']) > 0))
                        return $data['gecos'];
                return $data['name'];
        } else
                return "";
}
 
?>
 
comments