diff options
| author | Christian Weiske <cweiske@cweiske.de> | 2016-02-11 22:43:34 +0100 |
|---|---|---|
| committer | Christian Weiske <cweiske@cweiske.de> | 2016-02-11 22:43:34 +0100 |
| commit | d6c817be8dfb9d41ea3f19cecd90619cde97209d (patch) | |
| tree | e511903d2bfcf87f8d26da68fd4df529d33eaa3a /src/phinde/Helper.php | |
| parent | e43db7fd25798616ad38a959bd378bb765b9323c (diff) | |
| download | phinde-0.1.0.tar.gz phinde-0.1.0.zip | |
opensearch supportv0.1.0
Diffstat (limited to 'src/phinde/Helper.php')
| -rw-r--r-- | src/phinde/Helper.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/phinde/Helper.php b/src/phinde/Helper.php index 312c5e5..43345ba 100644 --- a/src/phinde/Helper.php +++ b/src/phinde/Helper.php @@ -41,5 +41,23 @@ class Helper ) ); } + + /** + * Create a full URL with protocol and host name + * + * @param string $path Path to the file, with leading / + * + * @return string Full URL + */ + public static function fullUrl($path = '/') + { + if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']) { + $prot = 'https'; + } else { + $prot = 'http'; + } + return $prot . '://' . $_SERVER['HTTP_HOST'] . $path; + } + } ?> |
