PhpOffice\PhpPresentation\Writer\PowerPoint2007::setUseDiskCaching PHP Méthode

setUseDiskCaching() public méthode

Set use disk caching where possible?
public setUseDiskCaching ( boolean $pValue = false, string $pDirectory = null ) : PowerPoint2007
$pValue boolean
$pDirectory string Disk caching directory
Résultat PowerPoint2007
    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->diskCachingDir = $pDirectory;
        }
        return $this;
    }

Usage Example

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