This article explains how to use the GetChanges method from the ComparisonApi in the GroupDocs SDK.
Requirements
- PHP 5.3
- Apache ModRewrite
- PHP Curl extension
- PHP Sockets extension (php_sockets.dll)
- GroupDocs PHP SDK
- composer.phar (Download from http://getcomposer.org/download/ or use the included version.)
- FatFree framework (https://github.com/bcosca/fatfree)
We already know how to install the Fatfree framework and prepare for creating the sample from a previous article. The sample that we create in this article is not much different from other Fatfree examples. We need a template file with a form and a controller file to process entered data.
LogicTo get a list of changes we need two documents to compare with the GroupDocs Comparison API. We’ll look at the output document that a comparison creates. Lets take a look at the logic that this sample implements:
- A user enter User ID, Private Key and File GUID (from GroupDocs account) into the form.
- The entered data is transfered to the controller for processing.
- Get entered data.
- Check entered data.
- Create GroupDocsRequestSigner, APIClient and ComparisonApi objects.
- Get all changes from document.
- Create a table with a list of changes.
- Return this table to the template.
You may think that this logic implies a lot of work, but that’s not so: with GroupDocs PHP SDK it’s very simple. And now, let me show you how.