atsmacode/card-games
最新稳定版本:v2.0.12
Composer 安装命令:
composer create-project atsmacode/card-games
包简介
Base package to support any type of card based game
README 文档
README
This package contains resources that can in theory be used to build any traditional 52 deck card game.
It consists of:
- A migration to insert Cards, Ranks and Suits into a database
- Card constants with IDs mapped to the database rows to assist writing unit tests and logic
- A Dealer class based on the constants to shuffle and deal cards and hold a Deck array
Environment
PHP
8.1.3
MySQL
8.0.13
Commands
Linux
Run the unit test suite:
dev/phpunit
Drop, Create and Seed all tables. '-d true' is required to run this in test DB:
php dev/CardGamesApp.php app:build-card-games -d true
Windows
Run the unit test suite:
.\dev\runtests.bat
Drop, Create and Seed all tables. '-d true' is required to run this in test DB
php .\dev\CardGamesApp.php app:build-card-games -d true
Configs
You need to add card_games.php to configure your local DB credentials, like so:
<?php
return [
'card_games' => [
'db' => [
'live' => [
'servername' => 'localhost',
'username' => 'DB_USER',
'password' => 'DB_PASSWORD',
'database' => 'card_games',
'driver' => 'pdo_mysql',
],
'test' => [
'servername' => 'localhost',
'username' => 'DB_USER',
'password' => 'DB_PASSWORD',
'database' => 'card_games_test',
'driver' => 'pdo_mysql',
],
],
],
];
统计信息
- 总下载量: 136
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2022-11-27