diff options
| author | Christian Weiske <cweiske@cweiske.de> | 2012-04-17 10:19:46 +0200 |
|---|---|---|
| committer | Christian Weiske <cweiske@cweiske.de> | 2012-04-17 10:19:46 +0200 |
| commit | 992170d966b238ce17504f1c347a501d46d50082 (patch) | |
| tree | 683dab89f5543c29ef3b52f7e87de264d6087ff4 /src | |
| parent | a4a47e2f9bd26259f0f6256a9652a39836c56a4d (diff) | |
| download | phorkie-992170d966b238ce17504f1c347a501d46d50082.tar.gz phorkie-992170d966b238ce17504f1c347a501d46d50082.zip | |
use anonymous image
Diffstat (limited to 'src')
| -rw-r--r-- | src/phorkie/Repository/Commit.php | 8 | ||||
| -rw-r--r-- | src/phorkie/Tools.php | 16 |
2 files changed, 23 insertions, 1 deletions
diff --git a/src/phorkie/Repository/Commit.php b/src/phorkie/Repository/Commit.php index ec4a04a..ce00235 100644 --- a/src/phorkie/Repository/Commit.php +++ b/src/phorkie/Repository/Commit.php @@ -20,7 +20,13 @@ class Repository_Commit require_once 'PEAR/Services/Libravatar.php'; $s = new \Services_Libravatar(); - return $s->url('cweiske@cweiske.de'/*$this->committerEmail*/, array('s' => 32)); + return $s->url( + $this->committerEmail, + array( + 'size' => 32, + 'default' => Tools::fullUrl('/phorkie/anonymous.png') + ) + ); } /** diff --git a/src/phorkie/Tools.php b/src/phorkie/Tools.php index c6e4db5..d9b7637 100644 --- a/src/phorkie/Tools.php +++ b/src/phorkie/Tools.php @@ -21,6 +21,22 @@ class Tools return rmdir($path); } + /** + * 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; + } } ?>
\ No newline at end of file |
