Download the PHP package slack-php/slack-app-framework without Composer

On this page you can find all versions of the php package slack-php/slack-app-framework. 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-app-framework

Slack App Framework for PHP

By Jeremy Lindblom (@jeremeamia)

Slack PHP logo written in PHP's font

Coded in PHP 7.4 Packagist Version Build Status


Introduction

A PHP framework for building Slack apps. It takes inspiration from Slack's Bolt frameworks.

If you are new to Slack app development, you will want to learn about it on Slack's website. This library is only useful if you already understand the basics of building Slack applications.

Installation

General Usage

Quick Warning

This library has been heavily dogfooded, but the project is severely lacking in test coverage and documentation, so use it at your own risk, as the MIT license advises.

Development Patterns

When creating an app, you can configure your app from the Slack website. The framework is designed to recieve requests from all of your app's interaction points, so you should configure all of the URLs (e.g., in Slash Commands, Interactivity & Shortcuts (don't forget the Select Menus section), and Event Subscriptions) to point to the root URL of your deployed app code.

When developing the app code, you declare one or more Listeners using the App's routing methods that correspond to the different types of app interaction. Listeners can be declared as closures, or as objects and class names of type SlackPhp\Framework\Listener. A Listener receives a Context object, which contains the payload data provided by Slack to the app and provides methods for all the actions you can take to interact with or communicate back to Slack.

Quick 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_SIGNING_KEY in the environment (e.g., putenv("SLACK_SIGNING_KEY=foo");)

Example Application

The "Hello World" app says hello to you, by utilizing every type of app interactions, including: slash commands, block actions, block suggestions (i.e., options for menus), shortcuts (both global and message level), modals, events, and the app home page.

"Hello World" app code > Assumptions: > > - You have required the Composer autoloader to enable autoloading of the framework files. > - You have set `SLACK_SIGNING_KEY` in the environment (e.g., `putenv("SLACK_SIGNING_KEY=foo");`) > - You have set `SLACK_BOT_TOKEN` in the environment (e.g., `putenv("SLACK_BOT_TOKEN=bar");`)

Object-Oriented Version

You can alternatively create your App and Listeners as a set of classes. I recommend this approach if you have more than a few listeners or if your listeners are complicated. Here is an example of how the "Hello World" app would look when developed in this way.

"Hello World" app code `App.php` `index.php` > Assumptions: > > - You have required the Composer autoloader to enable autoloading of the framework files. > - You have configured composer.json so that your `MyApp` namespaced code is autoloaded. > - You have set `SLACK_SIGNING_KEY` in the environment (e.g., `putenv("SLACK_SIGNING_KEY=foo");`) > - You have set `SLACK_BOT_TOKEN` in the environment (e.g., `putenv("SLACK_BOT_TOKEN=bar");`)

Handling Requests with the Context Object

The Context object is the main point of interaction between your app and Slack. Here are all the things you can do with the Context:

High Level Design

UML diagram of the framework

YUML Source
[AppServer]<>-runs>[App]
[AppServer]creates->[Context]
[App]<>->[AppConfig]
[App]<>->[Router]
[Router]-^[Listener]
[Router]<>1-*>[Listener]
[Listener]handles->[Context]
[Context]<>->[Payload]
[Context]<>->[AppConfig]
[Context]<>->[_Clients_;RespondClient;ApiClient]
[Context]<>->[_Helpers_;BlockKit;Modals;View]
[Context]<>->[_Metadata_]
[AppConfig]<>->[Logger]
[AppConfig]<>->[Container]
[AppConfig]<>->[_Credentials_]

Socket Mode

Socket mode support is provided by a separate package. See slack-php/slack-php-socket-mode.

Not Implemented

The following features are known to be missing:

Standards Used


All versions of slack-app-framework with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
ext-ctype Version *
ext-json Version *
slack-php/slack-block-kit Version ^0.19.0 || ^1.0.0
nyholm/psr7 Version ^1.3
nyholm/psr7-server Version ^1.0
psr/container Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.0
psr/http-server-handler Version ^1.0
psr/http-server-middleware Version ^1.0
psr/log Version ^1.1
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-app-framework contains the following files

Loading the files please wait ....