| Project: | Mollom |
| Version: | 7.x-1.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | sun |
| Status: | closed (duplicate) |
Issue Summary
Replace the low-level XML-RPC communication with a new REST API.
With that being said, here's the plan:
- Replace the XML-RPC communication and response handling with REST/drupal_http_request(), but still keep everything in mollom().
- Ensure the REST API understands the identical request parameters and returns the identical values.
- Ensure that error handling still works as expected.
- For now, Drupal 7 resp. PHP5 only.
In Drupal 6, we can't rely on native PHP5 XML helpers and Drupal's built-in XML parser helper functions (relying on xml_parse()) is not able to parse the returned XML for unknown reasons currently. Therefore, separate issue.
- To focus on the actual replacement, the current patch simply converts/maps the old
mollom.fooBarmethods to new REST methods within mollom().This may change once the functionality works - OTOH, each method can only be called in a unique way, so instead of adding separate $request_method and $path parameters to mollom() and updating all the calling code, it might make more sense and be smarter to keep this idea/direction and advance on it instead (PHP class).
- Especially the new CAPTCHA methods need attention.
The old XML-RPC API always had to be called in order to retrieve a CAPTCHA URL, whereas the new REST way simply allows to retrieve a CAPTCHA in different formats on a certain URL. This requires us to parse out, store/remember, and re-use the server name and session ID. The consequence of doing so is that the client-side server/load balancing only kicks in once, initially when requesting/creating the CAPTCHA resource.
- Various methods are still missing in the new REST API on the backend. Therefore, not everything can be converted yet.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| mollom-rest.0.patch | 20.18 KB | Ignored: Check issue status. | None | None |
Comments
#1
This one works to some extent already; still contains a couple of workarounds for backend responses.
#2
Marking as duplicate of #446994: Implement a generic Mollom PHP class, since I started to work on a class with the goal to support either REST or XML-RPC to get this code into the master branch earlier.
Even though it's likely that we're going to remove the XML-RPC client code entirely, the class half-way exists now, it only makes sense to bite into the bullet and solve two major issues at once.