public function __construct($dir, IJournal $journal = NULL)
{
if (!is_dir($dir)) {
throw new Nette\DirectoryNotFoundException("Directory '{$dir}' not found.");
}
$this->dir = $dir;
$this->useDirs = (bool) static::$useDirectories;
$this->journal = $journal;
if (mt_rand() / mt_getrandmax() < static::$gcProbability) {
$this->clean([]);
}
}