<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Alex Little &#187; phpdocumentor</title>
	<atom:link href="http://alexlittle.net/blog/tag/phpdocumentor/feed/" rel="self" type="application/rss+xml" />
	<link>http://alexlittle.net/blog</link>
	<description></description>
	<lastBuildDate>Mon, 21 May 2012 17:31:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>REST Service documentation with PHPDocumentor</title>
		<link>http://alexlittle.net/blog/2008/04/14/rest-service-docs-with-phpdocumentor/</link>
		<comments>http://alexlittle.net/blog/2008/04/14/rest-service-docs-with-phpdocumentor/#comments</comments>
		<pubDate>Mon, 14 Apr 2008 08:47:07 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[cohere]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[phpdocumentor]]></category>
		<category><![CDATA[rest]]></category>

		<guid isPermaLink="false">http://alexlittle.net/blog/?p=335</guid>
		<description><![CDATA[I&#8217;ve just been hacking around with PHPDocumentor getting it to automatically create the documentation for the Cohere API and seems to be working well. I have apilib.php which contains the PHP calls to the functions, then service.php is a wrapper around the apilib.php and provides the actual REST based services. Service.php is basically just a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just been hacking around with <a href="http://www.phpdoc.org/">PHPDocumentor</a> getting it to automatically create the documentation for the <a href="http://cohere.open.ac.uk">Cohere</a> API and seems to be working well.</p>
<p>I have apilib.php which contains the PHP calls to the functions, then service.php is a wrapper around the apilib.php and provides the actual REST based services. Service.php is basically just a big switch statement, so, since PHPDocumentor needs the function declarations I can&#8217;t actually base the service documentation on service.php, so I&#8217;m using apilib.php as the basis for the service documentation.</p>
<p>I created my own PHPDocumentor template, which has been straightforward enough, though I did come across a couple of <a href="http://sourceforge.net/forum/forum.php?thread_id=2004248&amp;forum_id=35065">little issues</a> &#8211; nothing too big and nothing that can&#8217;t be worked around .</p>
<p>These were the 2 little hacks I needed to put into my template:</p>
<ol>
<li>in apilib, I&#8217;ve named the functions using camel case, whereas the actual method calls in service.php need to be lower case &#8211; so I amended the stylesheet to use: {text-transform:lowercase;} where the function name was displayed</li>
<li>I also needed to remove the dollar signs from the front of all the PHP parameters, so to do this I just used the Smarty templating command &#8216;replace&#8217;: {$functions[func].params[params].var|replace:&#8217;$':&#8221;}</li>
</ol>
<p>I still have some of the documentation to actually write into apilib.php &#8211; most notably example service calls for each method and double checking the return descriptions are consistent (and correct). All is working out well and you can see the <a href="http://cohere.open.ac.uk/api/_apilib.php.html">generated docs</a> on the Cohere site.</p>
]]></content:encoded>
			<wfw:commentRss>http://alexlittle.net/blog/2008/04/14/rest-service-docs-with-phpdocumentor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

