aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2014-07-07 08:50:08 +0200
committerChristian Weiske <cweiske@cweiske.de>2014-07-07 08:50:08 +0200
commitf92fbaf636d620a0092fff8b715be9a493547b4f (patch)
treedb943ec6699aa954e3c65ea01738b91f2ecb3634 /src
parent5e590903694ccec284fa5ea957f957c2209bbb2a (diff)
downloadphorkie-f92fbaf636d620a0092fff8b715be9a493547b4f.tar.gz
phorkie-f92fbaf636d620a0092fff8b715be9a493547b4f.zip
automatically configure git paths (dir + public clone url)
Diffstat (limited to 'src')
-rw-r--r--src/phorkie/Tools.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/phorkie/Tools.php b/src/phorkie/Tools.php
index e97c546..2febb29 100644
--- a/src/phorkie/Tools.php
+++ b/src/phorkie/Tools.php
@@ -49,6 +49,23 @@ class Tools
}
/**
+ * Get the full URL to a path, but remove the .phar file from
+ * the base URL if necessary
+ *
+ * @param string $path Path to the file
+ *
+ * @return string Full URL without .phar/
+ */
+ public static function fullUrlNoPhar($path = '')
+ {
+ $base = static::fullUrl();
+ if (substr($base, -6) == '.phar/') {
+ $base = dirname($base) . '/';
+ }
+ return $base . $path;
+ }
+
+ /**
* Removes malicious parts from a file name
*
* @param string $file File name from the user