windomz/lottery-engine

A lottery component engine - modularity and easy to deploy.

v0.5.0 2017-06-30 06:19 UTC

This package is not auto-updated.

Last update: 2024-04-25 05:48:24 UTC


README

A lottery component engine - modularity and easy to deploy.

Latest Stable Version Build Status Minimum PHP Version Minimum MYSQL Version Platform

中文文档

Feature

  • Play - How to play
  • Rule - The rule of playing
  • Reward - Play rewards
  • Record - Play records

Install

Open the terminal in the project directory:

$ composer require windomz/lottery-engine

Create a configuration file, like config.yml:

database_host: 127.0.0.1
database_port: 3306
database_type: mysql
database_name: lotterydb
database_username: root
database_password: root
database_charset: utf8
database_logging: false
database_json: true # If the database supports JSON.

If only for quick testing, you can run ./sql/lotterydb.sql in MySQL to quickly create a test database.

Of course, you can also customize the database name based on ./sql/lotterydb.sql, but note that the table name CANNOT MODIFY!

In the project initialization, load the specified configuration file through the following implementation:

Lottery::setConfigPath('./config.yml');

Usage

Refer to the Document(Currently only Chinese) for details.

Limitation

There is no memory cache system, such as Memcached, Redis, but through shmop functions to share memory operations, this brings some performance bottlenecks, if necessary, can fork and rewrite \LotteryEngine\Model\Cache class to access.

License

The MIT License