定制 elementworks/pusher-helper 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

elementworks/pusher-helper

Composer 安装命令:

composer require elementworks/pusher-helper

包简介

Support functionality for Pusher

README 文档

README

Support functionality for Pusher

Requirements

This plugin requires Craft CMS 3.0.0-beta.23 or later.

Installation

To install the plugin, follow these instructions.

  1. Open your terminal and go to your Craft project:

     cd /path/to/project
    
  2. Then tell Composer to load the plugin:

     composer require elementworks/pusher-helper
    
  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Pusher Helper.

Pusher Helper Overview

This plugin provides boilerplate backend support for Pusher to CraftCMS, including:

There is no front-end code provided by this plugin. You will need to write your own front-end implementation to suit your own requirements.

Configuring Pusher Helper

Copy the config.php file in the src directory of the plugin into the config directory of your project, rename it pusher-helper.php and add the settings you need for your project. You are strongly advised to use environment variables for the Pusher settings.

Add the following environment variables to your .env file in all environments:

  • PUSHER_APP_ID
  • PUSHER_KEY
  • PUSHER_SECRET
  • PUSHER_CLUSTER

PUSHER_CLUSTER defaults to eu if not otherwise specified. The other Pusher API parameters are required for the plugin to work.

The globalChannel config setting is the name of the global presence channel as described here: https://support.pusher.com/hc/en-us/articles/360019620253-How-can-I-implement-large-presence-channels-on-Channels- and must start with private-.

The userFields config setting determines what fields on a user object will be included in the presence messages sent out on the global presence channel. These can include any valid fields defined on users in your project. They can be used to populate a who's online list, so think about what information you might want to include on there, remembering it is best to keep this as brief as possible to limit the number and size of messages sent.

Pusher imposes a 10kb limit on messages, so the messages sent on the global presence channel will be chunked if they are above this.

Using Pusher Helper

Install and configure the plugin as described above.

You are responsible for providing the following to make this work:

  • All front-end javascript using the pusher.js library to authenticate users and receive and process messages from the global presence channel. The plugin provides no code for the front-end of your site and will not function without it.
  • Set up a cron job on your server to ping ./craft pusher-helper/pusher/send-presence-state at 1 minute intervals to update the presence state on the global presence channel.

Pusher Helper Roadmap

Some things to do, and ideas for potential features:

  • Release it

Brought to you by Element Works Ltd

统计信息

  • 总下载量: 115
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2020-11-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固