function FileProfilerStorage::__construct
Constructs the file storage using a "dsn-like" path.
Example : "file:/path/to/the/storage/folder"
Throws
\RuntimeException
File
-
vendor/
symfony/ http-kernel/ Profiler/ FileProfilerStorage.php, line 33
Class
- FileProfilerStorage
- Storage for profiler using files.
Namespace
Symfony\Component\HttpKernel\ProfilerCode
public function __construct(string $dsn) {
if (!str_starts_with($dsn, 'file:')) {
throw new \RuntimeException(\sprintf('Please check your configuration. You are trying to use FileStorage with an invalid dsn "%s". The expected format is "file:/path/to/the/storage/folder".', $dsn));
}
$this->folder = substr($dsn, 5);
if (!is_dir($this->folder) && false === @mkdir($this->folder, 0777, true) && !is_dir($this->folder)) {
throw new \RuntimeException(\sprintf('Unable to create the storage directory (%s).', $this->folder));
}
}