PHP SDK
Download the PHP SDK (version 1.6)
All platforms (.tar.gz files):
- Source code, examples and documentation (application/x-gzip, 222.0 kB)
About the PHP SDK
The Veriplace PHP SDK provides much of the same functionality as the Veriplace Java SDK (2.8), with differences inherent to the single-threaded, non-persistent nature of a PHP application in a typical web server environment.
The SDK is provided in a single .tar.gz archive containing the library source code, documentation, and examples. If you have root access to your PHP installation, you can install the Veriplace package using PEAR; if not, simply copy the library files from the src subdirectory into your application directory.
Veriplace PHP SDK Release Notes
Veriplace PHP SDK 1.6 Release Notes
What's New
- Asynchronous APIs (Veriplace_GetLocationAPI::requestLocation() and Veriplace_InvitationAPI::inviteGetLocation()) now support a new, extended callback mechanism, which delivers all the information about the result and the original request, compared to the previous callback mechanism which only delivered a summary of the result status. This is implemented by new overloads of those methods, whose parameters include an instance of the new class Veriplace_CallbackOptions. Note that to use extended callbacks, you must provide a secure (https:) callback URI.
- The Veriplace_CallbackOptions class also includes an option for asking Veriplace to wrap the callback message's XML or JSON content in a form-encoded parameter. This may be useful if your callbacks are not being handled by the same PHP application, but by some other platform that can only accept form-encoded content.
- The Veriplace_LocationOptions class now has a suppressCachedPosition property for specifying that Veriplace should not include cached positions in error responses.
- The client now uses /api/1.2 URIs for all Veriplace REST APIs.
Veriplace PHP SDK 1.5 Release Notes
What's New
- Location requests can now include a map service query for nearby points of interest and/or street intersections; see Veriplace_LocationOptions. If available, this information appears as new properties in the Veriplace_Location class. The example get-location.php has been updated to demonstrate these features.
- The Veriplace_LocationOptions class also encapsulates other request properties such as location mode and timeout, which formerly were implemented as separate optional parameters in Veriplace_GetLocationAPI methods.
- For efficiency, the client can now request JSON-encoded responses from the platform for all APIs; the default is still XML encoding. See Veriplace_Configuration.
- The client now uses /api/1.1 URIs for all Veriplace REST APIs, which have slightly different parameters and output schema from the previous /api/1.0 URIs. The platform still supports the 1.0 versions, but the client no longer uses them.
Fixes
- The obsolete Veriplace_SetLocationAPI, which was not supported in the platform, has been removed from the client and the examples.
- Several obsolete PHP usages that would cause deprecation warnings in PHP 5.3 have been removed.
Veriplace PHP SDK 1.4 Release Notes
What's New
- Veriplace_GetLocationAPI now supports asynchronous requests. The requestLocation() method returns an identifier which you can use to poll for the result; or you can pass a callback URI for Veriplace to push the result to your application. The high-level web API method Veriplace::requireLocationAsychronous() makes it easy to resume a previously started request after a callback; for an example, see get-location-waitpage.php.
- Veriplace_InvitationAPI now supports both of the asynchronous modes described above, rather than just the callback/push one.
- The new method Veriplace_PermissionAPI::verifyCarrierLocatability() tests whether a mobile number belongs to a supported carrier.
- Veriplace_GetLocationAPI::getLocationById() now allows you to pass the application-specific access token, rather than a user-specific permission token, as long as the application does have permission to locate the user.
Fixes
- Fixed a bug that caused an error when creating temporary files, on some platforms, if the PHP version was 5.2.0 or lower.
- The __toString() method of Veriplace_Location now works; previously it caused an error.
- Code that caused deprecation warnings in PHP 5.3 has been changed to make it equally valid in PHP 5.2 and 5.3.
Veriplace PHP SDK 1.3 Release Notes
What's New
- The new Veriplace_PollingAPI provides a way to query Veriplace for batches of location updates from any users who are opted into your application. The example code includes a demonstration of this feature.
Veriplace PHP SDK 1.2 Release Notes
What's New
- The new Veriplace_InvitationAPI supports inviting users to opt into your application via an SMS interface. The example code includes a demonstration of this feature.
- The "secure" property has been removed from the client configuration. This was only useful for WaveMarket internal testing; the client always uses SSL for direct communication with veriplace.com.
Veriplace PHP SDK 1.1 Release Notes
What's New
- The new method Veriplace_GetLocationAPI::getPermittedUsers() provides a list of all users that the application currently has permission to locate.
- The new method Veriplace_UserDiscoveryAPI::getUsersByParameters() provides the same user lookup capability as getUserByParameters(), but for a batch of multiple users.
Veriplace PHP SDK 1.0.1 Release Notes
Version 1.0.1 is a bug fix release that fixes several problems with the basic HTTP client implementation. These problems could prevent the client from connecting to the Veriplace server, but only if your PHP instance lacked both of the two common HTTP extensions (curl and pecl_http). Most PHP developers would have at least one of those, and therefore would not have been affected by this bug.
Veriplace PHP SDK 1.0 Release Notes
Known Issues
The chief missing feature is the ability to display an automatically-refreshing "please wait" page while asynchronously executing a location request, as the Java client can do. This may be required to prevent timeouts on some mobile devices, but should not affect web browsers.
The Client API includes "set location" methods for submitting a new location for a user. These are intended for future use; the current version of the Veriplace server does not allow applications to change a user's location.
Dependencies
The SDK requires PHP version 5.2 or higher. It only relies on extensions that are part of the standard PHP 5.2 distribution. The optional modules PEAR::Log, curl, and pecl_http provide additional functionality if present.