/** * @return SplFileObject */ public function createTmpFile() { $tmpFile = $this->tmpDir . '/' . $this->tmpFileNameNum . '_file_' . microtime(true) . '.tmp'; // create tmp file $fileInfo = new SplFileInfo($tmpFile, $tmpFile, $tmpFile); $file = $fileInfo->openFile('a'); // increment for the next file $this->tmpFileNameNum++; return $file; }
/** * prepares the scanner for execution * */ public function prepare(SplFileInfo $fileinfo) { $this->file = $fileinfo->openFile(); }
public function openFile($open_mode = 'r', $use_include_path = false, $context = null) { return $this->fileInfo->openFile($open_mode, $use_include_path, $context); }