Giter VIP home page Giter VIP logo

gameanalytics-php's Introduction

GameAnalytics

PHP wrapper for the GameAnalytics REST API.

Build Status Scrutinizer Code Quality Code Coverage

Installation

Using Composer, add the package to your require section.

{
	"require": {
		"maartenstaa/gameanalytics-php": "~2"
	}
}

This package requires you to select an HTTP client to be used. For more information, read the documentation.

Usage

First, create a client using the game key and associated secret key. The third parameter is the HTTP client you want to use. If you do not provide it, the package will try to auto-detect which one is available. The fourth and final parameter is the HTTP message factory you wish to use. Again, if you do not provide it, the package will try to auto-detect which is available.

use MaartenStaa\GameAnalytics\Client;

$client = new Client($gameKey, $secretKey);

Next, you can use the "init" and "event" functions on the client to get a message instance. Use the set() function to configure the required parameters (refer to the official documentation) and use send() to send the message. You will receive a PSR-7 response object.

$client->init()->set(array(...))->send();

$message = $client->event('user');
$message->set('foo', 'bar')
	->set('baz', 'bax')
	->send();

Contributing

Coding standard

All code is to follow the PSR-2 coding standard.

Unit tests

If you find a bug, feel free to send a pull request to fix it, but make sure to always include a regression test.

gameanalytics-php's People

Watchers

 avatar  avatar  avatar

Forkers

fanzorena

gameanalytics-php's Issues

I want to install it but get this error

The "fxp/composer-asset-plugin" plugin requires composer-plugin-api 1.0.0, this
WILL break in the future and it should be fixed ASAP (require ^1.0 for example
).
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- The requested package php-http/adapter-implementation could not be found i
n any version, there may be a typo in the package name.
Problem 2
- php-http/discovery v0.6.4 requires puli/composer-plugin ~1.0.0-beta8 -> no
matching package found.
- php-http/discovery v0.6.3 requires puli/composer-plugin ~1.0.0-beta8 -> no
matching package found.
- php-http/discovery v0.6.2 requires puli/composer-plugin ~1.0.0-beta8 -> no
matching package found.
- php-http/discovery v0.6.1 requires puli/composer-plugin ~1.0.0-beta8 -> no
matching package found.
- php-http/discovery v0.6.0 requires puli/composer-plugin 1.0.0-beta8 -> no
matching package found.
- Installation request for php-http/discovery ^0.6 -> satisfiable by php-htt
p/discovery[v0.6.0, v0.6.1, v0.6.2, v0.6.3, v0.6.4].

I installed the guzzle6-adapter also but it installed from its command of
composer require php-http/guzzle6-adapter
but on this folder I cannot install gameanalytics-php from adding your package in composer.json or can you guide how we can use it on yii or independently.

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.