Skip to content

Refactor the discovery.xml fetching #56

@donquixote

Description

@donquixote

We have the CoolRequest class which fetches the discovery.xml and extracts the WOPI client url from the xml.
I would like to refactor this.

Refactoring:

  • Replace global functions with services.
  • Avoid object state where it is not needed.

Functional changes:

  • Rethink error handling.
  • Don't concatenate t() strings, and rethink error message passing.
  • Use Guzzle instead of file_get_contents to fetch the remote content.
  • Cache the result, to avoid repeated calls. This also means we need to flush that cache at some point.
  • Allow getting different values from the xml, e.g. for different mime types.

@hfiguiere some questions.
In CoolRequest we have these error codes 101, 201 etc.
Do these numbers have special meanings? Is there any external system that understands these number codes?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions