<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Webconsults Europe - Software Engineering Consulting and Training for Web Development</title>
    <link>http://webconsults.eu/</link>
    <description>Webconsults Europe - Software Engineering Consulting and Training for Web Development</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.5.1 - http://www.s9y.org/</generator>
    <pubDate>Tue, 03 Apr 2012 07:48:07 GMT</pubDate>

    <image>
        <url>http://webconsults.eu/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Webconsults Europe - Software Engineering Consulting and Training for Web Development - Webconsults Europe - Software Engineering Consulting and Training for Web Development</title>
        <link>http://webconsults.eu/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>symfony controller testing</title>
    <link>http://webconsults.eu/archives/74-symfony-controller-testing.html</link>
    
    <comments>http://webconsults.eu/archives/74-symfony-controller-testing.html#comments</comments>
    <wfw:comment>http://webconsults.eu/wfwcomment.php?cid=74</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://webconsults.eu/rss.php?version=2.0&amp;type=comments&amp;cid=74</wfw:commentRss>
    

    <author>nospam@example.com (John Behrens)</author>
    <content:encoded>
    http://avalanche123.com/blog/page/2/ 
    </content:encoded>

    <pubDate>Thu, 08 Mar 2012 15:11:26 +0100</pubDate>
    <guid isPermaLink="false">http://webconsults.eu/archives/74-guid.html</guid>
    
</item>
<item>
    <title>Reset Jenkins Continious Integration Server Password</title>
    <link>http://webconsults.eu/archives/70-Reset-Jenkins-Continious-Integration-Server-Password.html</link>
            <category>Tools</category>
    
    <comments>http://webconsults.eu/archives/70-Reset-Jenkins-Continious-Integration-Server-Password.html#comments</comments>
    <wfw:comment>http://webconsults.eu/wfwcomment.php?cid=70</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://webconsults.eu/rss.php?version=2.0&amp;type=comments&amp;cid=70</wfw:commentRss>
    

    <author>nospam@example.com (John Behrens)</author>
    <content:encoded>
    If you need to reset the password of a Jenkins Continious Integration server.

Stop Jenkins:
usually /etc/init.d/jenkins stop

edit the config.xml
usually: /var/lib/jenkins/config.xml
Replace &lt;useSecurity&gt;true&lt;/useSecurity&gt;
New &lt;useSecurity&gt;false&lt;/useSecurity&gt;

Possibly remove the Authorization configuration
&lt;authorizationStrategy class=&quot;hudson.security.FullControlOnceLoggedInAuthorizationStrategy&quot;/&gt;


Restart the Server:
usually /etc/init.d/jenkins start

Now your Jenkins is absolutely insecure, you can just go to the web interface and edit users password.
Do not forget to change back the security configuration, this could be done by a config.xml backup or through the web interface.

 
    </content:encoded>

    <pubDate>Fri, 28 Oct 2011 19:57:41 +0200</pubDate>
    <guid isPermaLink="false">http://webconsults.eu/archives/70-guid.html</guid>
    
</item>
<item>
    <title>Zend_Captcha_Image in action</title>
    <link>http://webconsults.eu/archives/68-Zend_Captcha_Image-in-action.html</link>
            <category>PHP</category>
    
    <comments>http://webconsults.eu/archives/68-Zend_Captcha_Image-in-action.html#comments</comments>
    <wfw:comment>http://webconsults.eu/wfwcomment.php?cid=68</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://webconsults.eu/rss.php?version=2.0&amp;type=comments&amp;cid=68</wfw:commentRss>
    

    <author>nospam@example.com (John Behrens)</author>
    <content:encoded>
    I just had to build in a Captcha to a simple form on a small side, i thought of using the Zend_Captcha_ReCaptcha but also saw some disadvantages.

- Re Captcha is the most common used captcha, if anybody will build a universal spam bot, ReCaptcha might be first target to implement.
- Re Captcha depends on a service so if you implement it your site will also depend on this service

Implementing a Zend_Captcha_Image is pretty simple, it is not looking as nice as Re Captcha but also works. 
here is the code.
&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$captchaImgDir&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;path/to/were/images/will/be/written&#039;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$captcha&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;path/to/trueTypeFontFile.ttf&#039;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160;&lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;addElement&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; Zend_Form_Element_Captcha&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;captcha&#039;&lt;/span&gt;, &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;captcha&#039;&lt;/span&gt; =&amp;gt; &lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;captcha&#039;&lt;/span&gt; =&amp;gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;Image&#039;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;height&#039;&lt;/span&gt;&amp;#160; =&amp;gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;40&#039;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;font&#039;&lt;/span&gt;&amp;#160; &amp;#160; =&amp;gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$captchaFont&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;imgDir&#039;&lt;/span&gt;&amp;#160; =&amp;gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$captchaImgDir&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;wordLen&#039;&lt;/span&gt; =&amp;gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;3&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;timeout&#039;&lt;/span&gt; =&amp;gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;300&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160;&lt;/div&gt;
The Zend_Captcha_Image has no standard view renderer, that is why we use the render function
&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?&lt;/span&gt;=&lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;formLabel&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;captcha&#039;&lt;/span&gt;, &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;Security Code&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;?&amp;gt;&amp;lt;br /&amp;gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?&lt;/span&gt;=&lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;form&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;getElement&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;captcha&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;render&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; ;?&amp;gt;&amp;lt;br /&amp;gt;&amp;#160; &amp;#160; &lt;br /&gt;&amp;#160;&lt;/div&gt;
If there is time, i might implement a ultimate captcha solution, using Randomly choosen Zend_Captcha implementation this means a spambot would also have to implement different solutions.


 
    </content:encoded>

    <pubDate>Tue, 09 Aug 2011 18:29:25 +0200</pubDate>
    <guid isPermaLink="false">http://webconsults.eu/archives/68-guid.html</guid>
    
