Skip to content

Commit b9653c0

Browse files
committed
fixed PhpConsole\Storage option initialization
1 parent e59f3f8 commit b9653c0

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ PHP Console service provider config-file looks like this:
3939
'dumperDumpSizeLimit' => 500000,
4040
'dumperDetectCallbacks' => true,
4141
'detectDumpTraceAndSource' => false,
42-
'dataStorage' => new PhpConsole\Storage\File(storage_path('php-console.dat'), true),
4342
);
4443

4544
See [PhpConsole\Laravel\ServiceProvider](/src/PhpConsole/Laravel/ServiceProvider.php) for detailed options description.

src/PhpConsole/Laravel/ServiceProvider.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class ServiceProvider extends \Illuminate\Support\ServiceProvider {
4646
protected $dumperDetectCallbacks = true;
4747
/** @var bool Autodetect and append trace data to debug */
4848
protected $detectDumpTraceAndSource = false;
49-
/** @var \PhpConsole\Storage Postponed response storage */
49+
/** @var \PhpConsole\Storage|null Postponed response storage */
5050
protected $dataStorage = false;
5151

5252
/**
@@ -96,6 +96,12 @@ protected function setOption($name, $value) {
9696
}
9797

9898
protected function initPhpConsole() {
99+
if(!$this->dataStorage) {
100+
$this->dataStorage = new PhpConsole\Storage\File(storage_path('php-console.dat'), true);
101+
}
102+
if($this->dataStorage instanceof \PhpConsole\Storage\Session) {
103+
throw new \Exception('Unable to use PhpConsole\Storage\Session as PhpConsole storage interface because of problems with overridden $_SESSION handler in Laravel');
104+
}
99105
Connector::setPostponeStorage($this->dataStorage);
100106

101107
$connector = Connector::getInstance();

0 commit comments

Comments
 (0)