chillem / nucleus
游戏核心
Requires
- php: ^7.2
- adrianfalleiro/slim-cli-runner: ^2.4
- akrabat/ip-address-middleware: ^1.0
- chillem/dbug: dev-master
- dopesong/slim-whoops: ^2.2
- firebase/php-jwt: ^5.0
- guzzlehttp/guzzle: ^6.3
- illuminate/database: ^5.5
- league/climate: ^3.2
- league/event: ^2.1
- monolog/monolog: ^1.17
- pelago/emogrifier: ^2.0
- ramsey/uuid: ^3.7
- respect/validation: ^1.1
- robmorgan/phinx: ^0.9.2
- slim/csrf: ^0.8.2
- slim/flash: ^0.4.0
- slim/slim: 3.*@dev
- slim/twig-view: ^2.3
- swiftmailer/swiftmailer: ^6.0
- tuupola/slim-jwt-auth: ^2.3
- vlucas/phpdotenv: ^2.4.0
Requires (Dev)
This package is not auto-updated.
Last update: 2024-09-26 00:25:27 UTC
README
基于Slim的PHP应用程序脚手架。
这不仅仅是一个框架,因此使用了“脚手架”这个词。Nucleus是一个功能齐全的即用型Web应用程序。您需要做的只是构建您的环境,在config/.env中定义值,运行数据库迁移和数据种子,然后您的应用程序就准备好了!
以下是主要组件和相关文档
- Slim(框架)https://slim.php.ac.cn/
- Twig(模板)https://twig.symfony.com.cn/
- Phinx(数据库迁移)https://phinx.org/
- Eloquent(ORM)https://laravel.net.cn/docs/5.5/eloquent
- Monolog(日志)https://github.com/Seldaek/monolog
- Respect Validation(验证)https://github.com/Respect/Validation
- Whoops(错误报告)https://github.com/filp/whoops
- League\Event(事件发射器)http://event.thephpleague.com/2.0/
- League\CLImate(CLI输出格式化)http://climate.thephpleague.com/
- Swiftmailer(电子邮件)https://swiftmailer.symfony.com/
要求
- PHP >= 7.1
- Composer
- NPM
- MariaDB 10.1.30或等效版本
安装
php composer create-project chillem/nucleus [your-directory-name]
该命令将在新目录中创建Nucleus的副本。接下来,您需要将虚拟主机指向public目录,并确保logs可由您的Web服务器用户写入。
获取所需的NPM模块
npm install
将config/env.dist复制到config/.env,并使用所有所需的配置值编辑该文件。
接下来,运行初始数据库迁移以创建模式和填充一些初始数据
php vendor/bin/phinx migrate -e development
如果您想插入我最初使用的数据(一些用户和角色关联),请运行以下命令
php vendor/bin/phinx seed:run -s GlobalSettings
php vendor/bin/phinx seed:run -s Users
php vendor/bin/phinx seed:run -s Roles
php vendor/bin/phinx seed:run -s RoleUser
使用CLU实用程序部署默认模板
bin/nucleate build
最后,更新composer.json以反映您的应用程序详情。
CLI实用程序
v1.0.1-beta引入了一个新的半实验性功能——CLI命令运行器。第一个功能提供者是包装其他包提供的CLI脚本。
运行Phinx命令
bin/nucleate db migrate -e development
运行PHPUnit
bin/nucleate test
运行PHPCS
bin/nucleate cs -n --standard=PSR1,PSR2 src/
bin/nucleate csfix -n --standard=PSR1,PSR2 src/
其他所有内容都将直接传递给命令运行器。命令定义在src/Helpers/Commands中,并扩展了BaseCommand类。
有关命令的更多信息,请参阅此处:https://github.com/adrianfalleiro/slim-cli-runner(注意:为了保持一致性,我选择了“命令”而不是“任务”这个术语。)