siler/app

运行一条命令即可设置现代 Siler 应用程序。

v1.1.2 2020-09-29 00:07 UTC

This package is auto-updated.

Last update: 2024-09-10 16:54:11 UTC


README

🧱 通过运行一条命令来设置现代 Siler 应用程序。

composer create-project siler/app my-app

脚本

composer start

运行 CLI SAPI 内置的 Web 服务器,端口为 8080。

composer swoole

运行 Swoole Web 服务器,端口为 9501。

docker-compose up

使用 DockerDwoole 运行 Docker,端口同样为 9501。

开发工具

它使用 ramsey/devtoolsPest 来覆盖 test:unit

analyze
  analyze:phpstan      Runs the PHPStan static analyzer.
  analyze:psalm        Runs the Psalm static analyzer.

build
  build:clean          Removes everything from the build directory that is not under version control.
  build:clear-cache    Removes everything from build/cache that is not under version control.

lint
  lint:fix             Checks source code for coding standards issues and fixes them, if possible.

test
  test:all             Runs linting, static analysis, and unit tests.
  test:coverage:ci     Runs the unit test suite and generates a Clover coverage report.
  test:coverage:html   Runs the unit test suite and generates an HTML coverage report.
  test:unit            Runs the unit test suite.

如何使用

bootstrap.php

是启动应用程序的好地方,比如数据库连接、依赖注入容器、设置等。

index.php

在每次请求时都会调用,是放置路由和依赖于当前请求的东西的好地方。