jorisdugue / h5p-bundle
适用于 Symfony 5, 6 和 Symfony 7 的 H5P Bundle
2.2.0
2024-04-08 17:31 UTC
Requires
- php: >= 7.2.5
- ext-json: *
- doctrine/doctrine-bundle: ^2.0
- doctrine/orm: ^2.14.1
- guzzlehttp/guzzle: ^7.8
- h5p/h5p-core: 1.26
- h5p/h5p-editor: ^1.25
- symfony/asset: ~5.0|~6.0|~7.0
- symfony/form: ~5.0|~6.0|~7.0
- symfony/framework-bundle: ~5.0|~6.0|~7.0
- symfony/intl: ~5.0|~6.0|~7.0
- symfony/security-bundle: ~5.0|~6.0|~7.0
- symfony/serializer: ~5.0|~6.0|~7.0
- twig/extra-bundle: ^3.0
Requires (Dev)
- phpstan/phpstan: ^1.10
- dev-master
- 2.2.0
- 2.1.0
- v2.0.2
- v2.0.1
- v2.0.0
- v1.9.0
- v1.8.0
- v1.7.4
- v1.7.3
- v1.7.2
- v1.7.1
- v1.7.0
- v1.6.9
- v1.6.8
- v1.6.7
- v1.6.6
- v1.6.5
- v1.6.4
- v1.6.3
- v1.6.2
- v1.6.1
- v1.6.0
- v1.5.0
- v1.4.1
- v1.4.0
- v1.3.1
- v1.3.0
- v1.2.0
- v1.1.0
- v1.0.0
- dev-fix/metadata-error
- dev-feat/h5p-missing-options
- dev-feat/dev-h5p
- dev-testingSF6
This package is auto-updated.
Last update: 2024-09-27 13:54:53 UTC
README
用于将 H5P 集成到 Symfony 的 Bundle。此 Bundle 是 H5P Drupal 模块的移植版本。有关 H5P 的更多信息,请参阅 H5P.org
此 Bundle 已在以下环境中进行测试
- Symfony 4.X
- Symfony 5.X,
- Symfony 6.X,
- Symfony 7.X-dev
先决条件
在运行此安装之前,您需要安装 doctrine annotations 和 orm
composer require orm composer require doctrine/annotations
安装
使用 composer 安装
composer require jorisdugue/h5p-bundle
在 AppKernel.php
中启用 Bundle
return [ // ... \Studit\H5PBundle\StuditH5PBundle::class => ['all' => true] ]
警告:Windows 用户:您需要以管理员身份启动 cmd 或使用 -c
选项
将 H5P 资产添加到 Bundle
php bin/console h5p-bundle:IncludeAssetsCommand php bin/console assets:install --symlink
并重新执行 ...
# For linux and mac only or windows admin php bin/console h5p-bundle:IncludeAssetsCommand # For all without admin perms php bin/console h5p-bundle:IncludeAssetsCommand -c
向数据库中添加所需的表和关系
php bin/console doctrine:schema:update --force
或
php bin/console make:migrations
在 routes.yaml
中启用路由
studit_h5p.demo: resource: "@StuditH5PBundle/Resources/config/routing_demo.yml" prefix: / studit_h5p: resource: "@StuditH5PBundle/Resources/config/routes.yaml" prefix: /
studit_h5p.demo 是可选的。它可以作为在 Symfony 中使用 H5P 的示例以及测试此 Bundle 是否正常工作的方法。
配置
对于 SF4:在 services.yaml
中配置 Bundle。(注意 h5 和 p 之间的下划线)
parameters: studit_h5_p: use_permission: true # This is false by default to let the demo work out of the box. storage_dir: / # Location to store all H5P libraries and files web_dir: public # Location of the public web directory export: 3 #for all embed: 3 #for all
对于 Symfony 5:在 packages > h5pBundle.yml
中配置 Bundle。
studit_h5_p: use_permission: true # This is false by default to let the demo work out of the box. storage_dir: / # Location to store all H5P libraries and files web_dir: public # Location of the public web directory export: 3 #for all embed: 3 #for all
有关所有配置信息,请参阅 Configuration.php
如果您使用权限,以下是 Bundle 中的当前权限列表
用法
首先添加一个指向您项目的虚拟主机。然后在浏览器中转到 http://<your virtualhost>/h5p/list
待办事项
正在工作
- 存储使用数据(仅当用户登录时)
- 下载 H5P
- 上传 H5P
- 更新 / 安装 H5P 库
- 存储使用数据和积分
并非所有内容都已移植。以下事项还需要完成
- 上传库。目前只能从 Hub 中选择 H5P 默认库。需要自定义 h5p 进行测试。
变更日志
- 使用带 restrict 标签的开发版本以防止破坏性变更
- 实现缺失的道路并解决 H5P-editor 的兼容性问题
- 修复错误并更新 README
- 修复许多错误 ... 并更新到 SF5 :)
- 修复缺少链接图片的错误
- 修复下载包
- 存储使用数据和积分
开发中
像这样运行静态分析器
php -d memory_limit=-1 vendor/bin/phpstan.phar analyze .