mirror of
https://github.com/maximebf/php-debugbar.git
synced 2025-07-26 03:01:23 +02:00
Check if file exists on FileStorage (#777)
This commit is contained in:
@@ -386,7 +386,7 @@ class DebugBar implements ArrayAccess
|
|||||||
$datasets = $stackedData;
|
$datasets = $stackedData;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $datasets;
|
return array_filter($datasets);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -41,7 +41,12 @@ class FileStorage implements StorageInterface
|
|||||||
*/
|
*/
|
||||||
public function get($id)
|
public function get($id)
|
||||||
{
|
{
|
||||||
return json_decode(file_get_contents($this->makeFilename($id)), true);
|
$fileName = $this->makeFilename($id);
|
||||||
|
if (!file_exists($fileName)) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
return json_decode(file_get_contents($fileName), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user