</item>
<item>
    <title>Shortnote: Disable all Form Fields Zend_Form</title>
    <link>http://webconsults.eu/archives/66-Shortnote-Disable-all-Form-Fields-Zend_Form.html</link>
            <category>PHP</category>
    
    <comments>http://webconsults.eu/archives/66-Shortnote-Disable-all-Form-Fields-Zend_Form.html#comments</comments>
    <wfw:comment>http://webconsults.eu/wfwcomment.php?cid=66</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://webconsults.eu/rss.php?version=2.0&amp;type=comments&amp;cid=66</wfw:commentRss>
    

    <author>nospam@example.com (John Behrens)</author>
    <content:encoded>
    It is possible to disable all form fields using Zend Framework Zend_Form class.
maybe if the form is already send and you wanna display the data again inside form for optical reasons.

&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$form&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; My_Zend_Form_Class&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;foreach&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$form&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;getElements&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;as&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$element&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #0000ff;&quot;&gt;$element&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;setAttrib&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;disabled&#039;&lt;/span&gt;, &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #0000ff;&quot;&gt;$element&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;setAttrib&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;readonly&#039;&lt;/span&gt;,&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;
This is not a serios possibility to avoid a form beeing send twice a CSRF token would be much more useful. 
    </content:encoded>

    <pubDate>Tue, 09 Aug 2011 16:43:12 +0200</pubDate>
    <guid isPermaLink="false">http://webconsults.eu/archives/66-guid.html</guid>
    
</item>
<item>
    <title>PHP 5 Reflection access privat methods</title>
    <link>http://webconsults.eu/archives/64-PHP-5-Reflection-access-privat-methods.html</link>
            <category>PHP</category>
    
    <comments>http://webconsults.eu/archives/64-PHP-5-Reflection-access-privat-methods.html#comments</comments>
    <wfw:comment>http://webconsults.eu/wfwcomment.php?cid=64</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://webconsults.eu/rss.php?version=2.0&amp;type=comments&amp;cid=64</wfw:commentRss>
    

    <author>nospam@example.com (John Behrens)</author>
    <content:encoded>
    There were highly idiologic discussions about if you should test your privates or not with unit testing or not,
in my opinion especially during Development with private methods performing for example calculations it could be useful to Unit Test these.
At least during development you make sure that these functions already work, and finally it´s better to change accessibility than just to set accessibility lower to make testing possible. Before PHP 5.3.2 it was not possible to change the accessibility but with the new ReflectionMethod it is.
But this feature needs to be used with care, it´s made for unit testing and maybe very special other cases wich are not in my mind yet.
Using some magic reflection stuff always makes code very hard to read, maybe you think it´s fance but others might get confused a lot.
&lt;br /&gt;
Using the ReflectionMethod introduced in PHP 5.3.2 &lt;br /&gt;
&lt;a href=&quot;http://de.php.net/manual/en/reflectionmethod.setaccessible.php&quot;&gt;ReflectionMethod::SetAccesible&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://de.php.net/manual/de/reflectionmethod.setaccessible.php&quot;&gt;ReflectionMethod Class&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;

PHP Unit Developer Sebastian Bergmann wrote an article about &lt;a href=&quot;http://sebastian-bergmann.de/archives/881-Testing-Your-Privates.html&quot;&gt;Testing Your Privates&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://thephp.cc/&quot;&gt;Sebastians Bergmann&lt;/a&gt;s Example:&lt;br /&gt;
&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; FooTest extends PHPUnit_Framework_TestCase&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; testPrivateMethod&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$method&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; ReflectionMethod&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;Foo&#039;&lt;/span&gt;, &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;doSomethingPrivate&#039;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$method&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;setAccessible&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;TRUE&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;assertEquals&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;blah&#039;&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$method&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;invoke&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; Foo&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;

 
    </content:encoded>

    <pubDate>Mon, 29 Mar 2010 15:00:33 +0200</pubDate>
    <guid isPermaLink="false">http://webconsults.eu/archives/64-guid.html</guid>
    
</item>
<item>
    <title>Fake Zend Framework isXmlHttpRequest for Unit Testing</title>
    <link>http://webconsults.eu/archives/62-Fake-Zend-Framework-isXmlHttpRequest-for-Unit-Testing.html</link>
            <category>PHP</category>
    
    <comments>http://webconsults.eu/archives/62-Fake-Zend-Framework-isXmlHttpRequest-for-Unit-Testing.html#comments</comments>
    <wfw:comment>http://webconsults.eu/wfwcomment.php?cid=62</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://webconsults.eu/rss.php?version=2.0&amp;type=comments&amp;cid=62</wfw:commentRss>
    

    <author>nospam@example.com (John Behrens)</author>
    <content:encoded>
    To manipulate the result Zend_Controller_Request_Http::isXmlHttpRequest() 
maybe for testing XML Controllers in PHP Unit you just need to set the HTTP_X_REQUESTED_WITH value to XMLHttpRequest
Zend_Controller_Request_Http::isXmlHttpRequest() does nothing more than checking for this.
&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&amp;#160;&lt;span style=&quot;color: #0000ff;&quot;&gt;$_SERVER&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;HTTP_X_REQUESTED_WITH&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;XMLHttpRequest&quot;&lt;/span&gt;;&lt;br /&gt;&amp;#160;&lt;/div&gt;


Zend_Controller_Request_Http::isXmlHttpRequest() from Zend Framework Code
&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; isXmlHttpRequest&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;getHeader&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;X_REQUESTED_WITH&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; == &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;XMLHttpRequest&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;

&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; getHeader&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$header&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;........&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$temp&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;HTTP_&#039;&lt;/span&gt; . &lt;a href=&quot;http://www.php.net/strtoupper&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;strtoupper&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/str_replace&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;str_replace&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;-&#039;&lt;/span&gt;, &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;_&#039;&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$header&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;!&lt;a href=&quot;http://www.php.net/empty&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;empty&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$_SERVER&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$temp&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$_SERVER&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$temp&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;;&lt;br /&gt;&amp;#160;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt; 
    </content:encoded>

    <pubDate>Tue, 23 Mar 2010 13:31:52 +0100</pubDate>
    <guid isPermaLink="false">http://webconsults.eu/archives/62-guid.html</guid>
    
