herbie
立即创建小但功能齐全的网站或博客,很少努力?
herbie是一个简单,现代,快速且高度可定制的平面文件管理系统(CMS),由PHP,TWIG,MARKDOWN,TEXTIE,COMPLUCTUREDTEXT和其他人类可读的文本文件提供动力。
特色
herbie由经过验证的图书馆提供动力:
多亏了其插件系统, herbie才能高度定制,并为:
- 申请和路线中间Wares
- 活动听众
- 树枝过滤器,树枝全球,树枝功能和树枝测试
- 符号控制台命令
herbie实施以下PHP标准建议:
- PSR-1基本编码标准
- PSR-3记录器接口
- PSR-4自动加载标准
- PSR-7 HTTP消息接口
- PSR-11容器接口
- PSR-12扩展编码样式
- PSR-14事件调度员
- PSR-15 HTTP处理程序
- PSR-16简单缓存
- PSR-17 HTTP工厂
herbie经过了很好的考验:
- 单位,集成和接受测试
- 使用phpstan的静态代码分析
- 使用PHP编码标准固定器修复代码修复程序
支持的PHP版本
8.0 / 8.1 / 8.2 / 8.3
安装
机器上有PHP和作曲家
安装herbie最简单方法是通过作曲家。在您的终端中运行以下命令以创建一个新项目并安装所有相关库。
composer create-project get herbie /start-website mywebsite
更改为mywebsite/web目录。
cd mywebsite/web
启动内置网络服务器。
php -S localhost:8888 index.php
打开http:// localhost:8888使用浏览器。您应该查看第一个herbie网站。
与Docker和Docker一起在您的机器上撰写
创建网站并安装依赖项。
docker run --rm -v $PWD:/app composer create-project --ignore-platform-reqs get herbie /start-website mywebsite
更改为mywebsite目录并启动网站。
cd mywebsite
docker compose up website
打开http:// localhost:8888使用浏览器。
发展环境
如果您需要开发环境,则可以遵循以下步骤。
机器上有PHP和作曲家
克隆github存储库。
git clone https://*githu*b*.com/getherbie/ herbie .git
更改为herbie目录。
cd herbie
安装作曲家依赖项。
composer install
更改为website/web目录。
cd website/web/
启动PHP的内部Web服务器。
php -S localhost:8888 index.php
打开localhost:8888使用您喜欢的Web浏览器。
如果您想拥有其他控制台输出或记录信息,请设置调试环境变量。
herbie _DEBUG=1 php -S localhost:8888 index.php
如果要使用Xdebug(3.x),请按以下方式启动内部Web服务器。提示:为此,必须安装Xdebug。
XDEBUG_MODE=debug php -S localhost:8888 index.php
与Docker和Docker一起在您的机器上撰写
克隆github存储库。
git clone https://*githu*b*.com/getherbie/ herbie .git
更改为herbie目录。
cd herbie
启动PHP的内置Web服务器并启动网站。
docker compose up website
打开localhost:8888使用您喜欢的Web浏览器。
其他Docker组合命令是
# install Composer dependencies
docker compose run install
# run test suite
docker compose run test
# start test suite website
docker compose up test-website
# run bash terminal
docker compose run bash
您可以使用不同的PHP版本。
PHP_VERSION=8.0 docker compose up website
PHP_VERSION=8.1 docker compose up website
PHP_VERSION=8.2 docker compose up website
PHP_VERSION=8.3 docker compose up website
测试
机器上有php
# run tests
php vendor/bin/codecept run
# run unit tests
php vendor/bin/codecept run unit
# run integration tests
php vendor/bin/codecept run integration
# run acceptance tests
php vendor/bin/codecept run acceptance
# run tests with Code Coverage
XDEBUG_MODE=coverage php vendor/bin/codecept run --coverage --coverage-xml --coverage-html
在您的机器上撰写的Docker
打开容器外壳
docker compose run bash
在容器中运行测试
# run tests
php vendor/bin/codecept run
# run unit tests
php vendor/bin/codecept run unit
# run integration tests
php vendor/bin/codecept run integration
# run acceptance tests
php vendor/bin/codecept run acceptance
# run tests with Code Coverage
XDEBUG_MODE=coverage php vendor/bin/codecept run --coverage --coverage-xml --coverage-html
更多信息
有关更多信息,请参见https://herbie.**te*be.ch。
