It deletes the gallery item using given $cid and $fid.

@param type $cid Gallery Id
@param type $fid File Id
@return array
543537
public function run( $cid, $fid ) {

		$model		= $this->model;
		$gallery	= $this->galleryService->getById( $cid );

		if( isset( $gallery ) && ( $this->direct || $gallery->belongsTo( $model ) ) ) {

			if( $this->minItems > 0 ) {

				$items = $gallery->files;

				if( count( $items ) <= $this->minItems ) {

					// Trigger Ajax Failure
					return AjaxUtil::generateFailure( Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_REQUEST ), [ 'limit' => "Minimum $this->minItems items are required for a gallery." ] );
				}
			}

			$modelFile = $this->modelFileService->getFirstByParentModelId( $gallery->id, CoreGlobal::TYPE_GALLERY, $fid );

			if( isset( $modelFile ) ) {

				$data = [ 'mid' => $modelFile->id ];

				$this->modelFileService->delete( $modelFile );

				// Trigger Ajax Success
				return AjaxUtil::generateSuccess( Yii::$app->coreMessage->getMessage( CoreGlobal::MESSAGE_REQUEST ), $data );
			}
		}

		// Trigger Ajax Failure
		return AjaxUtil::generateFailure( Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_NOT_FOUND ) );
	}
469275
protected function deleteFromFileStore(ParsedFileID $parsedFileID, Filesystem $fs, FileResolutionStrategy $strategy)
    {
        $deleted = false;
        /** @var ParsedFileID $parsedFileIDToDel */
        foreach ($strategy->findVariants($parsedFileID, $fs) as $parsedFileIDToDel) {
            $fs->delete($parsedFileIDToDel->getFileID());
            $deleted = true;
        }

        // Truncate empty dirs
        $this->truncateDirectory(dirname($parsedFileID->getFileID()), $fs);

        return $deleted;
    }
1150960
public function channelClientPermRemove($cid, $cldbid, $permid)
  {
    if(!is_array($permid))
    {
      $permident = (is_numeric($permid)) ? "permid" : "permsid";
    }
    else
    {
      $permident = (is_numeric(current($permid))) ? "permid" : "permsid";
    }

    $this->execute("channelclientdelperm", array("cid" => $cid, "cldbid" => $cldbid, $permident => $permid));
  }
661901
public function delete($id)
	{
		try {
			$this->getIndex()->deleteObject($id);
		} catch (\Exception $e) {
			return false;
		}
		
		return true;
	}
40489
public function delete_msg($uid){
    if ( $this->is_connected() ){
      return imap_delete($this->stream, $this->get_msg_no($uid));
    }
    return false;
  }
569118
public function delete_message($uids, $folder='')
    {
        if (!strlen($folder)) {
            $folder = $this->folder;
        }

        list($uids, $all_mode) = $this->parse_uids($uids);

        // exit if no message uids are specified
        if (empty($uids)) {
            return false;
        }

        if (!$this->check_connection()) {
            return false;
        }

        $deleted = $this->conn->flag($folder, $uids, 'DELETED');

        if ($deleted) {
            // send expunge command in order to have the deleted message
            // really deleted from the folder
            $this->expunge_message($uids, $folder, false);
            $this->clear_messagecount($folder);

            // unset threads internal cache
            unset($this->icache['threads']);

            $this->set_search_dirty($folder);

            // remove message ids from search set
            if ($this->search_set && $folder == $this->folder) {
                // threads are too complicated to just remove messages from set
                if ($this->search_threads || $all_mode) {
                    $this->refresh_search();
                }
                else if (!$this->search_set->incomplete) {
                    $this->search_set->filter(explode(',', $uids));
                }
            }

            // remove cached messages
            $this->clear_message_cache($folder, $all_mode ? null : explode(',', $uids));
        }

        return $deleted;
    }
