public function __construct($directory = null) { if (!$directory) { $directory = sys_get_temp_dir(); } $this->directory = $directory; }