Download the PHP package dmanetwork/slack without Composer

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

dmanetwork/slack

Small connection to Slack (slack.com) for sending messages to channels via their API.

Install

Use Composer.

Simple Usage

Define your Slack options early on with the rest of your application configuration. The only option you MUST specify is the API access token, which you can generate from http://api.slack.com while you are logged in there.

Nether\Option::Set('slack-token','YOUR-SLACK-TOKEN');

Create an instance of the client to interact with the Slack API.

$slack = new DMA\Slack\Client;

Then you can send messages.

$slack->Send('Hello from our Slack enabled app.');

If you do not change any of the other options you should see a message from Optimus Prime in your #general channel.

Advanced Usage

More options at app config time...

These are all the options available to set at application config time.

Nether\Option::Set([
    'slack-token' => 'YOUR-SLACK-TOKEN',
    'slack-default-channel' => '#channel',
    'slack-default-name' => 'bot name of choice',
    'slack-default-icon' => 'url to public accessable image for chat icon',
    'slack-channels' => [ 'action-name' => 'channel', ... ]
]);

More options at instance time (overwrites prev options)...

These are all the options available to set at instance create time.

$slack = new DMA\Slack\Client([
    'DefaultChannel' => '#channel',
    'DefaultName' => 'bot name of choice',
    'DefaultIcon' => 'url to icon',
    'Token' => 'YOUR-SLACK-TOKEN'
]);

More options at message send time...

And these are all the options available to set at message send time.

$slack->Send('message here',[
    'Channel' => '#DifferentChannel',
    'Name' => 'Different Bot Name',
    'Icon' => 'url to different icon'
]);

If all you want to do is send to a different channel or user than the default.

$slack->SendToChannel($chan,$msg);

Or send to a different channel as specified by any actions configured.

// send user-add action notifications to the team.
$slack->SendToChannel('--user-add',$msg);

Sending an API request we have not wrapped...

$slack->SendRequest(string method, array args);

The method name is the final part of the API url specified in the Slack documentation. The argument array then would be an associative array where the keys are the names of the parameters as Slack says, with the values you want to send.

Copyright

This software is Copyright (c) 2014 Dream Machine Association, LLC. See the bundled LICENSE file (BSD-2-Clause) for more information.


All versions of slack with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
netherphp/object Version ^2.0.0
netherphp/option Version ^1.0.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 dmanetwork/slack contains the following files

Loading the files please wait ....