windomz / lottery-engine
A lottery component engine - modularity and easy to deploy.
Requires
- php: >=7.0
- catfan/medoo: ^1.4
- hassankhan/config: ^0.10.0
- malkusch/lock: ^1.0
- ramsey/uuid: ^3.6
- symfony/yaml: ^3.3
- windomz/shmcache: *
Requires (Dev)
- jakub-onderka/php-console-highlighter: ^0.3.2
- jakub-onderka/php-parallel-lint: ^0.9.2
- phpunit/phpunit: ^6.2
README
A lottery component engine - modularity and easy to deploy.
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 throughshmop
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