Git Product home page Git Product logo

push-php's Introduction

AuthBucket\Push

Build Status Coverage Status Dependency Status Latest Stable Version Total Downloads License

The primary goal of AuthBucket\Push is to develop a library for sending out push notifications to mobile devices; secondary goal would be develop corresponding wrapper Symfony2 Bundle and Drupal module.

This library bundle with a Silex based AuthBucketPushServiceProvider for unit test and demo purpose. Installation and usage can refer as below.

Installation

Simply add a dependency on authbucket/push-php to your project's composer.json file if you use Composer to manage the dependencies of your project.

Here is a minimal example of a composer.json:

{
    "require": {
            "authbucket/push-php": "~3.0"
    }
}

Parameters

The bundled AuthBucketPushServiceProvider come with following parameters:

  • authbucket_push.model: (Optional) Override this with your own model classes, default with in-memory AccessToken for using resource firewall with remote debug endpoint.
  • authbucket_push.model_manager.factory: (Optional) Override this with your backend model managers, e.g. Doctrine ORM EntityRepository, default with in-memory implementation for using resource firewall with remote debug endpoint.

Services

The bundled AuthBucketPushServiceProvider come with following services controller which simplify the Push controller implementation overhead:

  • authbucket_push.push_controller: Push endpoint controller.

Registering

If you are using Silex, register AuthBucketPushServiceProvider as below:

$app->register(new AuthBucket\Push\Provider\AuthBucketPushServiceProvider());

Moreover, enable following service providers if that's not already the case:

$app->register(new AuthBucket\OAuth2\Provider\AuthBucketOAuth2ServiceProvider());
$app->register(new Silex\Provider\MonologServiceProvider());
$app->register(new Silex\Provider\SecurityServiceProvider());
$app->register(new Silex\Provider\ValidatorServiceProvider());

Demo

The demo is based on Silex and AuthBucketPushServiceProvider. Read though Demo for more information.

You may also run the demo locally. Open a console and execute the following command to install the latest version in the push-php directory:

$ composer create-project authbucket/push-php authbucket/push-php "~1.0"

Then use the PHP built-in web server to run the demo application:

$ cd authbucket/push-php
$ ./app/console server:run

If you get the error There are no commands defined in the "server" namespace., then you are probably using PHP 5.3. That's ok! But the built-in web server is only available for PHP 5.4.0 or higher. If you have an older version of PHP or if you prefer a traditional web server such as Apache or Nginx, read the Configuring a web server article.

Open your browser and access the http://127.0.0.1:8000 URL to see the Welcome page of demo application.

Also access http://127.0.0.1:8000/admin/refresh_database to initialize the bundled SQLite database with user account admin:secrete.

Documentation

Push's documentation is built with Sami and publicly hosted on GitHub Pages.

To built the documents locally, execute the following command:

$ composer sami

Open build/sami/index.html with your browser for the documents.

Tests

This project is coverage with PHPUnit test cases; CI result can be found from Travis CI; code coverage report can be found from Coveralls.

To run the test suite locally, execute the following command:

$ composer phpunit

Open build/logs/html with your browser for the coverage report.

References

License

push-php's People

Contributors

hswong3i avatar

Stargazers

Arnaud Ligny avatar Thomas Citharel avatar  avatar Leonardo Ruhland avatar Dani Prados avatar Yanko Simeonoff avatar Keith Pickett avatar David C. Campbell avatar

Watchers

 avatar James Cloos avatar  avatar Francis Yan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.