示例#1
0
 /**
  * Deletes a video, override for the parent delete
  *
  * @return boolean
  */
 public function delete()
 {
     // in case of an uploaded video make sure it's also deleted from queue and trash
     // with related media if it still remained there
     if ($this->videotype == 'uploaded') {
         $queue_object = new izapQueue();
         $queue_object->delete_from_trash($this->guid, true);
         $queue_object->delete($this->guid, true);
     }
     $imagesrc = $this->imagesrc;
     $filesrc = $this->videofile;
     $ofilesrc = $this->orignalfile;
     //delete entity from elgg db and corresponding files if exist
     $this->setFilename($imagesrc);
     $image_file = $this->getFilenameOnFilestore();
     file_exists($image_file) && @unlink($image_file);
     $this->setFilename($filesrc);
     $video_file = $this->getFilenameOnFilestore();
     file_exists($video_file) && @unlink($video_file);
     $this->setFilename($ofilesrc);
     $orignal_file = $this->getFilenameOnFilestore();
     file_exists($orignal_file) && @unlink($orignal_file);
     return parent::delete();
 }
示例#2
0
 /**
  * deletes a video, override for the parent delete
  *
  * @return boolean
  */
 public function delete()
 {
     global $CONFIG;
     if ($this->videotype == 'uploaded' && $this->converted == 'no') {
         // delete entity from queue and trash with related media
         $queue_object = new izapQueue();
         $queue_object->delete_from_trash($this->guid, true);
         $queue_object->delete($this->guid, true);
     }
     $imagesrc = $this->imagesrc;
     $filesrc = $this->videofile;
     $ofilesrc = $this->orignalfile;
     $orignal_thumb = $this->orignal_thumb;
     //delete entity from elgg db and corresponding files if exist
     $this->setFilename($imagesrc);
     $image_file = $this->getFilenameOnFilestore();
     file_exists($image_file) && @unlink($image_file);
     $this->setFilename($filesrc);
     $video_file = $this->getFilenameOnFilestore();
     file_exists($video_file) && @unlink($video_file);
     $this->setFilename($ofilesrc);
     $orignal_file = $this->getFilenameOnFilestore();
     file_exists($orignal_file) && @unlink($orignal_file);
     $this->setFilename($orignal_thumb);
     $orignal_thumb_file = $this->getFilenameOnFilestore();
     file_exists($orignal_thumb_file) && @unlink($orignal_thumb_file);
     return delete_entity($this->guid, TRUE);
 }