aboutsummaryrefslogtreecommitdiff
path: root/src/phinde
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2016-02-11 22:43:34 +0100
committerChristian Weiske <cweiske@cweiske.de>2016-02-11 22:43:34 +0100
commitd6c817be8dfb9d41ea3f19cecd90619cde97209d (patch)
treee511903d2bfcf87f8d26da68fd4df529d33eaa3a /src/phinde
parente43db7fd25798616ad38a959bd378bb765b9323c (diff)
downloadphinde-0.1.0.tar.gz
phinde-0.1.0.zip
opensearch supportv0.1.0
Diffstat (limited to 'src/phinde')
-rw-r--r--src/phinde/Helper.php18
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;
+ }
+
}
?>