Download the PHP package slack-php/slack-socket-mode without Composer

On this page you can find all versions of the php package slack-php/slack-socket-mode. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package slack-socket-mode

Slack PHP – Socket Mode

This package provides a slack-php AppServer implementation that allows an application written for the Slack App Framework for PHP to be run in Socket Mode. Socket Mode uses the websocket protocol to communicate with Slack, and allows you to run an app (even locally) without having to expose it via a public HTTP endpoint. This can be very useful for testing Slack apps in a way that does not violate most work-related firewall restrictions.

This package should be used for testing only, and is not designed for production use.

This Socket Mode implementation uses the amphp/websocket-client package from Amp, an awesome collection of PHP packages that make async and event loop style programming in PHP possible. Check it out sometime.

Installation

Usage

When using Socket Mode, there is no web server serving your app. When you run an app configured for Socket Mode, it establishes a connection to Slack as a websocket client. It maintains that connection to listen for Slack events until it is explicitly terminated (e.g., via CTRL+C), Socket Mode is disabled in your app configuration, or an unrecoverable error occurs. This is a different way of running PHP than many aren't used to, so please pay close attention.

When running an app in Slack Mode, you need an "App Token" instead of the typical "Signing Secret". The App Token is specially purposed for making the web socket connection. You can read more about Socket Mode in the Slack documentation to learn how to get an App Token.

Example

This small app responds to the /cool slash command.

Assumptions:

  • You have required the Composer autoloader to enable autoloading of the framework files.
  • You have set SLACK_APP_TOKEN in the environment (e.g., putenv("SLACK_APP_TOKEN=foo");)

Switching Servers

The relationship between app and server can also be flipped, which might be helpful if you bootstrap script toggles between the Socket and HTTP server.


All versions of slack-socket-mode with dependencies

PHP Build Version
Package Version
Requires amphp/websocket-client Version ^1.0
slack-php/slack-app-framework Version >=0.5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package slack-php/slack-socket-mode contains the following files

Loading the files please wait ....