<?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>Christophe Herreman &#187; AMFPHP</title>
	<atom:link href="http://www.herrodius.com/blog/category/amfphp/feed" rel="self" type="application/rss+xml" />
	<link>http://www.herrodius.com/blog</link>
	<description>Thoughts from a software developer</description>
	<lastBuildDate>Thu, 15 Sep 2011 21:50:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Hacking the AMFPHP Deserializer with Propel</title>
		<link>http://www.herrodius.com/blog/142</link>
		<comments>http://www.herrodius.com/blog/142#comments</comments>
		<pubDate>Sat, 19 Apr 2008 13:34:48 +0000</pubDate>
		<dc:creator>Christophe</dc:creator>
				<category><![CDATA[AMFPHP]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.herrodius.com/blog/142</guid>
		<description><![CDATA[I've been working on a project lately that uses Flex, AMFPHP, Propel and MySQL. For most of you these technologies may be well known, except maybe for Propel. In this post, I'll briefly mention what Propel is, what it does and how you can hack the AMFPHP Deserializer to make maximum use of Propel. Propel [...]]]></description>
			<content:encoded><![CDATA[<p>I've been working on a project lately that uses Flex, AMFPHP, Propel and MySQL. For most of you these technologies may be well known, except maybe for Propel. In this post, I'll briefly mention what Propel is, what it does and how you can hack the AMFPHP Deserializer to make maximum use of Propel.</p>
<p><strong>Propel</strong></p>
<p>From the Propel project <a href="http://propel.phpdb.org/trac/">website</a>: Propel is an Object Relational Mapping (ORM) framework for PHP5. It allows you to access your database using a set of objects, providing a simple API for storing and retrieving data.</p>
<p>Propel allows you, the web application developer, to work with databases in the same way you work with other classes and objects in PHP.</p>
<p>    * You don't have to worry about database connections or writing SQL -- unless you want to.<br />
    * You never have to worry about escaping data or type-casting results.<br />
    * You define your database in a simple XML format (or tell Propel to build it from an existing database) and Propel will create database initialization files for your database and will generate static classes and objects that provide an OO interface to your database. (It can generate other useful things based on the datamodel too!)<br />
    * Propel builds classes which are aware of the structure of your database so there's no performance lost to initialization or to on-the-fly database metadata queries. </p>
<p>Most of you will agree that writing database queries and access code is one of the most tedious jobs in application development. Propel does an extremely good job at simplifying this work for the reasons mentioned above.</p>
<p><strong>Mapping objects</strong></p>
<p>The classes built by Propel use explicit getters and setters. That means they have methods like "setMyProperty" and "getMyProperty" to modify and access their fields. In addition to that, collections are an exception to that rule because they don't define a setter method. Instead, they define a method like "addMyItem" to fill the collection called "myItems".</p>
<p>The setter methods don't just set a property. They also contain logic that will mark a property as modified so that queries can be optimized.</p>
<p>The first step in setting up automatic mapping of the client and server objects, is to create Data Transfer Objects (DTO's, also known as Value Objects or VO's - although I prefer DTO after reading Eric Evans' DDD book.) that have the same property names as the protected properties in the PHP classes generated by Propel. To simplify the server objects, we changed the protected scope to public since it then allows us to send these to the client.</p>
<p>So what we have so far is a bunch of classes on the server and a bunch of classes on the client. Sending an object from server to client will allow mapping at this moment since we changed the protected scope of the properties to a public scope. Also note that you need to instruct AMFPHP about the type of the class by defining it in every object you want to map:</p>
<div class="igBar"><span id="lphp-3"><a href="#" onclick="javascript:showPlainTxt('php-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-3">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">class</span> MyClass extends BaseMyClass<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#000000; font-weight:bold;">var</span> <span style="color:#0000FF;">$_explicitType</span>=<span style="color:#FF0000;">"MyClass"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>Mapping objects from client to server</strong></p>
<p>Mapping objects from client to server is actually not that easy. After all, when we send a property from the client, say "myProperty", the AMFDeserializer inside AMFPHP will try to set a property called "myProperty" on the mapped server object. This would actually work, but the queries would fail to execute correctly since they will not see any properties as being modified. That's why we need to call the setter method "setMyProperty" instead, which will mark the property as modified.</p>
<p>In order to invoke the setters (and "add*" methods of the collections) we changed the AMFDeserializer class so it tries to invoke setters dynamically. Let's jump right into the code.</p>
<div class="igBar"><span id="lphp-4"><a href="#" onclick="javascript:showPlainTxt('php-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-4">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// method &quot;readAmf3Object&quot;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">for</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$i</span> = <span style="color:#CC66CC;color:#800000;">0</span>; <span style="color:#0000FF;">$i</span> &lt;<span style="color:#0000FF;">$memberCount</span>; <span style="color:#0000FF;">$i</span>++<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#0000FF;">$val</span> = <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">readAmf3Data</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#0000FF;">$key</span> = <span style="color:#0000FF;">$members</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$i</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$isObject</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$isCollection</span> = <span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/substr"><span style="color:#000066;">substr</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$key</span>,<span style="color:#CC66CC;color:#800000;">0</span>,<span style="color:#CC66CC;color:#800000;">4</span><span style="color:#006600; font-weight:bold;">&#41;</span> == <span style="color:#FF0000;">"coll"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$isCollection</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$addMethod</span> = <span style="color:#FF0000;">"add"</span> . <a href="http://www.php.net/substr"><span style="color:#000066;">substr</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$key</span>,<span style="color:#CC66CC;color:#800000;">4</span>,-<span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#616100;">foreach</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$val</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$item</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$obj</span>-&gt;<span style="color:#0000FF;">$addMethod</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$item</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">else</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$key</span> == <span style="color:#FF0000;">"isNew"</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span>&nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$setter</span> = <span style="color:#FF0000;">"setNew"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#616100;">else</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$keyparts</span> = <a href="http://www.php.net/explode"><span style="color:#000066;">explode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"_"</span>, <span style="color:#0000FF;">$key</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$setter</span> = <span style="color:#FF0000;">"set"</span>;&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">for</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$j</span>=<span style="color:#CC66CC;color:#800000;">0</span>; <span style="color:#0000FF;">$j</span>&lt;count<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$keyparts</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#0000FF;">$j</span>++<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$setter</span> .= <a href="http://www.php.net/ucfirst"><span style="color:#000066;">ucfirst</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$keyparts</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$j</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/method_exists"><span style="color:#000066;">method_exists</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$obj</span>, <span style="color:#0000FF;">$setter</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$obj</span>-&gt;<span style="color:#0000FF;">$setter</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$val</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#616100;">else</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$obj</span>-&gt;<span style="color:#0000FF;">$key</span> = <span style="color:#0000FF;">$val</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#616100;">else</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$obj</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$key</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#0000FF;">$val</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>The above code tries to match the name of the setters by looking at the name of the properties inside the object being send. If it finds a setter method, it will invoke it and pass in the property as a value. The code will also try to detect a collection and invoke the "add*" method instead of a setter. There's also a "isNew" property to instruct the classes whether to do an update or an insert query when the save method is invoked on an object.</p>
<p>This hack brought me to the idea that AMFPHP should maybe provide a pluggable architecture for the serializers and deserializers. Instead of going into the code and modifying it to suit your needs, you could then register a custom (de)serializer in the config which will be used. Upgrading to newer versions of AMFPHP would then be less of a pain.</p>
<p>Anyway, hope you find this useful. Have fun coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.herrodius.com/blog/142/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MMUG Flash Remoting session files</title>
		<link>http://www.herrodius.com/blog/34</link>
		<comments>http://www.herrodius.com/blog/34#comments</comments>
		<pubDate>Sat, 01 Oct 2005 14:21:54 +0000</pubDate>
		<dc:creator>Christophe</dc:creator>
				<category><![CDATA[AMFPHP]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.herrodius.com/blog/?p=34</guid>
		<description><![CDATA[A quick post to let you know that the Flash Remoting presentation files from last thursday at the MMUG Belgium are online. I covered Flash Remoting with AMFPHP and shared some project experiences, tips and tricks and showed a bunch of examples. You can get the files here. The zip file includes the presentation slides, [...]]]></description>
			<content:encoded><![CDATA[<p>A quick post to let you know that the Flash Remoting presentation files from last thursday at the MMUG Belgium are online. I covered Flash Remoting with AMFPHP and shared some project experiences, tips and tricks and showed a bunch of examples.</p>
<p>You can get the files <a href="http://www.herrodius.com/upload/FlashRemotingMMUGPresentation.zip">here</a>. The zip file includes the presentation slides, all the examples, the database dumps and the AMFPHP classes.</p>
<p>Many thanks to <a href="http://www.mmug.be">MMUG Belgium</a> (<a href="http://www.webkitchen.be">Serge</a> and <a href="http://www.peterelst.com">Peter</a>) and <a href="http://www.multimediacollege.be">MultimediaCollege</a> for the venue.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.herrodius.com/blog/34/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Flash Remoting components for Flash 8, AS2.0 available now</title>
		<link>http://www.herrodius.com/blog/33</link>
		<comments>http://www.herrodius.com/blog/33#comments</comments>
		<pubDate>Wed, 21 Sep 2005 06:19:41 +0000</pubDate>
		<dc:creator>Christophe</dc:creator>
				<category><![CDATA[AMFPHP]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.herrodius.com/blog/?p=33</guid>
		<description><![CDATA[Macromedia has released an updated version of the Flash Remoting components. September 20, 2005 This version of the Flash Remoting components supports Flash Professional 8 and Flash Basic 8. It is currently available in English; French, German, and Japanese versions will be available shortly. The English version can also be installed with other language versions [...]]]></description>
			<content:encoded><![CDATA[<p>Macromedia has released an updated version of the Flash Remoting components.</p>
<blockquote><p><strong>September 20, 2005</strong><br />
This version of the Flash Remoting components supports Flash Professional 8 and Flash Basic 8. It is currently available in English; French, German, and Japanese versions will be available shortly. The English version can also be installed with other language versions of Flash.</p>
<p>The installer available includes:</p>
<ul>
<li>Flash Remoting Component </li>
<li>Support files for Flash 8 </li>
<li>NetConnection Debugger </li>
<li>HTML content that can be viewed within the Help panel in Flash </li>
<li>ActionScript 2.0 API class source code </li>
</ul>
</blockquote>
<p>Download page: <a href="http://www.macromedia.com/software/flashremoting/downloads/components/">here</a><br />
Release notes: <a href="http://www.macromedia.com/support/documentation/en/flash_remoting/fl8/releasenotes.html">here</a></p>
<p>Direct Windows installer link: <a href="http://download.macromedia.com/pub/flashremoting/flash8/flashremoting_components_flash8.msi">here</a></p>
<p>Through <a href="http://www.rocketboots.com.au/blog/index.cfm?mode=entry&#038;entry=769BEA93-E081-51EF-A78D6431A9770AA0">RocketBoots</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.herrodius.com/blog/33/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ServiceCapture</title>
		<link>http://www.herrodius.com/blog/31</link>
		<comments>http://www.herrodius.com/blog/31#comments</comments>
		<pubDate>Sun, 04 Sep 2005 16:23:36 +0000</pubDate>
		<dc:creator>Christophe</dc:creator>
				<category><![CDATA[AMFPHP]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.herrodius.com/blog/?p=31</guid>
		<description><![CDATA[Just in case you missed the news, ServiceCapture is a great tool for debugging Flash Remoting applications. What is it? ServiceCapture runs on your pc and captures all HTTP traffic sent from your browser or IDE. It is designed to help Rich Internet Application(RIA) developers in the debugging, analysis, and testing of their applications. ServiceCapture [...]]]></description>
			<content:encoded><![CDATA[<p>Just in case you missed the news, <a href="http://kevinlangdon.com/serviceCapture/">ServiceCapture</a> is a great tool for debugging Flash Remoting applications.</p>
<blockquote><p><strong>What is it?</strong></p>
<p>ServiceCapture runs on your pc and captures all HTTP traffic sent from your browser or IDE. It is designed to help Rich Internet Application(RIA) developers in the debugging, analysis, and testing of their applications. </p>
<p>ServiceCapture is the only tool of its kind to deserialize and display all Flash Remoting or AMF traffic in a simple-to-use interface. </p>
<p>ServiceCapture also has a unique bandwidth simulation feature. This allows engineers to throttle their bandwidth to simulate dial-up, dsl, and cable connection speeds, even when your entire application is being served locally.</p></blockquote>
<p>I've been using it over the last week and really enjoy it. I personally replaced it with <a href="http://www.xk72.com/charles/">Charles HTTP debugger</a>. It does not have that many features (yet?) as Charles, but the Remoting support is what I needed the most so...enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.herrodius.com/blog/31/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>AMFPHP class mapping</title>
		<link>http://www.herrodius.com/blog/30</link>
		<comments>http://www.herrodius.com/blog/30#comments</comments>
		<pubDate>Sun, 04 Sep 2005 14:17:23 +0000</pubDate>
		<dc:creator>Christophe</dc:creator>
				<category><![CDATA[AMFPHP]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.herrodius.com/blog/?p=30</guid>
		<description><![CDATA[Here are some good things to know when using class mapping with AMFPHP. As an example, imagine working on an application that handles users through a UserVO value object. Here's what the PHP and the AS2 class look like. The UserVO class in PHP This class is in a "vo" subfolder of the "services" folder [...]]]></description>
			<content:encoded><![CDATA[<p>Here are some good things to know when using class mapping with AMFPHP. As an example, imagine working on an application that handles users through a UserVO value object. Here's what the PHP and the AS2 class look like.</p>
<p><strong>The UserVO class in PHP</strong></p>
<p>This class is in a "vo" subfolder of the "services" folder (in your AMFPHP installation dir).</p>
<div class="igBar"><span id="lphp-10"><a href="#" onclick="javascript:showPlainTxt('php-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-10">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">class</span> UserVO<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#000000; font-weight:bold;">var</span> <span style="color:#0000FF;">$firstname</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#000000; font-weight:bold;">var</span> <span style="color:#0000FF;">$lastname</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#000000; font-weight:bold;">var</span> <span style="color:#0000FF;">$age</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#000000; font-weight:bold;">function</span> UserVO<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>The UserVO class in AS2</strong></p>
<p>This class is in the namespace "com.domain.vo.UserVO".</p>
<div class="igBar"><span id="lactionscript-11"><a href="#" onclick="javascript:showPlainTxt('actionscript-11'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-11">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">class</span> com.<span style="color: #0066CC;">domain</span>.<span style="color: #006600;">vo</span>.<span style="color: #006600;">UserVO</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> firstname:<span style="color: #0066CC;">String</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> lastname:<span style="color: #0066CC;">String</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> age:<span style="color: #0066CC;">Number</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #000000; font-weight: bold;">function</span> UserVO<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>Flash to PHP</strong></p>
<p>Sending VO's from Flash to PHP is quite simple. Just add the parameters in the "arguments" key. Use the fully qualified classpath of the class on the server side and make sure you set "required" to true;</p>
<div class="igBar"><span id="lphp-12"><a href="#" onclick="javascript:showPlainTxt('php-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-12">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">"saveUser"</span> =&gt; <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#FF0000;">"description"</span> =&gt; <span style="color:#FF0000;">"Inserts or updates the user in de database."</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#FF0000;">"access"</span> =&gt; <span style="color:#FF0000;">"remote"</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#FF0000;">"arguments"</span> =&gt; <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF0000;">"aboutVO"</span> =&gt; <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"type"</span> =&gt; <span style="color:#FF0000;">"vo.UserVO"</span>, <span style="color:#FF0000;">"required"</span> =&gt; <span style="color:#000000; font-weight:bold;">true</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#41;</span>&nbsp;&nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>PHP to Flash</strong></p>
<p>Watch out here! You can leave out the "returns" key from the method entry in the methodtable. When you do that, AMFPHP will return the name of the class for you. The thing to know here is that in PHP4 the classname will be returned in lowercase, while in PHP5 it will be returned in its original format of lower- and uppercases. Note that this does not return the fully qualified classpath, but just the classname. "uservo" vs. "UserVO".</p>
<p>Here's a quote from the "get_class" function docs.</p>
<blockquote><p>In PHP 4 get_class() returns a user defined class name in lowercase, but in PHP 5 it will return the class name in it's original notation.<br />
<a href="http://be.php.net/manual/en/function.get-class.php">http://be.php.net/manual/en/function.get-class.php</a></p></blockquote>
<p>This is <strong>not</strong> recommended because Object.registerClass() will fail because it is case-sensitive. The best way to get Object.registerClass() to work is to pass in the name of the class in the "returns" key and then use that same name <strong>in lowercase</strong> to register the class in Flash.</p>
<div class="igBar"><span id="lphp-13"><a href="#" onclick="javascript:showPlainTxt('php-13'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-13">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">"getUserVO"</span> =&gt; <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#FF0000;">"description"</span> =&gt; <span style="color:#FF0000;">"Returns a user."</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#FF0000;">"access"</span> =&gt; <span style="color:#FF0000;">"remote"</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#FF0000;">"returns"</span> =&gt; <span style="color:#FF0000;">"vo.UserVO"</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#FF0000;">"arguments"</span> =&gt; <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>And then in Flash...</p>
<div class="igBar"><span id="lactionscript-14"><a href="#" onclick="javascript:showPlainTxt('actionscript-14'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-14">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">Object</span>.<span style="color: #0066CC;">registerClass</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"vo.uservo"</span>, com.<span style="color: #0066CC;">domain</span>.<span style="color: #006600;">vo</span>.<span style="color: #006600;">UserVO</span><span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>That's it, cheers!</p>
<p><strong>[Update]</strong> I must have missed something here: the "returns" string is always passed to Flash in lowercase. So remember that when you use Object.registerClass().</p>
]]></content:encoded>
			<wfw:commentRss>http://www.herrodius.com/blog/30/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Set up your AMFPHP environment: running IIS and Apache simultaniously</title>
		<link>http://www.herrodius.com/blog/23</link>
		<comments>http://www.herrodius.com/blog/23#comments</comments>
		<pubDate>Mon, 08 Aug 2005 20:35:08 +0000</pubDate>
		<dc:creator>Christophe</dc:creator>
				<category><![CDATA[AMFPHP]]></category>

		<guid isPermaLink="false">http://www.herrodius.com/blog/?p=23</guid>
		<description><![CDATA[This post will guide you through the steps that are needed to setup your computer as a webserver in order to run PHP. After all, without running PHP, you won't be able to use AMFPHP since it is the language it is written in. The tools needed are: - an operating system (Windows in my [...]]]></description>
			<content:encoded><![CDATA[<p>This post will guide you through the steps that are needed to setup your computer as a webserver in order to run PHP. After all, without running <a href="http://www.php.net">PHP</a>, you won't be able to use <a href="http://www.amfphp.org">AMFPHP</a> since it is the language it is written in.</p>
<p>The tools needed are:<br />
 - an operating system (Windows in my case)<br />
 - a webserver (IIS or Apache for instance)<br />
 - PHP (duh!)<br />
 - a database system (MySql, probably the most used with PHP)</p>
<p>The setup I use is also called a WAMP setup. WAMP stands for Windows, Apache, MySql and PHP. Note that a LAMP setup (Linux, Apache, MySql and PHP) is probably more used, but WAMP just better suits my needs.</p>
<p>You can start downloading all of the above mentioned tools and then spend a couple of hours (if this is your first time) installing and configuring them untill it drives you nuts and it still doesn't work. Or, you can download WampServer and let the dirty work be done for you. Get WAMPServer <a href="http://www.wampserver.com">here</a>.</p>
<p><strong>The installation</strong></p>
<p>I tried to make as much screenshots as possible that show all the different steps, so this installation should be peanuts for you.</p>
<p>1. Wamp installation welcome screen (<a href="http://www.herrodius.com/images/wamp_01.gif" target="_blank">screenshot</a>)<br />
2. License agreement (<a href="http://www.herrodius.com/images/wamp_02.gif" target="_blank">screenshot</a>)<br />
3. Where should WAMP be installed? I left this at the default location. (<a href="http://www.herrodius.com/images/wamp_03.gif" target="_blank">screenshot</a>)<br />
4. Start menu folder. (<a href="http://www.herrodius.com/images/wamp_04.gif" target="_blank">screenshot</a>)<br />
5. Start WAMP on startup? Whatever you like best. I checked it because I needed to work with it for the coming 2 weeks and just to make sure everything was running. (<a href="http://www.herrodius.com/images/wamp_05.gif" target="_blank">screenshot</a>)<br />
6. Settings overview before installation. (<a href="http://www.herrodius.com/images/wamp_06.gif" target="_blank">screenshot</a>)<br />
7. Select your webroot folder (<a href="http://www.herrodius.com/images/wamp_07.gif" target="_blank">screenshot</a>). This is the default but I prefer not to have any workfiles on the same drive as my Operating System in case I needed to format. Therefor I change the location to my D-drive. (<a href="http://www.herrodius.com/images/wamp_08.gif" target="_blank">screenshot</a>)<br />
8. Warning because I changed the webroot folder. You might not get this screen when you stick to the default location. (<a href="http://www.herrodius.com/images/wamp_09.gif" target="_blank">screenshot</a>)<br />
9. Select you default browser. Click OK to use Internet Explorer  (<a href="http://www.herrodius.com/images/wamp_10.gif" target="_blank">screenshot</a>), or browse to the FireFox executable. (<a href="http://www.herrodius.com/images/wamp_11.gif" target="_blank">screenshot</a>)<br />
10. Setup done. Let's launch WAMPServer. (<a href="http://www.herrodius.com/images/wamp_12.gif" target="_blank">screenshot</a>)</p>
<p><strong>After the installation</strong></p>
<p>11. If everything went alright, you should see a new icon in your systemtray. This indicates that WAMP is or is not running and provides some menu options. (<a href="http://www.herrodius.com/images/wamp_13.gif" target="_blank">screenshot</a>)<br />
12. Test it. Click the tray menu and choose the "localhost" option or open up your browser and point it to http://locahost.  You should see a file overview of the files in your webroot. This folder may be blank if you chose another folder than the default webroot folder.  (<a href="http://www.herrodius.com/images/wamp_14.gif" target="_blank">screenshot</a>) If you did choose the default webroot folder you should see the WAMP startscreen. (<a href="http://www.herrodius.com/images/wamp_16.gif" target="_blank">screenshot</a>)<br />
13. In case you didn't see the WAMP startscreen, copy the files in the default webroot location to the folder you chose as a webroot. (<a href="http://www.herrodius.com/images/wamp_15.gif" target="_blank">screenshot</a>)<br />
14. Click the PHPMyAdmin link under Tools on the WAMP startscreen to check if MySql is running. (<a href="http://www.herrodius.com/images/wamp_17.gif" target="_blank">screenshot</a>) PHPMyAdmin is a webinterface to control your MySql databases.</p>
<p><strong>Where's my IIS startscreen on http://localhost?</strong></p>
<p>IIS users (who run ASP for instance) probably noticed that http://localhost normally pointed to the startscreen of IIS. So how can I access my ASP and PHP webapplications on localhost? Simple, you can't. At least not when you are running WAMP without having modified the configuration.</p>
<p>15. Shut down WAMPServer. (<a href="http://www.herrodius.com/images/wamp_18.gif" target="_blank">screenshot</a>)<br />
16. Point your browser to http://localhost. You should see the IIS startscreen, at least when you are running IIS on your computer. (<a href="http://www.herrodius.com/images/wamp_19.gif" target="_blank">screenshot</a>)</p>
<p>OK, so do I have to shutdown WAMPServer if I want to work on an ASP application and start it again to work on a PHP application? The answer is no! Fortunately there is a way to run both webservers at the same time. All you need to do is change the port number the webserver is running on.</p>
<p><strong>Port number?</strong></p>
<p>When you type in http://localhost in your browser, it is interpreted as http://localhost:80 by the browser because port 80 is the default http port. A port is just an indication to the computer to start a specific process. By default, on my system, it runs IIS. We will leave port 80 as it is and change WAMP to run on port 81.</p>
<p>17. Click the WAMP systemtray icon and choose "httpd.conf" under "Config files".<br />
18. Do a search for "port 80" in the config file. (<a href="http://www.herrodius.com/images/wamp_20.gif" target="_blank">screenshot</a>)<br />
19. Change it to "port 81". (<a href="http://www.herrodius.com/images/wamp_21.gif" target="_blank">screenshot</a>)<br />
20. Restart WAMPServer. (<a href="http://www.herrodius.com/images/wamp_22.gif" target="_blank">screenshot</a>)<br />
21. Click the "Localhost" option in the WAMP systemtray menu.<br />
22. FireFox opens but you get a security warning. It is trying to open the IIS startscreen. (<a href="http://www.herrodius.com/images/wamp_23.gif" target="_blank">screenshot</a>) Internet Explorer will show the startscreen without the warning as shown before. The point of this step is to notice that the port 81 we specified in the config isn't shown in the browser's url bar. We need to change the links on the menu options in the WAMPServer systemtray menu.<br />
23. Open the "wampserver.ini" file in the WAMP installation directory. (<a href="http://www.herrodius.com/images/wamp_24.gif" target="_blank">screenshot</a>)<br />
24. Scroll down to the "Menu.left" settings. (<a href="http://www.herrodius.com/images/wamp_25.gif" target="_blank">screenshot</a>)<br />
25. Notice that the parameters show http://localhost and not http://localhost:81.<br />
26. Change the settings to point to port 81. (<a href="http://www.herrodius.com/images/wamp_26.gif" target="_blank">screenshot</a>) You need to do this 3 times. Once for the "localhost" menuitem, once for the "phpMyAdmin" menuitem and once for the "SQLiteManager" menuitem.<br />
27. Exit WAMPServer. (<a href="http://www.herrodius.com/images/wamp_27.gif" target="_blank">screenshot</a>) Make sure you completely shut down the tool!<br />
28. Start WAMPServer. (<a href="http://www.herrodius.com/images/wamp_28.gif" target="_blank">screenshot</a>)<br />
29. Click the "localhost" option in the WAMPServer systemtray menu. It should point to http://localhost:81. (<a href="http://www.herrodius.com/images/wamp_29.gif" target="_blank">screenshot</a>)<br />
30. Open another browser window (Internet Explorer) and point it to http://localhost or http://localhost:80. The IIS startscreen should open. (<a href="http://www.herrodius.com/images/wamp_30.gif" target="_blank">screenshot</a>)</p>
<p>Now both the IIS and the Apache webserver are running simultaneously. Once this is done, you can start installing and configuring AMFPHP.</p>
<p><iframe src="http://rcm.amazon.com/e/cm?t=christherrem-20&#038;o=1&#038;p=16&#038;l=st1&#038;mode=books&#038;search=php%2Cmysql&#038;fc1=000000&#038;lt1=_blank&#038;lc1=3366FF&#038;bg1=FFFFFF&#038;f=ifr" marginwidth="0" marginheight="0" width="468" height="336" border="0" frameborder="0" style="border:none;" scrolling="no"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.herrodius.com/blog/23/feed</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
		<item>
		<title>AMFPHP v1.0 getting closer: vote for the new logo.</title>
		<link>http://www.herrodius.com/blog/16</link>
		<comments>http://www.herrodius.com/blog/16#comments</comments>
		<pubDate>Wed, 06 Apr 2005 06:12:53 +0000</pubDate>
		<dc:creator>Christophe</dc:creator>
				<category><![CDATA[AMFPHP]]></category>

		<guid isPermaLink="false">http://www.herrodius.com/blog/?p=16</guid>
		<description><![CDATA[Thanx to Patrick Minault, AMFPHP is getting really close at reaching a 1.0 version. A lot of things have been fixed/improved in this version which is now available for beta-testing. This release also introduces a new logo. Which one is up to you to decide... Check out the poll here. Docs are also available on [...]]]></description>
			<content:encoded><![CDATA[<p>Thanx to <a href="http://www.5etdemi.com/">Patrick Minault</a>, AMFPHP is getting really close at reaching a 1.0 version. A lot of things have been fixed/improved in this version which is now available for <a href="http://www.5etdemi.com/uploads/amfphpbeta.zip">beta-testing</a>.</p>
<p>This release also introduces a new logo. Which one is up to you to decide... Check out the poll <a href="http://www.fizzingmedia.com/poll">here</a>.</p>
<p>Docs are also available on the <a href="http://www.amfphp.org/wiki/">AMFPHP wiki</a>. If you feel like contributing with an example, go ahead!</p>
<p>Where to go from here?<br />
 - AMFPHP homepage: <a href="http://www.amfphp.org/">http://www.amfphp.org/</a><br />
 - AMFPHP wiki: <a href="http://www.amfphp.org/wiki/">http://www.amfphp.org/wiki/</a><br />
 - Logo poll: <a href="http://www.fizzingmedia.com/poll">http://www.fizzingmedia.com/poll</a><br />
 - Beta version: <a href="http://www.5etdemi.com/uploads/amfphpbeta.zip">http://www.5etdemi.com/uploads/amfphpbeta.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.herrodius.com/blog/16/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AMFPHP: methodTable automation</title>
		<link>http://www.herrodius.com/blog/4</link>
		<comments>http://www.herrodius.com/blog/4#comments</comments>
		<pubDate>Wed, 05 Jan 2005 15:15:18 +0000</pubDate>
		<dc:creator>Christophe</dc:creator>
				<category><![CDATA[AMFPHP]]></category>

		<guid isPermaLink="false">http://www.herrodius.com/blog/?p=4</guid>
		<description><![CDATA[Problem: The methodTable property can be a real pain to maintain updated throughout the creation of a service class. It's a lot of coding/writing when dealing with big classes. Changes and additions to the service class require you to update the methodTable which can be very time consuming. Solution: Automate the creation of the methodTable. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem:</strong> The methodTable property can be a real pain to maintain updated throughout the creation of a service class. It's a lot of coding/writing when dealing with big classes. Changes and additions to the service class require you to update the methodTable which can be very time consuming.</p>
<p><strong>Solution: </strong>Automate the creation of the methodTable.</p>
<p><strong>Discussion: </strong>When you look at the structure of a methodTable, you'll find the different method names, descriptions, access properties, parameters, etc.</p>
<div class="igBar"><span id="lphp-19"><a href="#" onclick="javascript:showPlainTxt('php-19'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-19">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">methodTable</span> =&nbsp; <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#FF0000;">"getParkTypes"</span> =&gt; <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF0000;">"description"</span> =&gt; <span style="color:#FF0000;">"Returns list of park types"</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF0000;">"access"</span> =&gt; <span style="color:#FF0000;">"remote"</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF0000;">"arguments"</span> =&gt; <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"arg1"</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span>, </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#FF0000;">"getParksList"</span> =&gt; <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF0000;">"description"</span> =&gt; <span style="color:#FF0000;">"Shows list of parks given a park type"</span>, </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF0000;">"access"</span> =&gt; <span style="color:#FF0000;">"remote"</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF0000;">"arguments"</span> =&gt; <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"parkType"</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span>, </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#FF0000;">"getParkDetails"</span> =&gt; <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF0000;">"description"</span> =&gt; <span style="color:#FF0000;">"Return details on a park give the parkname"</span>, </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF0000;">"access"</span> =&gt; <span style="color:#FF0000;">"remote"</span>, </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF0000;">"arguments"</span> =&gt; <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"parkName"</span><span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Most of these properties are allready in your code when creating a method. You write down the name of your method and add parameters as your method needs them. So adding them to your methodtable is really double work. In an ideal situation you've also added comments to your code. These can hold a description for the method and, writing a service class, also have its access defined.</p>
<p>PHP 5 now comes with a reflection API which lets you reverse-engineer a class. Using it, we can easily look up the properties we need to add to the methodtable. The method's name and parameters for instance, but also the comment that comes with the method. The description and access property need to be filtered out of the comment.</p>
<p>Putting this all together, we have the ability to create the methodTable in an automated way. After writing a class that does so, the only thing we need to do is call that class in the constructor of our service class.</p>
<p>Following is the source code of the MethodTable class I wrote.<br />
In order to use it, follow these steps.</p>
<p>- include the class in your webservice class</p>
<div class="igBar"><span id="lphp-20"><a href="#" onclick="javascript:showPlainTxt('php-20'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-20">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">require_once</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"MethodTable.php"</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>- In your constructor: call the create method and assign its return value to the methodTable property of your class.</p>
<div class="igBar"><span id="lphp-21"><a href="#" onclick="javascript:showPlainTxt('php-21'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-21">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">methodTable</span> = MethodTable::<span style="color:#006600;">create</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$this</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Here's the source code:</p>
<div class="igBar"><span id="lphp-22"><a href="#" onclick="javascript:showPlainTxt('php-22'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-22">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">/**</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* MethodTable class.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">*</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* This class uses the Reflection API introduced in PHP 5 to create the methodTable</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* property for a service class. In order to create it, the MethodTable::create()</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* method must be called in the constructor of the service class.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">*</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* Example:</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">*</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* require_once(&quot;MethodTable.php&quot;);</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">*</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* class MyService</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* {</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* function MyService(){</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* $this-&gt;methodTable = MethodTable::create($this);</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* }</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* }</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">*</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* The method's name and parameters will be read from the method signature.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* To add the description and access param to the methodTable, you must write them</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* down in the comment of your method using PHPDOC comment syntax.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">*</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* The description is just plain text.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* The access param uses the @access tag.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">*</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* Example:</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">*/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">/**</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* Returns the list of users.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* @access remote</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">*/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">/**</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">*</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* @author Christophe Herreman (http://www.herrodius.com)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* @version 1.0</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* @since 12/11/2004</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">*/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">class</span> MethodTable</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">/**</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* Creates the methodTable of a service class.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">*</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* @param $serviceClass The reference to the service class.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* @return Array</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">*/</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/static"><span style="color:#000066;">static</span></a> public <span style="color:#000000; font-weight:bold;">function</span> create<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$serviceClass</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#0000FF;">$className</span> = <a href="http://www.php.net/get_class"><span style="color:#000066;">get_class</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$serviceClass</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#0000FF;">$class</span> = <span style="color:#000000; font-weight:bold;">new</span> ReflectionClass<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$className</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#0000FF;">$methods</span> = <span style="color:#0000FF;">$class</span>-&gt;<span style="color:#006600;">getMethods</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#0000FF;">$methodTable</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$methods</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$method</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$reflectionMethod</span> = <span style="color:#000000; font-weight:bold;">new</span> ReflectionMethod<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$className</span>, <span style="color:#0000FF;">$method</span>-&gt;<span style="color:#006600;">name</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$methodComment</span> = <span style="color:#0000FF;">$method</span>-&gt;<span style="color:#006600;">getDocComment</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$methodTableEntry</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$methodTableEntry</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'access'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = MethodTable::<span style="color:#006600;">getAccess</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$methodComment</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$methodTableEntry</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'description'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#0000FF;">$reflectionMethod</span>-&gt;<span style="color:#006600;">getDocComment</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$methodTableEntry</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'arguments'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = MethodTable::<span style="color:#006600;">getParameters</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$reflectionMethod</span>-&gt;<span style="color:#006600;">getParameters</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$methodTable</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$method</span>-&gt;<span style="color:#006600;">name</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#0000FF;">$methodTableEntry</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#616100;">return</span> <span style="color:#0000FF;">$methodTable</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">/**</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* Returns the access property of a method.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">*</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* @param $methodComment The comment of the method as returned from the reflection API.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* @return String</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">*/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/static"><span style="color:#000066;">static</span></a> private <span style="color:#000000; font-weight:bold;">function</span> getAccess<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$methodComment</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#616100;">return</span> MethodTable::<span style="color:#006600;">getTagComment</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$methodComment</span>, <span style="color:#FF0000;">"@access"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">/**</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* Returns the parameters from a ReflectionParameter list.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">*</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* @param $reflectionParameter An instance of ReflectionParameter.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* @return Array</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">*/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/static"><span style="color:#000066;">static</span></a> private <span style="color:#000000; font-weight:bold;">function</span> getParameters<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$reflectionParameter</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#0000FF;">$parameters</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$reflectionParameter</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$parameter</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$parameters</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#0000FF;">$parameter</span>-&gt;<span style="color:#006600;">getName</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#616100;">return</span> <span style="color:#0000FF;">$parameters</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">/**</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* Returns the comment next to a tag.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">*</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* @param $comment The comment of the method.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* @param $tag The tag to return its comment from.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* @return String</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">*/</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/static"><span style="color:#000066;">static</span></a> private <span style="color:#000000; font-weight:bold;">function</span> getTagComment<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$comment</span>, <span style="color:#0000FF;">$tag</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#0000FF;">$tagPosition</span> = <a href="http://www.php.net/strpos"><span style="color:#000066;">strpos</span></a> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$comment</span>, <span style="color:#0000FF;">$tag</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$tagPosition</span> === <span style="color:#000000; font-weight:bold;">false</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">return</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#0000FF;">$comment</span> = <a href="http://www.php.net/trim"><span style="color:#000066;">trim</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/substr"><span style="color:#000066;">substr</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$comment</span>, <span style="color:#0000FF;">$tagPosition</span> + <a href="http://www.php.net/strlen"><span style="color:#000066;">strlen</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$tag</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#0000FF;">$tagComment</span> = <a href="http://www.php.net/substr"><span style="color:#000066;">substr</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$comment</span>, <span style="color:#CC66CC;color:#800000;">0</span>, <a href="http://www.php.net/strpos"><span style="color:#000066;">strpos</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$comment</span>, <a href="http://www.php.net/chr"><span style="color:#000066;">chr</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">13</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#616100;">return</span> <span style="color:#0000FF;">$tagComment</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>Update: </strong>I added this file to the AMFPHP CVS today (10/01/2005).<br />
The project can be viewed at <a href="http://www.sourceforge.net/projects/amfphp/">http://www.sourceforge.net/projects/amfphp/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.herrodius.com/blog/4/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>AMFPHP: Multiple service calls</title>
		<link>http://www.herrodius.com/blog/2</link>
		<comments>http://www.herrodius.com/blog/2#comments</comments>
		<pubDate>Wed, 05 Jan 2005 14:58:39 +0000</pubDate>
		<dc:creator>Christophe</dc:creator>
				<category><![CDATA[AMFPHP]]></category>

		<guid isPermaLink="false">http://www.herrodius.com/blog/?p=2</guid>
		<description><![CDATA[Problem: When you try to call 2 or more services at the same time, it's possible that AMFPHP will return an error saying that the class of the service you're using is not known to the gateway. no class named yourService is known to the gateway Solution: Check the setBaseClassPath() method in your gateway.php file. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem:</strong> When you try to call 2 or more services at the same time, it's possible that AMFPHP will return an error saying that the class of the service you're using is not known to the gateway.</p>
<p><em>no class named yourService is known to the gateway</em></p>
<p><strong>Solution: </strong>Check the setBaseClassPath() method in your gateway.php file. It should use and absolute path instead of a relative path. You can change it like this.</p>
<div class="igBar"><span id="lphp-24"><a href="#" onclick="javascript:showPlainTxt('php-24'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-24">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//before</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$gateway</span>-&gt;<span style="color:#006600;">setBaseClassPath</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"./services/"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//after</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$gateway</span>-&gt;<span style="color:#006600;">setBaseClassPath</span><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/realpath"><span style="color:#000066;">realpath</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"services/"</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">"/"</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>After this change you should be able to call 2 or more services at the same time. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.herrodius.com/blog/2/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

