Skip to content

Things the PHP library does

Sebastian Rettig edited this page Nov 26, 2019 · 6 revisions

So far, it looks like the H5P (Editor) Server does the following things: (boxes indicate what we currently support)

  • stores and serves libraries / content types (actual persistence is done in the plugin)
  • stores and serves content (actual persistence is done in the plugin)
    • (mostly supported) CRUD operations on contents (=content.json and parts of h5p.json)
    • manages file uploads (= images, video etc.)
  • store user state (for continuing later)
  • AJAX endpoint for the editor (see AJAX Endpoint)
  • backend communication with the H5P hub (see Communication with the H5P Hub)
    • register the site
    • send usage statistics
    • get information about content types on the hub
    • download and install new content types / updates of content types on user request
  • validation of packages (structural integrity and conformity of content and libraries)
  • validation of content against library semantics (+ filter html to prevent cross-site-scripting (XSS) vulnerabilities.)
  • manage and check editor tokens (to make sure you have access rights to a session)
  • logging & statistics generation: e.g. use of libraries by author, view of embedded content etc. (see h5p-php-library:h5p-event-base.class.php for a list of events)
  • alter library files, semantics (allows site admins to change libraries without hacking the actual files; very useful)
  • allows downloading h5p packages ("exporting" content)
  • provide embed option for content (as div and as iframe)
  • support copy & paste in the editor
  • admin site / functionality (settings? +library management (what libraries of which version are installed & used how often; add libraries manually, update content of a specific library version))
  • (partly supported) check permissions of users (install libraries, download h5p package, embed h5p package, create restricted, update libraries, install recommended, copy h5p?)
  • cache assets (aggregates all css and js files into two big files to decrease http requests; done in h5p-php-library:h5p-default-storage.class.php->cacheAssets(...))