el7cosmos / drupal-runtime
Drupal 与 Symfony Runtime 集成
2.1.0
2024-08-11 08:02 UTC
Requires
- php: >=8.1.0
- drupal/core: ^10.3 || ^11.0
- symfony/runtime: ^6.4 || ^7.1
README
将 Drupal 与 Symfony Runtime 集成。
Runtime 组件将引导逻辑与任何全局状态分离,以确保应用程序可以在 PHP-FPM、ReactPHP、Swoole 等运行时环境中运行,无需任何更改。
安装
如果使用 composer>=2.2
composer config allow-plugins.symfony/runtime 1
添加 drupal 模板配置
composer config --json --merge extra.drupal-scaffold.allowed-packages '["el7cosmos/drupal-runtime"]'
添加 symfony 运行时模板
composer config extra.runtime.autoload_template vendor/el7cosmos/drupal-runtime/assets/autoload_runtime.template
需要此包
composer require el7cosmos/drupal-runtime
您的 composer.json 应该像这样
{
"config": {
"allow-plugins": {
"symfony/runtime": true
}
},
"extra": {
"drupal-scaffold": {
"allowed-packages": [
"el7cosmos/drupal-runtime"
]
},
"runtime": {
"autoload_template": "vendor/el7cosmos/drupal-runtime/assets/autoload_runtime.template"
}
}
}
您也可以手动编辑 composer.json 以匹配上面的示例。
用法
Composer 会自动生成以下文件以使用 Symfony Runtime
[web-root]/index.php[web-root]/update.php