Move to git-archive for zip support
[gitphp.git] / include / util.script_url.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
25
26
27
28
<?php
/*
 *  util.script_url.php
 *  gitphp: A PHP git repository browser
 *  Component: Utility - get running script url
 *
 *  Copyright (C) 2009 Christopher Han <xiphux@gmail.com>
 */
 
function script_url()
{
        global $gitphp_conf;
 
        if (isset($gitphp_conf['self']))
                return $gitphp_conf['self'];
 
        if (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on'))
                $scriptstr = "https://";
        else
                $scriptstr = "http://";
 
        $scriptstr .= $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
 
        return $scriptstr;
}
 
?>
 
comments