public function deleteExpiredTempImages() { $attachList = $this->attachmentDao->findExpiredInactiveItems(time() - 3600); /* @var $item BOL_Attachment */ foreach ($attachList as $item) { if (file_exists($this->getAttachmentsTempDir() . $item->getFileName())) { unlink($this->getAttachmentsTempDir() . $item->getFileName()); } $this->attachmentDao->delete($item); } }
public function deleteExpiredTempImages() { $attachList = $this->attachmentDao->findExpiredInactiveItems(time() - 3600); /* @var $item BOL_Attachment */ foreach ($attachList as $item) { $filePath = $this->getAttachmentsDir() . $item->getFileName(); if (OW::getStorage()->fileExists($filePath)) { OW::getStorage()->removeFile($filePath); } $this->attachmentDao->delete($item); } }