Skip to content

Instantly share code, notes, and snippets.

@hobodave
Created April 23, 2009 08:38
Show Gist options
  • Select an option

  • Save hobodave/100396 to your computer and use it in GitHub Desktop.

Select an option

Save hobodave/100396 to your computer and use it in GitHub Desktop.
<?php
set_include_path('./lib:.');
include 'lib/Zend/Loader.php';
Zend_Loader::registerAutoload();
$server = new Zend_Json_Server();
$server->setClass('SpellCheck');
if ('GET' == $_SERVER['REQUEST_METHOD']) {
$server->setTarget('/spell/json-rpc.php')
->setEnvelope(Zend_Json_Server_Smd::ENV_JSONRPC_2);
$smd = $server->getServiceMap();
header('Content-Type: application/json-rpc');
echo $smd;
return;
}
$server->handle();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment