Download the PHP package capirussa/pushover-php without Composer

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

Pushover PHP client

Build Status Coverage Status

This simple PHP client uses the Pushover REST API to send push notifications to mobile devices. For more information about Pushover, see http://pushover.net

Usage

Pushover\Client

You need to supply your application's token when initializing the Pushover\Client. You can find this token in your online dashboard when you log in to Pushover.

On some servers, usually localhost development servers, you might encounter SSL errors. To skip the SSL validation, call $client->disableSslVerification().

To set or retrieve the application token, you can call $client->setToken() or $client->getToken(). To completely reset the Client, including the SSL verification flag, you can also call $client->init() with an application token.

To send a push notification to a specific user or group, call $client->send() with a Pushover\Message object as parameter. This method will return null by default, however, for messages with the PRIORITY_EMERGENCY priority, it will return the message receipt token. You can use this token to poll the Pushover API and check whether the message has been acknowledged.

To verify with the Pushover server whether a given user or group is valid, call $client->validate() with a Pushover\Validate object as parameter.

To check whether a message you sent with the Emergency priority has been acknowledged, has expired or whether the callback URL has been requested, call $client->pollReceipt() with a Pushover\Receipt object as parameter.

Finally, you can retrieve a list of all devices for a user by calling $client->getUserDevices() with a user token as parameter.

Pushover\Message

To send a push notification via Pushover, you need to supply the Client with a Message object. The message has the following properties (all can be set using their respective getters):

It is possible to initialize the Pushover\Message object with a recipient and message, as in the Usage example above. This is optional, you can also set these properties using their setters:

Pushover\Receipt

The Receipt object must be supplied to the Client to poll whether a Message with PRIORITY_EMERGENCY has been acknowledged or has expired, and whether the callback URL has been called.

The Receipt object only has one property:

The receipt token can be set either when initializing the object, or using the setter.

The receipt token must be a 30-character alphanumeric string.

Pushover\Validate

To validate whether a user or group token is valid, optionally while also validating whether a specific device belongs to the given user, you must supply the Client with a Validate object. This object has the following properties:

Pushover\Response

Ordinarily, you never see the response. However, when you're polling the Pushover API the check whether an emergency message has been acknowledged, you might be interested in various properties. I could have chosen to return an array with all relevant properties, but I've chosen instead to simply return the Response object and allow you to retrieve whatever data you want. The Reponse object has the following properties:

So that's great, but how do I put this all together?

Here are a few examples. Let's assume an application token of '123apptoken' and a user token of 'usertoken123'. These are obviously invalid but this is, after all, just an example.

Note that if you copy/paste this code directly and run it, you'll flood the Pushover API with a lot of requests in a fraction of a second. They don't like that, so you shouldn't do that. Keep their friendliness rules in mind when you use these classes.

If you find any bugs in it, please raise an issue on Github or fork this project and create a pull request.

Happy coding!


All versions of pushover-php with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.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 capirussa/pushover-php contains the following files

Loading the files please wait ....