Skip to content

Commit

Permalink
fixed PhpConsole\Storage option initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
barbushin committed Feb 1, 2014
1 parent e59f3f8 commit b9653c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ PHP Console service provider config-file looks like this:
'dumperDumpSizeLimit' => 500000,
'dumperDetectCallbacks' => true,
'detectDumpTraceAndSource' => false,
'dataStorage' => new PhpConsole\Storage\File(storage_path('php-console.dat'), true),
);

See [PhpConsole\Laravel\ServiceProvider](/src/PhpConsole/Laravel/ServiceProvider.php) for detailed options description.
Expand Down
8 changes: 7 additions & 1 deletion src/PhpConsole/Laravel/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ServiceProvider extends \Illuminate\Support\ServiceProvider {
protected $dumperDetectCallbacks = true;
/** @var bool Autodetect and append trace data to debug */
protected $detectDumpTraceAndSource = false;
/** @var \PhpConsole\Storage Postponed response storage */
/** @var \PhpConsole\Storage|null Postponed response storage */
protected $dataStorage = false;

/**
Expand Down Expand Up @@ -96,6 +96,12 @@ protected function setOption($name, $value) {
}

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

$connector = Connector::getInstance();
Expand Down

0 comments on commit b9653c0

Please sign in to comment.