public function prepare_workspace() { $this->workspace = rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . time() . rand(0, 1000); mkdir($this->workspace, 0777, true); $this->workspace = realpath($this->workspace); }