PHPRtfLite::createWriter PHP Method

createWriter() private method

creates writer
private createWriter ( string $file = null )
$file string
    private function createWriter($file = null)
    {
        if ($file || $this->_useTemporaryFile) {
            if (!$this->_writer instanceof PHPRtfLite_StreamOutput) {
                $this->_writer = new PHPRtfLite_StreamOutput();
            }
            if (is_null($file)) {
                $file = sys_get_temp_dir() . '/' . md5(microtime(true)) . '.rtf';
            }
            $this->_writer->setFilename($file);
        } else {
            if (!$this->_writer instanceof PHPRtfLite_Writer_String) {
                $this->_writer = new PHPRtfLite_Writer_String();
            }
        }
    }