diff --git a/Lib/Formatter/Html.php b/Lib/Formatter/Html.php index 531a7c4..1cf1caf 100644 --- a/Lib/Formatter/Html.php +++ b/Lib/Formatter/Html.php @@ -141,6 +141,7 @@ class Html extends Formatter { } echo static::template(array( + 'version' => $info['version'], 'title' => $context['title'], 'content' => $panel, )); diff --git a/Lib/Logger.php b/Lib/Logger.php index ccd2126..fdc1b67 100644 --- a/Lib/Logger.php +++ b/Lib/Logger.php @@ -23,13 +23,14 @@ class Logger { return '(n-a)'; } - public static function start() { + public static function start($data = array()) { self::$start = microtime(true); - self::$data = array( + self::$data = $data + array( 'ip' => self::ip(), 'date' => date('d.m.Y H:i:s'), 'func' => '(none)', + 'version' => '(none)', 'error' => '' ); } diff --git a/Lib/WebService.php b/Lib/WebService.php index 0dcf1af..137a57a 100644 --- a/Lib/WebService.php +++ b/Lib/WebService.php @@ -10,13 +10,19 @@ abstract class WebService private $func = null; private $status = 200; + private $version = null; + + public function __construct($version) { + $this->version = $version; + } + /** * Treat the current request and output the result. This is the only * method that should be called on the webservice directly ! */ public function Run() { - Logger::start(); + Logger::start(array('version' => $this->version)); $renderer = new Renderer(); diff --git a/index.php b/index.php index 1158010..7b4af60 100644 --- a/index.php +++ b/index.php @@ -2,7 +2,10 @@ namespace BSR; +/** @var string $version version number */ +$ws_version = '1.0.0'; + require_once('Lib/autoloader.php'); -$web = new NetBiblio(); +$web = new NetBiblio($ws_version); $web->Run(); diff --git a/templates/layout.html b/templates/layout.html index c9ea2c0..2f00480 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -17,7 +17,7 @@ - BSR WebService + BSR WebService [{{ version }}]