mercredi 8 juillet 2020

How to make joudi/Laravel-H5P work to implement an editor for H5P files?

I've been trying to get djoudi/Laravel-H5P to work to implement an editor for H5P contents without using any of their Drupal/Moodle/Wordpress plugins.

I'm basically stuck at a point described in this issue (which is supposed to be solved) about incompatibility with H5PFrameworkInterface. Here's what I did:

  1. composer create-project laravel/laravel="5.5.*" my-project

  2. composer require djoudi/laravel-h5p

  3. replace two pairs of {} with [] (probably depending on PHP version):

    • /vendor/h5p/h5p-core/h5p.classes.php, line 2747
    • /vendor/h5p/h5p-core/h5p-development.class.php, line 70
  4. php artisan vendor:publish

  5. php artisan migrate

  6. add these lines to autoload/classmap in composer.json:

    "vendor/h5p/h5p-core/h5p-default-storage.class.php",
    "vendor/h5p/h5p-core/h5p-development.class.php",
    "vendor/h5p/h5p-core/h5p-event-base.class.php",
    "vendor/h5p/h5p-core/h5p-file-storage.interface.php",
    "vendor/h5p/h5p-core/h5p.classes.php",
    "vendor/h5p/h5p-editor/h5peditor-ajax.class.php",
    "vendor/h5p/h5p-editor/h5peditor-ajax.interface.php",
    "vendor/h5p/h5p-editor/h5peditor-file.class.php",
    "vendor/h5p/h5p-editor/h5peditor-storage.interface.php",
    "vendor/h5p/h5p-editor/h5peditor.class.php"
    
  7. add this line to providers in config/app.php: 
 Djoudi\LaravelH5p\LaravelH5pServiceProvider::class

  8. php artisan make:auth

  9. do the following

    cd public
    mkdir vendor
    cd vendor
    mkdir h5p
    cd h5p
    ln -s ../../../storage/h5p/content
    ln -s ../../../storage/h5p/editor
    ln -s ../../../storage/h5p/libraries
    

I also tried specifying version 2.0 of the package in composer.json (which required using Laravel 5.8 instead). That seemed to work a little better from a technical perspective, but I didn't manage to install any libraries or create any H5P contents, either. Basically, any H5P library I upload seems to be recognised as a valid H5P file and extracting the zip file works, but no library is found/installed.

How can I make any combination of this project and Laravel work?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire