I dub thy version 1.0.0

master
Gilles Crettenand 11 years ago
parent 964e0e2042
commit 8bfd07b90f

@ -141,6 +141,7 @@ class Html extends Formatter {
} }
echo static::template(array( echo static::template(array(
'version' => $info['version'],
'title' => $context['title'], 'title' => $context['title'],
'content' => $panel, 'content' => $panel,
)); ));

@ -23,13 +23,14 @@ class Logger {
return '(n-a)'; return '(n-a)';
} }
public static function start() { public static function start($data = array()) {
self::$start = microtime(true); self::$start = microtime(true);
self::$data = array( self::$data = $data + array(
'ip' => self::ip(), 'ip' => self::ip(),
'date' => date('d.m.Y H:i:s'), 'date' => date('d.m.Y H:i:s'),
'func' => '(none)', 'func' => '(none)',
'version' => '(none)',
'error' => '' 'error' => ''
); );
} }

@ -10,13 +10,19 @@ abstract class WebService
private $func = null; private $func = null;
private $status = 200; 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 * Treat the current request and output the result. This is the only
* method that should be called on the webservice directly ! * method that should be called on the webservice directly !
*/ */
public function Run() public function Run()
{ {
Logger::start(); Logger::start(array('version' => $this->version));
$renderer = new Renderer(); $renderer = new Renderer();

@ -2,7 +2,10 @@
namespace BSR; namespace BSR;
/** @var string $version version number */
$ws_version = '1.0.0';
require_once('Lib/autoloader.php'); require_once('Lib/autoloader.php');
$web = new NetBiblio(); $web = new NetBiblio($ws_version);
$web->Run(); $web->Run();

@ -17,7 +17,7 @@
<span class="icon-bar"></span> <span class="icon-bar"></span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
</button> </button>
<a class="navbar-brand" href="/">BSR WebService</a> <a class="navbar-brand" href="/">BSR WebService [{{ version }}]</a>
</div> </div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">

Loading…
Cancel
Save