class Tools_Docx extends createDocx{
/**
* Delete all tempfiles.
* MAKE SURE YOU USE A SEPATE DIRECTORY FOR PHPDOCX IN YOUR /TMP DIR!!!!
* This will DELETE all files in the directory you passed in the constructor!!!!
*
*/
public function cleanUp(){
$this->_recurseDelete($this->getTemporaryDirectory());
}
private function _recurseDelete($path){
if(is_dir($path)){
$dirs=scandir($path);
$c=count($dirs);
for($i=0;$i<$c;$i++){
if($dirs[$i]!='.'&&$dirs[$i]!='..'){
$this->_recurseDelete($path . DIRECTORY_SEPARATOR . $dirs[$i]);
}
}
if($path!=$this->getTemporaryDirectory()){
rmdir($path);
}
}else{
unlink($path);
}
}
}