Exemplo n.º 1
0
 public function updateInfo($title, $image, $description, $repository, $con = null)
 {
     $this->row['title'] = $title;
     $this->row['description'] = $description;
     $this->row['repository'] = $repository;
     $old_icon_key = null;
     if ($image) {
         $old_icon_key = $this->value('icon_key');
         $this->row['icon_key'] = ApplicationDb::uploadIcon($image, $this->getId());
     }
     $this->update($con);
     if ($old_icon_key) {
         try {
             S3::delete($old_icon_key);
         } catch (Exception $e) {
             error_log(__METHOD__ . '(' . __LINE__ . '): ' . get_class($e) . ":{$e->getMessage()}");
             // 画像削除は失敗しても気にしない
         }
     }
 }
Exemplo n.º 2
0
 private function removeVideo($url)
 {
     Trace::output($this->traceID, "removeVideo");
     //----------------------------------------------------------
     //init var
     //----------------------------------------------------------
     $chk = array("bool" => true, "traceID" => "removeVideo");
     //----------------------------------------------------------
     $file = str_replace($this->s3Path, "videoOrganizer_v0/", rawurldecode($url));
     $chk = S3::delete($file);
     if ($chk['bool']) {
         $chk['message'] = 'video was successfully removed.';
     }
     if (!$chk['bool']) {
         $chk['message'] = $file . ' does not exist.';
     }
     return $chk;
 }
Exemplo n.º 3
0
 public function deleteFile()
 {
     $key = $this->getFileKey();
     S3::delete($key);
 }