100927
public function sendFile($id,$fid,$type) {
		$send_snoopy = new Snoopy; 
		$post = array();
		$post['tofakeid'] = $id;
		$post['type'] = $type;
		$post['token'] = $this->_token;
		$post['fid'] = $fid;
		$post['fileid'] = $fid;
		$post['error'] = 'false';
		$post['ajax'] = 1;
        $send_snoopy->referer = "https://mp.weixin.qq.com/cgi-bin/singlemsgpage?fromfakeid={$id}&msgid=&source=&count=20&t=wxm-singlechat&lang=zh_CN";
		$send_snoopy->rawheaders['Cookie']= $this->cookie;
		$submit = "https://mp.weixin.qq.com/cgi-bin/singlesend?t=ajax-response";
		$send_snoopy->submit($submit,$post);
		$result = $send_snoopy->results;
		$this->log('sendfile:'.$result);
		$json = json_decode($result,true);
		if ($json && $json['ret']==0) 
			return true;
		else
			return false;
	}
1366791
public void deleteEntry(final String fsid) throws Exception {
        synchronized (FileStore.getFileStore()) {

            // Remove entry from Feed
            final Feed feed = getFeedDocument();
            updateFeedDocumentRemovingEntry(feed, fsid);

            final String entryFilePath = getEntryPath(fsid);
            FileStore.getFileStore().deleteFile(entryFilePath);

            final String entryMediaPath = getEntryMediaPath(fsid);
            if (entryMediaPath != null) {
                FileStore.getFileStore().deleteFile(entryMediaPath);
            }

            final String entryDirPath = getEntryDirPath(fsid);
            FileStore.getFileStore().deleteDirectory(entryDirPath);

            try {
                Thread.sleep(500L);
            } catch (final Exception ignored) {
            }
        }
    }
182337
public function delete(int $fd, $rooms)
    {
        $rooms = is_array($rooms) ? $rooms : [$rooms];
        $rooms = count($rooms) ? $rooms : $this->getRooms($fd);

        $this->removeValue($fd, $rooms, RoomContract::DESCRIPTORS_KEY);

        foreach ($rooms as $room) {
            $this->removeValue($room, [$fd], RoomContract::ROOMS_KEY);
        }
    }
1081533
public function delete($id)
    {
        // Find the given instance
        $deleted  = false;
        $instance = $id instanceof Model ? $id : $this->find($id);

        if ($instance) {
            // Delete the instance
            $deleted = $instance->delete();

            // Fire the deleted event
            $this->getContainer('events')->fire($this->getRepositoryId().'.entity.deleted', [$this, $instance]);
        }

        return [
            $deleted,
            $instance,
        ];
    }
573537
public function unBindUid($uid, $fd)
    {
        //更新共享内存
        $in_table_uid = $this->uid_fd_table->get($uid);
        $in_table_fd = $this->fd_uid_table->get($fd);
        //判断共享内存中存储的uid与fd配对是否为当前要删除的配对，如果确认是，再进行删除
        if (!empty($in_table_uid) && $in_table_uid['fd'] == $fd) {
            $this->uid_fd_table->del($uid);
        }

        if (!empty($in_table_fd) && $in_table_fd['uid'] == $uid) {
            echo "\n 【当前共享内存中存储的fd与uid配对成功，进行删除】";
            $this->fd_uid_table->del($fd);
        }
        //这里无论是不是集群都需要调用
        ProcessManager::getInstance()->getRpcCall(ClusterProcess::class, true)->my_removeUid($uid);
        if (!$this->isCluster()) {
            get_instance()->pub('$SYS/uidcount', $this->uid_fd_table->count());
        }
    }
1059509
public function run($cid = null, $fid = null, $id = null, $slug = null)
    {
        $thread = $this->getThread($cid, $fid, $id, $slug);
        if (empty($thread)) {
            $this->controller->error(Yii::t('podium/flash', 'Sorry! We can not find the thread you are looking for.'));
            return $this->controller->redirect(['forum/index']);
        }

        if (!User::can($this->permission, ['item' => $thread])) {
            $this->controller->error(Yii::t('podium/flash', 'Sorry! You do not have the required permission to perform this action.'));
            return $this->controller->redirect(['forum/index']);
        }

        if (call_user_func([$thread, $this->switcher])) {
            $this->controller->success($thread->{$this->boolAttribute} ? $this->onMessage : $this->offMessage);
        } else {
            $this->controller->error(Yii::t('podium/flash', 'Sorry! There was an error while updating the thread.'));
        }
        return $this->controller->redirect([
            'forum/thread',
            'cid' => $thread->forum->category->id,
            'fid' => $thread->forum->id,
            'id' => $thread->id,
            'slug' => $thread->slug
        ]);
    }