</item>
<item>
    <title>Remove Duplicated Entries from MySQL Table</title>
    <link>http://webconsults.eu/archives/61-Remove-Duplicated-Entries-from-MySQL-Table.html</link>
            <category>Database</category>
    
    <comments>http://webconsults.eu/archives/61-Remove-Duplicated-Entries-from-MySQL-Table.html#comments</comments>
    <wfw:comment>http://webconsults.eu/wfwcomment.php?cid=61</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://webconsults.eu/rss.php?version=2.0&amp;type=comments&amp;cid=61</wfw:commentRss>
    

    <author>nospam@example.com (John Behrens)</author>
    <content:encoded>
    This is a short tutorial how to remove duplicated entries from MySQL DB Table

First idea was just to do a simple DELETE statement on a SubSelect 
&lt;div class=&quot;sql&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;DELETE&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; user &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;WHERE&lt;/span&gt; id &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;IN&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; u2.id &lt;br /&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; user &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AS&lt;/span&gt; u1&lt;br /&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;JOIN&lt;/span&gt; user &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AS&lt;/span&gt; u2 &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ON&lt;/span&gt; u1.name=u2.name&lt;br /&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;WHERE&lt;/span&gt;&amp;#160; u1.id &amp;lt; u2.id&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;
Unfortunatelly this gives back an error message.
&lt;em&gt;#1093 - You can&#039;t specify target table &#039;ex_user&#039; for update in FROM clause &lt;/em&gt;
MySQL Documentation says about that
&lt;blockquote&gt;
Error 1093 (ER_UPDATE_TABLE_USED)
SQLSTATE = HY000
Message = &quot;You can&#039;t specify target table &#039;x&#039;
for update in FROM clause&quot;

This error occurs in cases such as the following:

UPDATE t1 SET column2 = (SELECT MAX(column1) FROM t1);

You can use a subquery for assignment within an UPDATE statement because subqueries are legal in UPDATE and DELETE statements as well as in SELECT statements. However, you cannot use the same table (in this case, table t1) for both the subquery&#039;s FROM clause and the update target. 
&lt;/blockquote&gt;
I was searching for a solution without using temporary table but didn´t find one yet. 

&lt;div class=&quot;sql&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;CREATE&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;TEMPORARY&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;TABLE&lt;/span&gt; duplicated_temp&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;id INT&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; TYPE=HEAP;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;INSERT&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;INTO&lt;/span&gt; duplicated_temp &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; u2.id&amp;#160; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; ex_user &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AS&lt;/span&gt; u1 &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;JOIN&lt;/span&gt; user &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AS&lt;/span&gt; u2 &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ON&lt;/span&gt; u1.name=u2.name &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;WHERE&lt;/span&gt; u1.id &amp;lt; u2.id;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;DELETE&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; user &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;WHERE&lt;/span&gt; id &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;IN&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; id &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; duplicated_temp &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;WHERE&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;DROP&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;TABLE&lt;/span&gt; duplicated_temp;&lt;br /&gt;&amp;#160;&lt;/div&gt;
Well thats it. 
 
    </content:encoded>

    <pubDate>Mon, 08 Feb 2010 14:13:38 +0100</pubDate>
    <guid isPermaLink="false">http://webconsults.eu/archives/61-guid.html</guid>
    
</item>
<item>
    <title>Dynamic Model for Zend Framework</title>
    <link>http://webconsults.eu/archives/60-Dynamic-Model-for-Zend-Framework.html</link>
            <category>PHP</category>
    
    <comments>http://webconsults.eu/archives/60-Dynamic-Model-for-Zend-Framework.html#comments</comments>
    <wfw:comment>http://webconsults.eu/wfwcomment.php?cid=60</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://webconsults.eu/rss.php?version=2.0&amp;type=comments&amp;cid=60</wfw:commentRss>
    

    <author>nospam@example.com (John Behrens)</author>
    <content:encoded>
    I always liked some kind of auto generated model to access a database. 
I liked it the way Symfony does or the Zend Framework Tool.
But anytime using a generator is also a bit of mess.
The actual Zend Framework quickstart example has a 3 files way of implementing a Model, a Model Class, Model Mapper Class and Model DB Table ClassFew,
so for one DB Table you always have to create 3 classes which look almost similar, most times you just copy and paste those, and change a few things.

So i decided to create an very flexible model class, where you just need to define the properties and nothing more getter and sette methods will be called by magic functions. Even it has export function to an array.

You don´t have to create anything but you can create your own functions for getter and setter methods which would override the default ones.
In later state it could be possible to add a filter configurable in the model, but for first step i would like to keep it as slim as possible.


