emmedy/h5p-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

emmedy/h5p-bundle

Composer 安装命令:

composer require emmedy/h5p-bundle

包简介

H5P Bundle for Symfony 5, 6 and Symfony 7

README 文档

README

Bundle to integrate H5P into Symfony. This bundle is a port of the H5P Drupal module. For more info about H5P see H5P.org

This bundle was tested on :

  • Symfony 4.X
  • Symfony 5.X,
  • Symfony 6.X,
  • Symfony 7.X-dev
Version Supported Symfony 3 Symfony 4 Symfony 5 Symfony 6 Symfony 7
3.X
2.X
1.X H5PBundle for Symfony 2.X and 3.X

Prerequisite

You need install orm before running this installation

composer require orm

Installation

Install with composer

composer require emmedy/h5p-bundle

Enable the bundle in AppKernel.php

return [
// ...
    \Emmedy\H5PBundle\EmmedyH5PBundle::class => ['all' => true]
]

Warning for Windows : You need launch the cmd in administrator or using option -c

Add the H5P assets to the bundle

php bin/console h5p-bundle:IncludeAssetsCommand
php bin/console assets:install --symlink

and reexecute ...

# 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

Add required tables and relations to the database

php bin/console doctrine:schema:update --force 

or

php bin/console make:migrations

Enable the routing in routes.yaml

emmedy_h5p.demo:
    resource: "@EmmedyH5PBundle/Resources/config/routing_demo.yml"
    prefix:   /

emmedy_h5p:
    resource: "@EmmedyH5PBundle/Resources/config/routes.yaml"
    prefix:   /

emmedy_h5p.demo is optional. It can be used as an example how to use H5P within Symfony and test if this bundle is working properly.

Configuration

For SF4: Configure the bundle in services.yaml. (Watch for the underscore between h5 and p)

parameters:
    emmedy_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

For Symfony 5: Configure the bundle in packages > h5pBundle.yml.

emmedy_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

For all configurations see Configuration.php

if you are using permissions here is the current list of permissions in the bundle :

Permission Description
ROLE_H5P_DOWNLOAD_ALL Download the H5P packages
ROLE_H5P_EMBED_ALL Embed/Share to everyone the H5P
ROLE_H5P_CREATE_RESTRICTED_CONTENT_TYPES Restrict for user the type install
ROLE_H5P_UPDATE_LIBRARIES Allow/Disallow the update of package H5P
ROLE_H5P_INSTALL_RECOMMENDED_LIBRARIES Allow/Disallow to install libraries
ROLE_H5P_COPY_ALL Allow/Disallow to copy H5P (If you want to Download, you must install to have this role too)

Usage

First add a virtual host that points to you project. Then in your browser go to http://<your virtualhost>/h5p/list

Todo

Working:

  • Store usage data and points (only if user is connected)
  • Download a H5P
  • Upload H5P
  • Update / Install H5P library
  • Store usage data and points

Not everything is ported yet. The following things still need to be done:

  • Upload library. Currently only H5P default libraries can be selected from Hub. (need custom h5p for testing )

Changelog:

  • Using dev version with restrict tag for prevent Break Change
  • Implement missing road and resolve compatibility of H5P-editor
  • Fix bug and update the readme
  • Fix many bug ... and update to SF5 :)
  • Fix bug with missing link img
  • Fix Download package
  • Store usage data and points

Developing:

Run the static analyzer like that:

php -d memory_limit=-1 vendor/bin/phpstan.phar analyze .

emmedy/h5p-bundle 适用场景与选型建议

emmedy/h5p-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5.13k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2018 年 03 月 30 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「symfony」 「php」 「content」 「interactive」 「h5p」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 emmedy/h5p-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 emmedy/h5p-bundle 我们能提供哪些服务?
定制开发 / 二次开发

基于 emmedy/h5p-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 5.13k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 8
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 2
  • Forks: 13
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-03-30