[FrameworkBundle] Updated kernel test to create tmp directory on instantiation

This commit is contained in:
Brandon Turner 2010-08-11 11:53:12 -05:00 committed by Fabien Potencier
parent 50617e1acb
commit 84446fe0ec

View File

@ -20,6 +20,13 @@ class Kernel extends BaseKernel
public function __construct()
{
$this->tmpDir = sys_get_temp_dir().'/sf2_'.rand(1, 9999);
if (!is_dir($this->tmpDir)) {
if (false === @mkdir($this->tmpDir)) {
die(sprintf('Unable to create a temporary directory (%s)', $this->tmpDir));
}
} elseif (!is_writable($this->tmpDir)) {
die(sprintf('Unable to write in a temporary directory (%s)', $this->tmpDir));
}
parent::__construct('env', true);
}