Skip to content

Commit cd9fcb6

Browse files
committed
Merge branch 'master' into v4
2 parents 5da0367 + 765b5ab commit cd9fcb6

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
4.1.5
2+
3+
- fixed crash on initialization in Lumen apps using queue (reported by gramparallelo, thanks!)
4+
15
4.1.4
26

37
- added support for a time property to the Request:add* apis, defaults to "current time - duration"

Clockwork/Clockwork.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Clockwork implements LoggerInterface
2121
/**
2222
* Clockwork version
2323
*/
24-
const VERSION = '4.1.4';
24+
const VERSION = '4.1.5';
2525

2626
/**
2727
* Array of data sources, these objects provide data to be stored in a request object

Clockwork/Support/Lumen/ClockworkServiceProvider.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
use Clockwork\DataSource\LumenDataSource;
55
use Clockwork\DataSource\PhpDataSource;
66
use Clockwork\Request\Log;
7+
use Clockwork\Request\Request;
78
use Clockwork\Support\Laravel\ClockworkServiceProvider as LaravelServiceProvider;
89

910
use Illuminate\Support\Facades\Facade;
@@ -26,6 +27,7 @@ public function register()
2627
$clockwork = (new Clockwork)
2728
->setAuthenticator($app['clockwork.authenticator'])
2829
->setLog($app['clockwork.log'])
30+
->setRequest($app['clockwork.request'])
2931
->setStorage($app['clockwork.storage'])
3032
->addDataSource(new PhpDataSource())
3133
->addDataSource($app['clockwork.lumen']);
@@ -49,6 +51,10 @@ public function register()
4951
return new Log;
5052
});
5153

54+
$this->app->singleton('clockwork.request', function ($app) {
55+
return new Request;
56+
});
57+
5258
$this->app->singleton('clockwork.storage', function ($app) {
5359
return $app['clockwork.support']->getStorage();
5460
});
@@ -61,6 +67,7 @@ public function register()
6167
$this->registerDataSources();
6268
$this->registerAliases();
6369

70+
$this->app->make('clockwork.request'); // instantiate the request to have id and time available as early as possible
6471
$this->app['clockwork.support']->configureSerializer();
6572

6673
if ($this->isRunningWithFacades() && ! class_exists('Clockwork')) {

0 commit comments

Comments
 (0)