chiron / app
Chiron 应用示例
2.0.21
2022-06-06 17:39 UTC
Requires
- php: ^8.0 || ^8.1
- chiron/chiron: ^3.9
- chiron/debug: ^1.0
- chiron/fastroute-bridge: ^1.0
- chiron/logger: ^0.2
- chiron/response-creator: ^1.0
- chiron/sapi: ^1.0
- chiron/translator: ^1.0
- chiron/view: ^1.0
- chiron/webserver: ^1.0
- nyholm/psr7: ^1.5
- vlucas/phpdotenv: ^5.0
Requires (Dev)
- chiron/devtools: ^1.0
- chiron/testing: ^1.0
This package is auto-updated.
Last update: 2024-09-14 02:50:27 UTC
README
[Chiron 框架] 是一个轻量级框架,旨在让开发者能够快速启动新的控制台或 Web 应用程序。
此存储库包含一个应用骨架,旨在展示 Chiron 的基本功能。构建精彩项目的第一步!
要求
确保您的 Web 服务器已配置以下 PHP 版本和扩展
- PHP >= 7.2
- intl PHP 扩展
- mbstring PHP 扩展
安装
如果您没有 Composer,您可以通过 getcomposer.org 上的说明进行安装。
然后,您可以使用以下命令安装此项目模板
$ composer create-project chiron/app [my-app-name]
将 [my-app-name] 替换为您新应用程序所需的目录名称。
克隆
本节仅适用于您使用
git clone
克隆了此存储库,而不是使用composer create-project ...
安装时。
确保在克隆此存储库后正确配置您的应用程序项目。
$ composer install # Install the projet composer dependencies $ bin/chiron dotenv:copy -d .env # Create the .env file at the root path $ bin/chiron dotenv:key -m .env # Update the security key in .env file $ bin/chiron package:discover # Auto-discover the module bootloaders
Web 服务器
您可以使用开发 Web 服务器快速测试您的应用程序。
$ php -S localhost:8000 -t public/
或
$ bin/chiron serve
现在您应该可以通过控制台打印的 URL 访问应用程序。
目录结构
应用程序模板具有以下结构
config/ #Configuration files. docs/ #Documentation. public/ #Files publically accessible from the Internet. assets/ #Published assets. index.php #Entry script. resources/ #Application resources. assets/ #Asset bundle resources. layout/ #Layout view templates. view/ #View templates. runtime/ #Files generated during runtime. src/ #Application source code. Asset/ #Asset bundle definitions. Controller/ #Web controller classes. Provider/ #Providers that take configuration and configure services. tests/ #A set of Codeception tests for the application. vendor/ #Installed Composer packages.
测试
要测试一个应用程序
$ ./vendor/bin/phpunit
或
$ composer phpunit
许可
此软件包是开源软件,根据 MIT 许可 许可。