From 992170d966b238ce17504f1c347a501d46d50082 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Tue, 17 Apr 2012 10:19:46 +0200 Subject: [PATCH] use anonymous image --- src/phorkie/Repository/Commit.php | 8 +++++++- src/phorkie/Tools.php | 16 ++++++++++++++++ www/phorkie/anonymous.png | Bin 0 -> 847 bytes 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 www/phorkie/anonymous.png 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 diff --git a/www/phorkie/anonymous.png b/www/phorkie/anonymous.png new file mode 100644 index 0000000000000000000000000000000000000000..b218029a7e0f0684fe17c94a281fa7e7f6ec826a GIT binary patch literal 847 zcmV-V1F-ywP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_0008wNkl;{gU0$4oK;NJQ30P6gU>1XM6FP_@>Tnh%phE+0MieB= z^A9!w{b2%4&-rQ$nV>F-#E|+`n`JM0goZtDKb1wgN z8Q7{~MC`>~n8XxDurEJf!+9*AgSCj*_*)1>!~q<|99r1GMO?*=R2#$)4q-1=aRT2& z#N}Hi5D}wz4Nu}noW(MhB4WL!JB$g8V+=>|Dc*>PmA_0NB97yI9Kb9(5wW_(?P}## zy@Jb_j)+rRCXnDCVI4F57H@&bam-^FPdC{a=o9uc_zjOo#Mj%&@`!jCi`aul>f5oW zA>rP}D4vOkGuu68-EQ~icDwx@rg3+>-9Fvzc7LtD-&WHg|kJrznbrRnJ<;sFGR$l0{kGJ%g0`Ezc(UgQfD=faVu?Z zA~2anX1RDbp1=dOq#aE!D>;bAYC6@rsX}i#F(#V`Ol5^zsx9c%yn+>6DfBMk^M(lY zvOHI^lo(S@1V(VRR^i^nS`q%ryLTeuVzC96@Lod%eu{|sLT^1w_(&6heMN1r7F@^u zcq