&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; Dynmodel_Model&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; protected &lt;span style=&quot;color: #0000ff;&quot;&gt;$_id&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; protected &lt;span style=&quot;color: #0000ff;&quot;&gt;$_created&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; __construct&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$options&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/is_array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;is_array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$options&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;setOptions&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$options&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Magic Call function&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// @param &amp;lt;type&amp;gt; $name&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// @param &amp;lt;type&amp;gt; $arguments&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//@return &amp;lt;type&amp;gt; &lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; __call&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$name&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$arguments&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/substr&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;substr&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$name&lt;/span&gt;,&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #cc66cc;&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;==&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;set&quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;__set&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/substr&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;substr&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$name&lt;/span&gt;,&lt;span style=&quot;color: #cc66cc;&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;,&lt;span style=&quot;color: #0000ff;&quot;&gt;$arguments&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/substr&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;substr&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$name&lt;/span&gt;,&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #cc66cc;&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;==&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;get&quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt;&amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;__get&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/substr&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;substr&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$name&lt;/span&gt;,&lt;span style=&quot;color: #cc66cc;&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; throw &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; Exception&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;Method &#039;&lt;/span&gt;.&lt;span style=&quot;color: #0000ff;&quot;&gt;$name&lt;/span&gt;.&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039; not Supported&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Magic Setter Class&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// @param &amp;lt;type&amp;gt; $name&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// @param &amp;lt;type&amp;gt; $value &lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; __set&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$name&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$value&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$method&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;set&#039;&lt;/span&gt; . &lt;span style=&quot;color: #0000ff;&quot;&gt;$name&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$propertyName&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;_&quot;&lt;/span&gt;.lcfirst&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$name&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/method_exists&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;method_exists&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$method&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/method_exists&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;method_exists&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$method&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;elseif&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;mapper&#039;&lt;/span&gt; == &lt;span style=&quot;color: #0000ff;&quot;&gt;$name&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; || !property_exists&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$propertyName&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; throw &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; Exception&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;Invalid Property &#039;&lt;/span&gt;.&lt;span style=&quot;color: #0000ff;&quot;&gt;$propertyName&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;elseif&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;property_exists&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$propertyName&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$propertyName&lt;/span&gt;=&lt;span style=&quot;color: #0000ff;&quot;&gt;$value&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Magic getter class&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// @param &amp;lt;type&amp;gt; $name&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// @return &amp;lt;type&amp;gt; &lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; __get&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$name&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$method&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;get&#039;&lt;/span&gt; . &lt;span style=&quot;color: #0000ff;&quot;&gt;$name&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$propertyName&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;_&quot;&lt;/span&gt;.lcfirst&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$name&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/method_exists&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;method_exists&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$method&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$method&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;elseif&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;mapper&#039;&lt;/span&gt; == &lt;span style=&quot;color: #0000ff;&quot;&gt;$name&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; || !property_exists&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$propertyName&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; throw &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; Exception&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;Invalid Property &#039;&lt;/span&gt;.&lt;span style=&quot;color: #0000ff;&quot;&gt;$propertyName&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt;&amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$propertyName&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; setOptions&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$options&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$methods&lt;/span&gt; = &lt;a href=&quot;http://www.php.net/get_class_methods&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;get_class_methods&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;foreach&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$options&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;as&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$key&lt;/span&gt; =&amp;gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$value&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$method&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;set&#039;&lt;/span&gt; . &lt;a href=&quot;http://www.php.net/ucfirst&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;ucfirst&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$key&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/in_array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;in_array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$method&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$methods&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$method&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$value&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Returning the Objects as Array&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// @return Array&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; toArray&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$values&lt;/span&gt;=&lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/get_object_vars&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;get_object_vars&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;as&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$pkey&lt;/span&gt; =&amp;gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$pvalue&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/substr&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;substr&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$pkey&lt;/span&gt;,&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;==&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;_&quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$arrkey&lt;/span&gt;=&lt;a href=&quot;http://www.php.net/substr&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;substr&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$pkey&lt;/span&gt;,&lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$call&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;get&quot;&lt;/span&gt;.&lt;a href=&quot;http://www.php.net/ucfirst&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;ucfirst&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/substr&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;substr&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$arrkey&lt;/span&gt;,&lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//calling value through objects get function&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$values&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$arrkey&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;=&lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$call&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$values&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;
The Danymic DBTable and DynamicMapper class are not tested yet, will post theme here later.
 
    </content:encoded>

    <pubDate>Mon, 08 Feb 2010 00:27:19 +0100</pubDate>
    <guid isPermaLink="false">http://webconsults.eu/archives/60-guid.html</guid>
    
</item>
<item>
    <title>Zend Framework PHP based SOAP Server with Java JAX-RPC client</title>
    <link>http://webconsults.eu/archives/58-Zend-Framework-PHP-based-SOAP-Server-with-Java-JAX-RPC-client.html</link>
            <category>PHP</category>
    
    <comments>http://webconsults.eu/archives/58-Zend-Framework-PHP-based-SOAP-Server-with-Java-JAX-RPC-client.html#comments</comments>
    <wfw:comment>http://webconsults.eu/wfwcomment.php?cid=58</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://webconsults.eu/rss.php?version=2.0&amp;type=comments&amp;cid=58</wfw:commentRss>
    

    <author>nospam@example.com (John Behrens)</author>
    <content:encoded>
    This example shows how to create an Zend Framework based SOAP Server and connect to it by a Java Client. The process itself is really easy but some things ara a  bit tricky for example at the status were i created it there were some problems if using WS style for the SOAP Server so i decided to use RPC style. The Server basically allows a user to logon by credentials and gives back a userstatus, the Java Client is connecting through this service and requesting the userstatus. 


&lt;strong&gt;The Soap Server Class&lt;/strong&gt;
&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// orginal code has phpdoc compatible comments with slash star&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// SoapUserServer Class&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// @author&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Description of SoapUserServer&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// @author johny&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; Example_SoapUserServer &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Returns Api Version&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// @return string getApiVersion&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; getApiVersion&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$apiVersion&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;0.9.3&quot;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$apiVersion&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// getUser&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Returns user Status for a given Username, Password combination&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// @param string $username&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// @param string $password&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// @return string getUserResponse&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; getUser&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$username&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$password&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$adapter&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; Example_AuthAdapter&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$username&lt;/span&gt;,&lt;span style=&quot;color: #0000ff;&quot;&gt;$password&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$userStatus&lt;/span&gt;=&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;false&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//retrive login&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$auth&lt;/span&gt;&amp;#160; &amp;#160; = Zend_Auth::&lt;span style=&quot;color: #006600;&quot;&gt;getInstance&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$auth&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;authenticate&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$adapter&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$acl&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; Zend_Acl&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$auth&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;!&lt;span style=&quot;color: #0000ff;&quot;&gt;$auth&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;hasIdentity&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//user not valid&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$userStatus&lt;/span&gt;=&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;false&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//user okay&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//@todo dynamic membership types&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$membership&lt;/span&gt;=&lt;span style=&quot;color: #0000ff;&quot;&gt;$auth&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;getIdentity&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;getMembership&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$membership&lt;/span&gt; &amp;amp;&amp;amp;amp; &lt;span style=&quot;color: #0000ff;&quot;&gt;$membership&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;getMembershipTypeId&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&amp;gt;=&lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$userStatus&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;premiummember&quot;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$userStatus&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;normalmember&quot;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$userStatus&lt;/span&gt;!=&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$userStatus&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;wrong credentials&quot;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;

&lt;strong&gt;Zend Controller for the Soap Server&lt;/strong&gt;

