public function FileProfilerStorage::__construct

Constructs the file storage using a "dsn-like" path.

Example : "file:/path/to/the/storage/folder"

Parameters

string $dsn The DSN:

File

drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php, line 34

Class

FileProfilerStorage
Storage for profiler using files.

Namespace

Symfony\Component\HttpKernel\Profiler

Code

public function __construct($dsn) {
  if (0 !== strpos($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".', $this->dsn));
  }
  $this->folder = substr($dsn, 5);
  if (!is_dir($this->folder)) {
    mkdir($this->folder);
  }
}