public function getConfiguredWriter($fp, Configuration $config = null)
    {
        if(! $config) {
            $config = $this->config;
        }

        $writerName = $config->getOption(Configuration::OPT_WRITER);
        if(! $writerName) {
            throw new \Exception('Writer must be defined in config for getConfiguredWriter()');
        }

        $writer = $this->getWriterByName($fp, $writerName);
        $writer->setAutoCloseStream($config->getOption(Configuration::OPT_AUTO_CLOSE_STREAM, false));
        $writer->setConfig($config);
        return $writer;
    }
public function getConfiguredWriter($fp, Configuration $config = null)
    {
        if(! $config) {
            $config = $this->config;
        }

        $writerName = $config->getOption(Configuration::OPT_WRITER);
        if(! $writerName) {
            throw new \Exception('Writer must be defined in config for getConfiguredWriter()');
        }

        $writer = $this->getWriterByName($fp, $writerName);
        $writer->setAutoCloseStream($config->getOption(Configuration::OPT_AUTO_CLOSE_STREAM, false));
        $writer->setConfig($config);
        return $writer;
    }
public function getConfiguredWriter ( $ fp , Configuration $ config = null ) { if ( ! $ config ) { $ config = $ this -> config ; } $ writerName = $ config -> getOption ( Configuration :: OPT_WRITER ) ; if ( ! $ writerName ) { throw new \ Exception ( 'Writer must be defined in config for getConfiguredWriter()' ) ; } $ writer = $ this -> getWriterByName ( $ fp , $ writerName ) ; $ writer -> setAutoCloseStream ( $ config -> getOption ( Configuration :: OPT_AUTO_CLOSE_STREAM , false ) ) ; $ writer -> setConfig ( $ config ) ; return $ writer ; }
Get a writer configured using the default configuration or the one passed in.

@param stream $fp
@param Configuration $config
@return Writer
Get a writer configured using the default configuration or the one passed in .