&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; SoapController extends Zend_Controller_Action&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Zend Soap Server Action&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Representing the soap Server&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;///&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; serverAction&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/isset&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;isset&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$_GET&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;wsdl&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$autodiscover&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; Zend_Soap_AutoDiscover&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$autodiscover&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;setBindingStyle&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;style&#039;&lt;/span&gt; =&amp;gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;rpc&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$autodiscover&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;setClass&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;Example_SoapUserServer&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$autodiscover&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;handle&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/exit&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;exit&lt;/span&gt;&lt;/a&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// disabling WSDL cache cause we are still in Development&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/ini_set&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;ini_set&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;soap.wsdl_cache_enabled&quot;&lt;/span&gt;, &lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;0&quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$server&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; SoapServer&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;http://example.com/soap/server?wsdl&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$server&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;setClass&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;Example_SoapUserServer&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$server&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;handle&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;_helper-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;viewRenderer&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;setNoRender&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;_helper-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;layout&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;disableLayout&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;


Java Client Code

With Netbeans a webservice client is really easy to create, right click on the project create new &quot;Web Service Client&quot;
More Information:
&lt;a href=&quot;http://netbeans.org/kb/docs/websvc/jax-ws.html&quot;&gt;http://netbeans.org/kb/docs/websvc/jax-ws.html&lt;/a&gt;
JAX RPC Style works better with Zend Framework and PHP.
The Stub and Port classes will be Auto generated by Netbeans, so you don´t need to worry about that.

&lt;div class=&quot;java&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;package eu.&lt;span style=&quot;color: #006600;&quot;&gt;webconsults&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;myapp&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;userauth&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #a1a100;&quot;&gt;import java.rmi.RemoteException;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #a1a100;&quot;&gt;import myapp.userauth.Example_SoapUserServerPort_Stub;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #a1a100;&quot;&gt;import myapp.userauth.Example_SoapUserServerService_Impl;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// User Authorization class using Soap Server&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// @author johny&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; UserAuth &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;a href=&quot;http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;amp;bntl=1&quot;&gt;&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt;&lt;/a&gt; username = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;a href=&quot;http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;amp;bntl=1&quot;&gt;&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt;&lt;/a&gt; password = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;a href=&quot;http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;amp;bntl=1&quot;&gt;&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt;&lt;/a&gt; usertype = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;a href=&quot;http://www.google.com/search?q=allinurl%3ABoolean+java.sun.com&amp;amp;bntl=1&quot;&gt;&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;Boolean&lt;/span&gt;&lt;/a&gt; isAuthorized = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;false&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; Example_SoapUserServerPort_Stub stub;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Authenticating remote&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// @param username&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// @param password&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;///&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; UserAuth&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;amp;bntl=1&quot;&gt;&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt;&lt;/a&gt; username, &lt;a href=&quot;http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;amp;bntl=1&quot;&gt;&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt;&lt;/a&gt; password&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;username&lt;/span&gt; = username;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;password&lt;/span&gt;=password;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;retrieveRemoteUserStatus&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Retriving remote User Status from Stub&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&amp;#160; @return&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;///&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;a href=&quot;http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;amp;bntl=1&quot;&gt;&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt;&lt;/a&gt; retrieveRemoteUserStatus&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;try&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;usertype&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;getStub&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;getUser&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;username&lt;/span&gt;, &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;password&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;!&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;usertype&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;equals&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;wrong credentials&quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;isAuthorized&lt;/span&gt;=&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;true&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;isAuthorized&lt;/span&gt;=&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;false&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;catch&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.google.com/search?q=allinurl%3ARemoteException+java.sun.com&amp;amp;bntl=1&quot;&gt;&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;RemoteException&lt;/span&gt;&lt;/a&gt; re&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;a href=&quot;http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;amp;bntl=1&quot;&gt;&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;System&lt;/span&gt;&lt;/a&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;out&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;println&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Remote Exception&quot;&lt;/span&gt;+re.&lt;span style=&quot;color: #006600;&quot;&gt;getMessage&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;usertype&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// @return&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;private&lt;/span&gt; Example_SoapUserServerPort_Stub getStub&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;stub&lt;/span&gt; == &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;stub&lt;/span&gt;=&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;Example_SoapUserServerPort_Stub&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; Example_SoapUserServerService_Impl&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;getExample_SoapUserServerPort&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;stub&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Getting Username&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// @return&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;a href=&quot;http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;amp;bntl=1&quot;&gt;&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt;&lt;/a&gt; getUsername&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;username&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Getting Password&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// @return&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;a href=&quot;http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;amp;bntl=1&quot;&gt;&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt;&lt;/a&gt; getPassword&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;password&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Returning Usertype&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// @return&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;a href=&quot;http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;amp;bntl=1&quot;&gt;&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt;&lt;/a&gt; getUsertype&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;usertype&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt; 
    </content:encoded>

    <pubDate>Thu, 21 Jan 2010 13:22:27 +0100</pubDate>
    <guid isPermaLink="false">http://webconsults.eu/archives/58-guid.html</guid>
    
</item>
<item>
    <title>Osapi Session Storage</title>
    <link>http://webconsults.eu/archives/57-Osapi-Session-Storage.html</link>
    
    <comments>http://webconsults.eu/archives/57-Osapi-Session-Storage.html#comments</comments>
    <wfw:comment>http://webconsults.eu/wfwcomment.php?cid=57</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://webconsults.eu/rss.php?version=2.0&amp;type=comments&amp;cid=57</wfw:commentRss>
    

    <author>nospam@example.com (John Behrens)</author>
    <content:encoded>
    Using the OSAPI Open Social API, i noticed there is no session storage available by default,
so this is a very quick way to implement a PHP-Session Bages Storage
&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Session Storage implements Openid Storage Inside PHP Session,&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//for me the easiest way to handle openId data&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Description of osapiSessionStorage&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//@author John Behrens (john.behrens@webconsults.eu)&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; osapiSessionStorage extends osapiStorage&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Retrieves the data for the given key, or false if they&lt;/span&gt;&lt;br /&gt;&amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// key is unknown or expired&lt;/span&gt;&lt;br /&gt;&amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// @param String $key The key who&#039;s data to retrieve&lt;/span&gt;&lt;br /&gt;&amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// @param int $expiration Experiration time in seconds&lt;/span&gt;&lt;br /&gt;&amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; get&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$key&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$expiration&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;!&lt;a href=&quot;http://www.php.net/isset&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;isset&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$_SESSION&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;osapi&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;false&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/isset&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;isset&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$_SESSION&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;osapi&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$key&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$_SESSION&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;osapi&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$key&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;false&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//Store the key =&amp;gt; $value set. The $value is serialized&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// by this function so can be of any type&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//@param String $key Key of the data&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// @param Any-type $value the data&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; set&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$key&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$value&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$_SESSION&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;osapi&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$key&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;=&lt;span style=&quot;color: #0000ff;&quot;&gt;$value&lt;/span&gt;;&lt;br /&gt;&amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Removes the key/data pair for the given $key&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// @param String $key&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;&amp;#160; public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; delete&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$key&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &lt;a href=&quot;http://www.php.net/unset&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;unset&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$_SESSION&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;osapi&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$key&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;
 
    </content:encoded>

    <pubDate>Tue, 29 Dec 2009 01:23:46 +0100</pubDate>
    <guid isPermaLink="false">http://webconsults.eu/archives/57-guid.html</guid>
    
</item>
<item>
    <title>One more reason why Symfony **cks</title>
    <link>http://webconsults.eu/archives/56-One-more-reason-why-Symfony-cks.html</link>
    
    <comments>http://webconsults.eu/archives/56-One-more-reason-why-Symfony-cks.html#comments</comments>
    <wfw:comment>http://webconsults.eu/wfwcomment.php?cid=56</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://webconsults.eu/rss.php?version=2.0&amp;type=comments&amp;cid=56</wfw:commentRss>
    

    <author>nospam@example.com (John Behrens)</author>
    <content:encoded>
    I was working with &lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;form_remote_tag&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt; which is a usefull function if you create forms using AJAX request.
Simple usage is easy
&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?php&lt;/span&gt; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; form_remote_tag&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;update&#039;&lt;/span&gt;&amp;#160; &amp;#160;=&amp;gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;item_list&#039;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;url&#039;&lt;/span&gt;&amp;#160; &amp;#160; &amp;#160; =&amp;gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;item/add&#039;&lt;/span&gt;,&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt; 
Executes the URL Item Add and replaces content of the Element with item_list with it´s result.
Well what i would like to now is a Form which is permanent viewable and will reset itself if sended.

What i guessed 
&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?php&lt;/span&gt; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; form_remote_tag&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;update&#039;&lt;/span&gt;&amp;#160; &amp;#160;=&amp;gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;list&#039;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;url&#039;&lt;/span&gt;&amp;#160; &amp;#160; &amp;#160; =&amp;gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;entrys/create&#039;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;complete&#039;&lt;/span&gt; =&amp;gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Form.reset(&#039;myForm&#039;)&quot;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;id&#039;&lt;/span&gt;=&amp;gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;myForm&#039;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;
Well who that doesn´t work,
form_remote_tag doesnt know an property called id, you have to hang it behind as html code
&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?php&lt;/span&gt; &lt;a href=&quot;http://www.php.net/echo&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;echo&lt;/span&gt;&lt;/a&gt; form_remote_tag&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;update&#039;&lt;/span&gt;&amp;#160; &amp;#160;=&amp;gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;list&#039;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;url&#039;&lt;/span&gt;&amp;#160; &amp;#160; &amp;#160; =&amp;gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;rntrys/create&#039;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;complete&#039;&lt;/span&gt; =&amp;gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Form.reset(&#039;myForm&#039;)&quot;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;,&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;id=&#039;myForm&#039; &quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;
This way it works, too bad the documentation on it is that poor. But &lt;a href=&quot;http://www.mellowmorning.com/2007/08/18/ten-reasons-why-symfony-rocks-part-1/&quot;&gt;10 Reasons why Symfony **cks&lt;/a&gt; helped me out finding the right solution.
However i still think updating a whole element with the list is the wrong way, i would like to use JSON and DOM Manipulation for that, to add exact one entry to the list, i gonna work that out now. 


 
    </content:encoded>

    <pubDate>Thu, 22 Oct 2009 16:43:41 +0200</pubDate>
    <guid isPermaLink="false">http://webconsults.eu/archives/56-guid.html</guid>
    
</item>
<item>
    <title>Tooltip Div with Jquery</title>
    <link>http://webconsults.eu/archives/53-Tooltip-Div-with-Jquery.html</link>
    
    <comments>http://webconsults.eu/archives/53-Tooltip-Div-with-Jquery.html#comments</comments>
    <wfw:comment>http://webconsults.eu/wfwcomment.php?cid=53</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://webconsults.eu/rss.php?version=2.0&amp;type=comments&amp;cid=53</wfw:commentRss>
    

    <author>nospam@example.com (John Behrens)</author>
    <content:encoded>
    Searching the web i found a lot of solutions and &lt;a href=&quot;http://www.tagdocs.de/2009/07/17/3-jquery-plugins-von-mopstudio-lightbox-slider-und-tooltip/&quot;&gt;ToolTip Plugins&lt;/a&gt; wie z.b. &lt;a href=&quot;http://webdemar.com/webdesign/tooltips-mit-simpletip-jquery-plugin/&quot;&gt;Simpletip&lt;/a&gt; oder&lt;a href=&quot;http://blog.beatsundbytes.de/really-simple-tooltips-jquery-plugin&quot;&gt; really simple tooltop&lt;/a&gt;, but after i had a short look at some i decided that they are all more or less usefull.
The most usuable entry i found was a short entry at &lt;a href=&quot;http://stackoverflow.com/questions/158070/jquery-how-to-position-one-element-relative-to-another&quot;&gt;Stackoverflow&lt;/a&gt; telling me anything i need to know.

