File tree Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 8
8
9
9
class SessionCollector extends DataCollector implements DataCollectorInterface, Renderable
10
10
{
11
- /** @var \Symfony\Component\HttpFoundation\Session\SessionInterface $session */
11
+ /** @var \Symfony\Component\HttpFoundation\Session\SessionInterface|\Illuminate\Contracts\Session\Session $session */
12
12
protected $ session ;
13
13
14
14
/**
15
15
* Create a new SessionCollector
16
16
*
17
- * @param \Symfony\Component\HttpFoundation\Session\SessionInterface $session
17
+ * @param \Symfony\Component\HttpFoundation\Session\SessionInterface|\Illuminate\Contracts\Session\Session $session
18
18
*/
19
19
public function __construct ($ session )
20
20
{
Original file line number Diff line number Diff line change @@ -231,7 +231,16 @@ function ($view) use ($debugbar) {
231
231
$ logger = new MessagesCollector ('log ' );
232
232
$ this ['messages ' ]->aggregate ($ logger );
233
233
$ this ->app ['log ' ]->listen (
234
- function ($ level , $ message , $ context ) use ($ logger ) {
234
+ function ($ level , $ message = null , $ context = null ) use ($ logger ) {
235
+ // Laravel 5.4 changed how the global log listeners are called. We must account for
236
+ // the first argument being an "event object", where arguments are passed
237
+ // via object properties, instead of individual arguments.
238
+ if ($ level instanceof \Illuminate \Log \Events \MessageLogged) {
239
+ $ message = $ level ->message ;
240
+ $ context = $ level ->context ;
241
+ $ level = $ level ->level ;
242
+ }
243
+
235
244
try {
236
245
$ logMessage = (string ) $ message ;
237
246
if (mb_check_encoding ($ logMessage , 'UTF-8 ' )) {
Original file line number Diff line number Diff line change 11
11
*/
12
12
class SymfonyHttpDriver implements HttpDriverInterface
13
13
{
14
- /** @var \Symfony\Component\HttpFoundation\Session\Session */
14
+ /** @var \Symfony\Component\HttpFoundation\Session\Session|\Illuminate\Contracts\Session\Session */
15
15
protected $ session ;
16
16
/** @var \Symfony\Component\HttpFoundation\Response */
17
17
protected $ response ;
@@ -48,6 +48,13 @@ public function isSessionStarted()
48
48
*/
49
49
public function setSessionValue ($ name , $ value )
50
50
{
51
+ // In Laravel 5.4 the session changed to use their own custom implementation
52
+ // instead of the one from Symfony. One of the changes was the set method
53
+ // that was changed to put. Here we check if we are using the new one.
54
+ if ($ this ->session instanceof \Illuminate \Contracts \Session \Session) {
55
+ $ this ->session ->put ($ name , $ value );
56
+ return ;
57
+ }
51
58
$ this ->session ->set ($ name , $ value );
52
59
}
53
60
You can’t perform that action at this time.
0 commit comments