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')
+ )
+ );
}
/**
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