My basic requirement was, Javascript code has to be Seperated from the design and the Webpage content.
So my php template looks like this
&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$entrys&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;as&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$entry&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;: &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;lt;div id=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;entrylink_&amp;lt;?=$entry-&amp;gt;id?&amp;gt;&quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;a href=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;&amp;amp;lt;?=$entry-&amp;amp;gt;link?&amp;amp;gt;&quot;&lt;/span&gt; onMouseOver=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;showEntryPreview(&#039;&amp;lt;?=$entry-&amp;gt;id?&amp;gt;&#039;)&quot;&lt;/span&gt;&amp;#160; onMouseOut=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;hideEntryPreview(&#039;&amp;lt;?=$entry-&amp;gt;id?&amp;gt;&#039;)&quot;&lt;/span&gt;&amp;gt;&amp;lt;?=&lt;span style=&quot;color: #0000ff;&quot;&gt;$entry&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;name&lt;/span&gt;?&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;div id=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;entryinfo_&amp;lt;?=$entry-&amp;gt;id?&amp;gt;&quot;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;entry_preview&quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;... some more information ....&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;?enforeach;?&amp;gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;
So this was set cause whoever willing to change the content or layer of the tool-tip or preview div, however you like to call it, should be able to change it without touching the JS functionallity. 
So what i need to added now was CSS definition to hide tool-tip layer.
&lt;div class=&quot;css&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;.entry_preview&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;position&lt;/span&gt;:&lt;span style=&quot;color: #993333;&quot;&gt;absolute&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;z-index&lt;/span&gt;:&lt;span style=&quot;color: #cc66cc;&quot;&gt;999&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;left&lt;/span&gt;:-9999px;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;background-color&lt;/span&gt;:#FF0000;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;padding&lt;/span&gt;:5px;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; border&lt;span style=&quot;color: #3333ff;&quot;&gt;:1px &lt;/span&gt;solid #fff;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;width&lt;/span&gt;:250px;&lt;br /&gt;&amp;#160;&lt;/div&gt;
So anybody could change layout later.
Now everything is needed is not an&lt;a href=&quot;http://guidesigner.net/ajax/best-collection-of-useful-jquery-tooltip-plugins-and-tutorials/&quot;&gt; extra plugin&lt;/a&gt; or &lt;a href=&quot;http://guidesigner.net/ajax/best-collection-of-useful-jquery-tooltip-plugins-and-tutorials/&quot;&gt;collection of plugins&lt;/a&gt; it´s just a few lines of JS code using &lt;a href=&quot;http://webstandard.kulando.de/post/2008/09/12/best-of-jquery-tutorials&quot;&gt;jquery&lt;/a&gt;

&lt;div class=&quot;javascript&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt; showUserInfo&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;entryId&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; divOverlay=$&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;#entrylink_&#039;&lt;/span&gt;+entryId&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; divParent=$&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;#entryinfo_&#039;&lt;/span&gt;+entryId&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; parentPosition=divParent.&lt;span style=&quot;color: #006600;&quot;&gt;position&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; parentWidth=divParent.&lt;span style=&quot;color: #006600;&quot;&gt;width&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;var&lt;/span&gt; parentHeight=divParent.&lt;span style=&quot;color: #006600;&quot;&gt;height&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; divOverlay.&lt;span style=&quot;color: #006600;&quot;&gt;css&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;left&#039;&lt;/span&gt;, parentPosition.&lt;span style=&quot;color: #006600;&quot;&gt;left&lt;/span&gt;+parentWidth&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; divOverlay.&lt;span style=&quot;color: #006600;&quot;&gt;css&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;top&#039;&lt;/span&gt;, parentPosition.&lt;span style=&quot;color: #006600;&quot;&gt;top&lt;/span&gt;+parentHeight&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; divOverlay.&lt;span style=&quot;color: #006600;&quot;&gt;css&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;visibility&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;visible&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt; hideUserInfo&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;entryId&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;$&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;#entryinfo_&#039;&lt;/span&gt;+userId&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;css&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;visibility&#039;&lt;/span&gt;, &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;hidden&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;

I always wonder wy people code so many plugins for just so simple things, keep anything more complicated. Okay maybe it´s easier reusable but through most of them will not be maintained in one year or maybe are already lying arround for month, it is easier to just do it yourself.
Even this solutions has some Advantages cause the Tooltip Div is already existing inside the site, Javascript doesnt need to pass through all links like for example &lt;a href=&quot;http://www.exforsys.com/tutorials/jquery/jquery-tooltips.html&quot;&gt;here&lt;/a&gt;. And also a crawler would be able to read the content of the Tooltip Divs easiely.
But however in some cases it makes sense to read the content of the Tooltip-Layers later for example if they requery more data, big pictures, calculations etc,
it might be an option to read them later by Ajax Request.
 
    </content:encoded>

    <pubDate>Mon, 12 Oct 2009 16:46:03 +0200</pubDate>
    <guid isPermaLink="false">http://webconsults.eu/archives/53-guid.html</guid>
    
</item>
<item>
    <title>Sending and Rendering Emails with Zend Framework</title>
    <link>http://webconsults.eu/archives/49-Sending-and-Rendering-Emails-with-Zend-Framework.html</link>
            <category>PHP</category>
    
    <comments>http://webconsults.eu/archives/49-Sending-and-Rendering-Emails-with-Zend-Framework.html#comments</comments>
    <wfw:comment>http://webconsults.eu/wfwcomment.php?cid=49</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://webconsults.eu/rss.php?version=2.0&amp;type=comments&amp;cid=49</wfw:commentRss>
    

    <author>nospam@example.com (John Behrens)</author>
    <content:encoded>
    It took me a little while to figure out to solve a standard problem like sending an template or view script as email, the main problem is the original documentation doesn´t show anything about it, just sending email with text from a string, and if you search on the web, you find mostly the same thing or solutions which were not satisfying me.


&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//Rendering mail template to string&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$mail_view&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; Zend_View&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&amp;#160; &amp;#160;&amp;#160; &amp;#160;&amp;#160; &amp;#160;&amp;#160; &amp;#160;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$mail_view&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; Zend_View&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;/&amp;lt;strong&amp;gt;&lt;br /&gt;&amp;#160;&amp;lt;/strong&amp;gt; This will only work inside the MVC vontroller and&lt;br /&gt;&amp;#160;&amp;lt;strong&amp;gt; handle over script path to the email view renderer&lt;br /&gt;&amp;#160;&amp;lt;/strong&amp;gt;/&amp;#160; &amp;#160; &amp;#160;&amp;#160; &amp;#160; &amp;#160;&amp;#160; &amp;#160; &amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160; &amp;#160; &lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$mail_view&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;addScriptPath&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;view&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;getScriptPaths&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$strMailBody&lt;/span&gt;=&lt;span style=&quot;color: #0000ff;&quot;&gt;$mail_view&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;render&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;controllername/mail.phtml&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//configuring email&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$email_recipient_mail&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;recipient@example.com&quot;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$email_recipient_name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Recipient Name&quot;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$email_subject&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Subject for the Email&quot;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$email_sender_email&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;sender@example.com&quot;&lt;/span&gt;;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$email_sender_name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Sender Name&quot;&lt;/span&gt;;&amp;#160; &lt;br /&gt;&amp;#160; &lt;br /&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//sending email with Zend_Mail()&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$mail&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; Zend_Mail &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$mail&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;setFrom&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$email_sender_email&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$email_sender_email&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$mail&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;addTo&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$email_recipient_mail&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$email_recipient_name&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$mail&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;setSubject&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$email_subject&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$mail&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;setBodyText&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$strMailBody&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$mail&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;send&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160;&lt;/div&gt;
The mail Template &quot;mail.phtml&quot; could contain text or HTML.

Finally i choosed out this method as the best for sending email in Zend Framework Projects,
maybe there would be one more better way, if i could put the subject inside the template file, i gonna save that for later.

 
    </content:encoded>

    <pubDate>Sun, 02 Aug 2009 02:18:32 +0200</pubDate>
    <guid isPermaLink="false">http://webconsults.eu/archives/49-guid.html</guid>
    
</item>
<item>
    <title>Internationalization in User Generated Enviorments</title>
    <link>http://webconsults.eu/archives/48-Internationalization-in-User-Generated-Enviorments.html</link>
    
    <comments>http://webconsults.eu/archives/48-Internationalization-in-User-Generated-Enviorments.html#comments</comments>
    <wfw:comment>http://webconsults.eu/wfwcomment.php?cid=48</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://webconsults.eu/rss.php?version=2.0&amp;type=comments&amp;cid=48</wfw:commentRss>
    

    <author>nospam@example.com (John Behrens)</author>
    <content:encoded>
    User generated content in multilingual enviorments brings up new internationalizations problems,
in a social network or other enviorment with a lot of User Generated content, I18N could  not be sticked strictly to the user, and even a content or discussion could be spreaden through different languages. 
On usual websites a language is assigned to the frontend user, also on &lt;a href=&quot;http://www.Youtube.com&quot;&gt;Youtube&lt;/a&gt; where it causes some problems.
I always recieve Mails like
&lt;blockquote&gt;
Komentarze do filmu „&gt;videoname&lt;”
Comentario sobre &quot;&gt;videoname&lt;&quot; publicado
Reactie van &gt;userwhopostedcomment&lt; op  ,&gt;videoname&lt;&#039;
Nouveau commentaire sur &quot;&gt;videoname&lt;&quot;
Kommentar zu &quot;&gt;videoname&lt;&quot; gepostet&quot; gepostet
&lt;/blockquote&gt;
Which all mean your video ... has been commented by ..., but it´s alsways in the default language to the commentor, no matter what my language is and no matter which language the comment is Written in. Comments itself are mostly written in english or the language the video is in.
A solution could be to send it just in the recipient´s default language instead the actual frontend language, it would just make it easier for the recipient.


&lt;blockquote&gt;
Jeroen
- Moie Video, echt Leuk
   Tommy
   - Why are all the Comments in Dutch
     Franz
     - Die Holländer finden ihre Sprache so Toll
       Antje
       - Ihre Sprache ist auch Supertoll
       Joost
       - Duits is alleen voor Moffen
          Tommy
          - In English Please
          Joost
          - German is for Kauts Only
       Franz
       - Geh doch Käse essen du Kaaskopp
&lt;/blockquote&gt;
As you see users could communicate through different Languages, and maybe they even like it and switch Languages during a conversation,
if you wanna run your site with an international flavour this is acceptable.



Language Detection

Language Detection could be usefull, to translate auto detection for example, but you could also hide content with Language Detection

For Example: I got a Guestbook entry on my Dutch &lt;a href=&quot;http://www.netlog.com&quot;&gt;Netlog&lt;/a&gt;, somebody commentet the guestbook in  German with something like &quot;Hi ich habe ein bischen Deutsch gelernt, Wie geht es dir? viele grüsse&quot;. This entry were hidden cause it weren´t written in my actual frontend Language (Dutch),
but actually i had choosen German as native language in my profile.

So if you use something like Language Detection to hide content from foreign Languages, you must consider a user could be able to understand more than one language.
Hiding content from the user is mostly a bad decission, cause even if the user is not able to read information might be usefull.
The better way is always to sign the entry as an entry with different language and offer automated translation possibility.

Where it could make sense to hide content is if a user is doing a general search on contents, at least in order of the search results.









 
    </content:encoded>

    <pubDate>Thu, 30 Jul 2009 22:59:08 +0200</pubDate>
    <guid isPermaLink="false">http://webconsults.eu/archives/48-guid.html</guid>
    
</item>
<item>
    <title>Zend Debug Logger</title>
    <link>http://webconsults.eu/archives/45-Zend-Debug-Logger.html</link>
    
    <comments>http://webconsults.eu/archives/45-Zend-Debug-Logger.html#comments</comments>
    <wfw:comment>http://webconsults.eu/wfwcomment.php?cid=45</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://webconsults.eu/rss.php?version=2.0&amp;type=comments&amp;cid=45</wfw:commentRss>
    

    <author>nospam@example.com (John Behrens)</author>
    <content:encoded>
    http://extraordinaire.me/web-development/bootstrap-zend-framework/ 
    </content:encoded>

    <pubDate>Fri, 26 Jun 2009 16:53:59 +0200</pubDate>
    <guid isPermaLink="false">http://webconsults.eu/archives/45-guid.html</guid>
    
</item>

</channel>
</rss>
