https://github.com/windomz/lottery-engine
A lottery(抽奖) component engine - modularity and easy to deploy.
https://github.com/windomz/lottery-engine
component lottery-engine module php7
Last synced: 8 months ago
JSON representation
A lottery(抽奖) component engine - modularity and easy to deploy.
- Host: GitHub
- URL: https://github.com/windomz/lottery-engine
- Owner: WindomZ
- License: mit
- Created: 2017-06-09T10:05:31.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-03T10:00:32.000Z (almost 9 years ago)
- Last Synced: 2025-08-05T22:12:21.360Z (11 months ago)
- Topics: component, lottery-engine, module, php7
- Language: PHP
- Homepage: https://windomz.github.io/lottery-engine/
- Size: 120 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lottery-engine
> A lottery component engine - modularity and easy to deploy.
[](https://packagist.org/packages/windomz/lottery-engine)
[](https://travis-ci.org/WindomZ/lottery-engine)
[](https://php.net/)
[](https://www.mysql.com/)
[](#readme)
[中文文档](https://github.com/WindomZ/lottery-engine/blob/master/README_Ch-zh.md#readme)
## Feature
- [x] Play - How to play
- [x] Rule - The rule of playing
- [x] Reward - Play rewards
- [x] Record - Play records
## Install
Open the terminal in the project directory:
```bash
$ composer require windomz/lottery-engine
```
Create a configuration file, like `config.yml`:
```yaml
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:
```php
Lottery::setConfigPath('./config.yml');
```
## Usage
Refer to the [Document](https://windomz.github.io/lottery-engine)(_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](https://github.com/WindomZ/lottery-engine/blob/master/LICENSE)