diff options
| author | Christian Weiske <cweiske@cweiske.de> | 2014-07-07 08:50:08 +0200 |
|---|---|---|
| committer | Christian Weiske <cweiske@cweiske.de> | 2014-07-07 08:50:08 +0200 |
| commit | f92fbaf636d620a0092fff8b715be9a493547b4f (patch) | |
| tree | db943ec6699aa954e3c65ea01738b91f2ecb3634 /src | |
| parent | 5e590903694ccec284fa5ea957f957c2209bbb2a (diff) | |
| download | phorkie-f92fbaf636d620a0092fff8b715be9a493547b4f.tar.gz phorkie-f92fbaf636d620a0092fff8b715be9a493547b4f.zip | |
automatically configure git paths (dir + public clone url)
Diffstat (limited to 'src')
| -rw-r--r-- | src/phorkie/Tools.php | 17 |
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 |