472617
protected function cidExists($cid)
    {
        foreach ($this->attachment as $attachment) {
            if ('inline' == $attachment[6] and $cid == $attachment[7]) {
                return true;
            }
        }

        return false;
    }
1240510
public function deleteCartItem($cid) {
    $account = \Drupal::currentUser();
    $query = $this->connection->delete('site_cart');
    $query->condition('cid', $cid);
    $query->execute();
    return $query;
  }
952326
public function run( $cid ) {

		$model		= $this->model;
		$gallery	= $this->galleryService->getById( $cid );

		if( isset( $gallery ) && ( $this->direct || $gallery->belongsTo( $model ) ) ) {

			if( $this->maxItems > 0 ) {

				$items = $gallery->files;

				if( count( $items ) >= $this->maxItems ) {

					// Trigger Ajax Failure
					return AjaxUtil::generateFailure( Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_REQUEST ), [ 'limit' => "You are not allowed to add more than $this->maxItems items." ] );
				}
			}

			$file = new File();

			$file->siteId = $gallery->siteId;

			if( $file->load( Yii::$app->request->post(), $this->fileName ) && $file->validate() ) {

				$modelFile = $this->galleryService->createItem( $gallery, $file, $this->modelType );

				$file = $modelFile->model;

				$data = [
					'mid' => $modelFile->id, 'fid' => $file->id,
					'name' => $file->name, 'extension' => $file->extension,
					'title' => $file->title, 'caption' => $file->caption,
					'altText' => $file->altText, 'link' => $file->link, 'description' => $file->description,
					'url' => $file->getFileUrl()
				];

				if( $file->type == 'image' ) {

					$data[ 'mediumUrl' ]	= $file->getMediumUrl();
					$data[ 'thumbUrl' ]		= $file->getThumbUrl();
				}

				// Trigger Ajax Success
				return AjaxUtil::generateSuccess( Yii::$app->coreMessage->getMessage( CoreGlobal::MESSAGE_REQUEST ), $data );
			}

			// Generate Errors
			$errors = AjaxUtil::generateErrorMessage( $file );

			// Trigger Ajax Failure
			return AjaxUtil::generateFailure( Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_REQUEST ), $errors );
		}

		// Trigger Ajax Failure
		return AjaxUtil::generateFailure( Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_NOT_FOUND ) );
	}
1169712
public function delete(int $id)
    {
        try {
            $sh = @shmop_open($this->getSharedItemKey($id), 'w', 0, 0);
        } catch (\Throwable $e) {
            return false;
        }

        if (!$sh) {
            return false;
        }

        $deleted = shmop_delete($sh);
        shmop_close($sh);

        return $deleted;
    }
122093
public function actionEditForum($cid = null, $id = null)
    {
        $model = Forum::find()->where(['id' => $id, 'category_id' => $cid])->limit(1)->one();
        if (empty($model)) {
            $this->error(Yii::t('podium/flash', 'Sorry! We can not find Forum with this ID.'));
            return $this->redirect(['admin/forums', 'cid' => $cid]);
        }
        if ($model->load(Yii::$app->request->post())) {
            if ($model->save()) {
                Log::info('Forum updated', $model->id, __METHOD__);
                $this->success(Yii::t('podium/flash', 'Forum has been updated.'));
                return $this->refresh();
            }
            $this->error(Yii::t('podium/flash', 'Sorry! There was an error while updating the forum.'));
        }
        return $this->render('forum', [
            'model' => $model,
            'forums' => Forum::find()->where(['category_id' => $cid])->orderBy(['sort' => SORT_ASC, 'id' => SORT_ASC])->all(),
            'categories' => Category::find()->orderBy(['sort' => SORT_ASC, 'id' => SORT_ASC])->all()
        ]);
    }