public function __construct($baseDir)
{
// check if baseDir exists, if not, try to create it
if (!is_dir($baseDir)) {
if (false === @mkdir($baseDir, 0770, true)) {
throw new RuntimeException('unable to create baseDir');
}
}
$this->baseDir = $baseDir;
}