Download the PHP package elcodedocle/gplusraffle without Composer

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

gplusraffle by elcodedocle

A Google OAuth 2.0 and FusionTables PHP API client based raffle manager

Copyright (C) 2014 Gael Abadin
License: MIT Expat
Version: 0.1.4-beta
Build Status
Code Climate

Test site snapshot

(De)Motivation

Doing an in-site "manual" raffle may be way easier, but doing it online is waaay cooler! (for nerds like me :-))

(Also, I needed to get to know better the latest google PHP client API: What better way than doing a simple and cool app? ;-))

This is a proof of concept app, which means it works fine but it lacks anything else but a rough basic functionality, although it should be easily extensible.

Anyway, the main thing I've learned from developing this project is that Fusion Tables is not at all a valid replacement for even the most modest DB needs. This project might as well have been called "A study on how and why Fusion Tables Suck":

In a nutshell, Fusion Tables may be nice to store slowly changing map data and things like that, but if you want to get some simple and yet powerful and scalable Cloud DB service I suggest you try AWS or Google Cloud SQL or something like that instead of Fusion Tables. I'll be the last one encouraging anybody to make serious use of this project without replacing the DAOs first to use any other service, at the very least. (I intend to do so myself if I ever release an update beyond patching the bugs I will find on this version)

Requirements

(So, basically, any updated default LAMP stack, even without the M)

Installation

This assumes you have already created a google app and the required oAuth 2.0 credentials and activated the Fusion Tables API on console.developers.google.com. If you have trouble with that process, check out this tutorial.

Using composer:

Without composer:

Set up:

This will set the google account offline token the app will use to manage the Fusion Tables.

You don't need to use the same google account you used for creating the app on the developers console: You may even create a new google account just to keep the app's tables if you want.

The offline token, stored in adminConfig.php, will only give the app offline access to the Fusion Tables managing and basic profile info of that account (to retrieve the account id).

Users are only required basic profile info access (for the userid).

For your users' safety and your own I suggest using SSL on the server. And, since I am at the moment too lazy and cheap to follow my own advice on the demo site I've set up, if you are concerned about what somebody could do with access to your account's basic profile info I urge you not to use it on a public/open non encrypted connection.

How to use

The web app, /webapp, provides an HTML5 client interface to handle requests and present JSON responses required to manage and participate on raffles.

If you want to toy around with the API (maybe even implement a slicker client ;-)), these are the HTTP request actions available (all responses are JSON encoded, with resposne column names array and rows array contained on columns and rows fields of the data response field):

/admin/login - logs the user with admin scopes (FusionTables handling, basic profile access).

/admin/install - sets the current admin google account id and a new token to handle fusion tables operations.

/admin/uninstall - removes the current admin google account id and token (the fusion tables will remain stored on the account, but new ones will be created on reinstall).

/, /user/login - logs in the user (html output with authUrl link), redirects to /webapp on success if a web session has been opened (by visiting /webapp).

/user/logout - logs out the user (an auto logout is performed when the session expires, in which case a 401 error code is issued instead of the requested response).

/raffle/create/description - creates a raffle, returning its id, description, creator (you), date of creation (now), privacy (public) and status (closed).

/raffle/delete/raffleid - deletes raffleid (only the user who created it can do this. WARNING: All data will be lost, and no confirmation is required!).

/raffle/list, /raffle/list/all - lists (public) raffles (id, description, creator, status and date of creation).

/raffle/list/me or /raffle/list/user/joined/me - lists raffles the current user has joined (admin can list raffles joined by any userid).

/raffle/list/mine or /raffle/list/user/created/me - lists raffles the current user has created (admin can list raffles created by any userid).

/raffle/list/raffle/raffleid - lists raffle's participants (and winner, if raffled). Any raffle, public or private, can be listed, and any user can join or leave a raffle while it's open by only knowing its id. Only creator and admin have managing rights.

/raffle/list/open - lists raffles (id, description, creator, status and date of creation)

/raffle/list/closed - lists closed raffles

/raffle/list/raffled - lists raffled raffles

/raffle/open/raffleid - opens the raffle, so users can join it

/raffle/close/raffleid - closes the raffle. No more users will be allowed to join it, unless it's reopened.

/raffle/raffleid/limit - raffles raffleid (only the user who created the raffle can do this, and the raffle must be closed and have more than 0 participants. It picks min(participants,limit) winners or returns the winner(s) if the raffle has already been raffled).

/raffle/join/raffleid - user joins raffleid (the raffle must be opened).

/raffle/leave/raffleid - user joins raffleid (the raffle must be opened).

/raffle/check/raffleid - check who won the raffle (the raffle must be raffled).

Regarding the DB schema, it's actually the simplest possible:

(All dates are stored in UTC, reformatted to the local timezone in the web app client)

If you are into developing there are some phpunit tests you can perform:

(If you are a developer and find a bug not cached by the tests and want to help me fix it, opening an issue by pull requesting a non passing test would be swell :-))

TODO:

Acks

The Google team.

The twitter bootstrap team (bootstrap).

Allan Jardine, the developer behind datatables.

Mathias Rohnstock, the developer behind tabletools.

Andrew Moore, the developer behind the uuid class.

Felix Gnass, the developer behind spin.js.

Pablo Cantero, the developer behind jquery-dateFormat

Enjoy!

(

And, if you're happy with this product, donate!

bitcoin: 13qZDBXVtUa3wBY99E7yQXBRGDMKpDmyxa

dogecoin: D8ZE9piiaj3aMZeToqyBmUMctDMfmErJCd

paypal: http://goo.gl/ql69W2

)


All versions of gplusraffle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
google/apiclient Version 1.0.4-beta
elcodedocle/uuid Version >=1.0.0
datatables/datatables Version >=1.9.4
drmonty/datatables-tabletools Version >=2.1.5
twbs/bootstrap Version >=3.0.0
phstc/jquery-dateformat 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 elcodedocle/gplusraffle contains the following files

Loading the files please wait ....