Plans/Architecture for the PHP tools for implementing gmod-rpc
gmod-rpc/index.php
Use mod_rewrite so that gmod-rpc URLs all go to this script
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^/gmod-rpc/.*$ /gmod-rpc/index.php
</IfModule>
index.php looks for a version directory based on the URL.
Very small class from Joe Grissom at Oklahoma for making XML. There is probably something more sophisticated that could be used in the future, but this works.
put everything else in a directory based on the version, e.g. v1
All this does is parse the URL to instantiate a contoller object for the desired service and a view object. The class files live in
This will be where data source adaptors live class.SourceName.php/
This directory holds a file defining a base class
class.Service.php
implement additional services by adding object classes that extend this base class e.g. class.Organisms.php:
class Organisms extends Service{
...
Service class names should be ucfirst.
A views object to generate xml or json