In order to also have a typical scripting language for web applications in the SQLSpaces portfolio, the PHP client was developed. The API has been designed to be very similar to the Java interface, so an experienced Java programmer should have no problem in mapping his knowledge to the PHP world.

The PHP client is communicating with the SQLSpaces server by using the XML protocol over Socket. Therefore it is depending on the Net_Socket package of the Pear Framework. In our distribution we also added this Net_Socket package, but be careful if you want to embed the SQLSpaces client in an environment that already provides Pear and specifically Net_Socket, like XAMPP does.

As the other clients, the PHP client is not documented in detail, but here are the important things you have to keep in mind:

  • PHP does not support threading, so we did not implement callbacks! However, you can still use blocking commands (waitToRead, waitToTake), but be aware that you really block the main thread with this call.
  • The PHP data types are not automatically mappable to the Java data types. Therefore you need to manually specify the datatypes whenever you create a field.
  • Mind the missing features of the PHP client in comparison to the Java client! (see the comparison for details)

For some code examples on how to use this client in detail, it is recommended to look at the class TupleSpaceTest, where many standard use cases are covered.