PhpOffice\PhpPresentation\Writer\ODPresentation::setUseDiskCaching PHP Method

setUseDiskCaching() public method

Set use disk caching where possible?
public setUseDiskCaching ( boolean $pValue = false, string $pDirectory = null ) : ODPresentation
$pValue boolean
$pDirectory string Disk caching directory
return ODPresentation
    public function setUseDiskCaching($pValue = false, $pDirectory = null)
    {
        $this->useDiskCaching = $pValue;
        if (!is_null($pDirectory)) {
            if (!is_dir($pDirectory)) {
                throw new \Exception("Directory does not exist: {$pDirectory}");
            }
            $this->diskCachingDirectory = $pDirectory;
        }
        return $this;
    }

Usage Example

 public function testXMLWriterWithDiskCaching()
 {
     $oODPresentation = new ODPresentation();
     $oODPresentation->setUseDiskCaching(true);
     $oManifest = new Manifest();
     $oManifest->setParentWriter($oODPresentation);
     $this->assertNotEmpty(\PHPUnit_Framework_Assert::readAttribute($this->runProtectedMethod($oManifest, 'getXMLWriter'), 'tempFileName'));
 }
All Usage Examples Of PhpOffice\PhpPresentation\Writer\ODPresentation::setUseDiskCaching