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

<channel>
	<title>The ClickPro.com Articles</title>
	<atom:link href="http://theclickpro.com/articles/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://theclickpro.com/articles</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 04 Sep 2008 14:09:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Eclipse PHP and Remote Editing</title>
		<link>http://theclickpro.com/articles/?p=26</link>
		<comments>http://theclickpro.com/articles/?p=26#comments</comments>
		<pubDate>Thu, 04 Sep 2008 14:09:25 +0000</pubDate>
		<dc:creator>ricardo</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[PDT]]></category>
		<category><![CDATA[RSE]]></category>

		<guid isPermaLink="false">http://theclickpro.com/articles/?p=26</guid>
		<description><![CDATA[Eclipse PDT (former PHP IDE) is a free alternative to expensive PHP IDEs.  It comes loaded with a lot of features and a large plugin database.   One of the most usefull plugins is the Remote System Explorer (RSE). The Remote System Explorer (RSE) allows you to work remotely over the internet.  For this article, I [...]]]></description>
			<content:encoded><![CDATA[<p>Eclipse PDT (former PHP IDE) is a free alternative to expensive PHP IDEs.  It comes loaded with a lot of features and a large plugin database.   One of the most usefull plugins is the <em>Remote System Explorer (RSE)</em>. The <em>Remote System Explorer (RSE)</em> allows you to work remotely over the internet.  For this article, I explain how to mount a remote PHP project over SSH.</p>
<p>Eclipse PDT Installation</p>
<p>The easies way to install Eclipse PDT is to download the latest all-in-one version from <a href="http://www.eclipse.org/pdt/">http://www.eclipse.org/pdt/</a>.  Once on the page:</p>
<ul>
<li>Click on the Download link.</li>
<li>Find the latest release (stable release is recommended).</li>
<li>Look for All-in-one option and click on the link corresponding to your platform (Linux, Max, Windows).</li>
<li>Once downloaded, Uncompress the file and open the <em>eclipse</em> executable</li>
</ul>
<p>Installing the Remote System Explorer (RSE)</p>
<p>Once your eclipse platform is open</p>
<ul>
<li>Click on the <em><strong>Help</strong></em> menu.</li>
<li>Navigate your way to <strong><em>Software Updates</em></strong> and click on <strong><em>&#8220;Find and Install&#8230;&#8221;</em></strong>.</li>
<li>The &#8220;<strong><em>Feature Updates&#8221;</em></strong> window will open, then Select <strong><em>&#8220;Search for new features to install&#8221;</em></strong> and click on <strong><em>Next</em></strong>.</li>
<li>Check the the <strong><em>&#8220;Europa Discovery Site&#8221;</em></strong> and click on <em><strong>Finish</strong></em>.</li>
<li>On the <strong><em>&#8220;Update Site Mirrors&#8221;</em></strong> window, select a mirror or just click <strong><em>OK</em></strong>.</li>
<li>On the <strong><em>&#8220;Search Results&#8221;</em></strong> window, expand the <em><strong>&#8220;Europa Discovery Site&#8221;.</strong></em></li>
<li>Check the <em><strong>&#8220;Remote Access and Device Development&#8221;</strong></em> box, then click on the <strong>&#8220;Select Required&#8221;</strong> button.</li>
<li>Click <strong><em>Next</em></strong>.</li>
<li>Accept the terms and click on <strong><em>Next</em></strong>.</li>
<li>Click on <em><strong>Finish.</strong></em> (wait for the software to download)</li>
<li>When the &#8220;Verification&#8221; window pops up, click on <em><strong>&#8220;Install All&#8221;.</strong></em></li>
<li>After installation is complete, say <strong><em>&#8220;Yes&#8221;</em></strong> to restart the eclipse.</li>
</ul>
<p>Open the<em> Remote System Explorer</em> Perspective</p>
<ul>
<li>Click on the <em><strong>Window</strong></em> menu.</li>
<li>Navigate to <strong><em>&#8220;Open Perspective&#8221;</em></strong> and click on <strong><em>&#8220;Other&#8230;&#8221;</em></strong>.</li>
<li>Select <strong><em>&#8220;Remote System Explorer&#8221;</em></strong> and and click <em><strong>OK</strong></em>.</li>
<li>Click on the <em><strong>&#8220;Define a connection to remote system&#8221;</strong></em> icon.<a href="http://theclickpro.com/articles2/wp-content/uploads/2008/09/define_a_connection.png"><img class="alignnone size-medium wp-image-21" title="Define a connection to remote system" src="http://theclickpro.com/articles2/wp-content/uploads/2008/09/define_a_connection.png" alt="Define a connection to remote system" width="292" height="186" /></a></li>
<li>Select the &#8220;SSH Only&#8221; as the System Type, and click on <strong><em>Next</em></strong>.<a href="http://theclickpro.com/articles2/wp-content/uploads/2008/09/new_connection_window.png"><img class="alignnone size-medium wp-image-22" title="Select Connection Type" src="http://theclickpro.com/articles/wp-content/uploads/2008/09/new_connection_window-284x300.png" alt="Select Connection Type" width="284" height="300" /></a></li>
<li>Type the Host Name of the SSH Server and click on Finish.<a href="http://theclickpro.com/articles2/wp-content/uploads/2008/09/new_connection_window_host.png"><img class="alignnone size-medium wp-image-23" title="Type Host Name" src="http://theclickpro.com/articles/wp-content/uploads/2008/09/new_connection_window_host-284x300.png" alt="Type Host Name" width="284" height="300" /></a></li>
<li>Navigate your way to the folder that has your PHP code.  While doing this, Eclipse will ask you for your login credentials. Type your SSH Login and Password and click OK.<a href="http://theclickpro.com/articles2/wp-content/uploads/2008/09/ssh_navigate_directories.png"><img class="alignnone size-medium wp-image-24" title="ssh navigation" src="http://theclickpro.com/articles/wp-content/uploads/2008/09/ssh_navigate_directories-213x300.png" alt="ssh navigation" width="213" height="300" /></a><a href="http://theclickpro.com/articles2/wp-content/uploads/2008/09/ssh_login_window.png"><img class="alignnone size-medium wp-image-25" title="eclipse ssh login credentials" src="http://theclickpro.com/articles2/wp-content/uploads/2008/09/ssh_login_window.png" alt="eclipse ssh login credentials" width="277" height="249" /></a></li>
<li>Once you find the folder you are looking for, Right-Click on it, and click on <em><strong>&#8220;Create Remote Project&#8221;. </strong></em>Depending on the size of the project this could take a while.</li>
<li>Now you should be able to open your PHP prospective by clicking on the <strong><em>Window -&gt; Open Prospective -&gt; &#8220;Other &#8230;&#8221;</em></strong> menu.  Then slect <em><strong>PHP</strong></em> from the list and click <em><strong>OK</strong></em>.</li>
</ul>
<p>This is it, You should now be able to work remotely as if it where on the local machine.</p>
<p>Note:  If your PDT Eclipse doesn&#8217;t recognize the project as a PHP Project, then you must manually edit the .project file on the remote server and add the following code:</p>
<p>Between the &lt;buildSpec&gt; tags add:</p>
<p style="padding-left: 60px;"><span style="color: #008080;"> &lt;buildCommand&gt;<br />
&lt;name&gt;org.eclipse.php.core.PhpIncrementalProjectBuilder&lt;/name&gt;<br />
&lt;arguments&gt;<br />
&lt;/arguments&gt;<br />
&lt;/buildCommand&gt;<br />
&lt;buildCommand&gt;<br />
&lt;name&gt;org.eclipse.php.core.ValidationManagerWrapper&lt;/name&gt;<br />
&lt;arguments&gt;<br />
&lt;/arguments&gt;<br />
&lt;/buildCommand&gt;</span></p>
<p>and between the &lt;nature&gt; Tags add:</p>
<p style="padding-left: 60px;"><span style="color: #008080;"> &lt;nature&gt;org.eclipse.php.core.PHPNature&lt;/nature&gt;</span></p>
<p>Then Restart Eclipse.</p>
<p style="padding-left: 60px;">
<p><strong>Enjoy</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://theclickpro.com/articles/?feed=rss2&amp;p=26</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Protocol Wrapper to parse PHP</title>
		<link>http://theclickpro.com/articles/?p=18</link>
		<comments>http://theclickpro.com/articles/?p=18#comments</comments>
		<pubDate>Thu, 21 Aug 2008 05:31:22 +0000</pubDate>
		<dc:creator>ricardo</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SOAP]]></category>
		<category><![CDATA[Dynamic]]></category>
		<category><![CDATA[WSDL]]></category>

		<guid isPermaLink="false">http://theclickpro.com/articles/?p=18</guid>
		<description><![CDATA[Why do I need a protocol wrapper to parse a PHP file?
There are some cases in which one wants to pass a dynamic string to a function that only takes a file path.  One of those cases is the SoapServer class in PHP. The SoapServer class takes the $WSDL argument as a local file path.  [...]]]></description>
			<content:encoded><![CDATA[<h3>Why do I need a protocol wrapper to parse a PHP file?</h3>
<p>There are some cases in which one wants to pass a dynamic string to a function that only takes a file path.  One of those cases is the SoapServer class in PHP. The SoapServer class takes the $WSDL argument as a local file path.  If you ever needed to have a dynamic WSDL file for different customers you would probably know what I&#8217;m talking about.</p>
<h3>Creating the Protocol/Wrapper to parse a file using PHP</h3>
<p>The trick here is to use the PHP function stream_wrapper_register to define a protocol that parses PHP.</p>
<p>1. create a class handler for the new protocol wrapper.  Click on the link to see the code.</p>
<p><a href="http://theclickpro.com/articles/wp-content/uploads/2008/08/phpstreamphp.src">PhpFileStream.php</a></p>
<p>Note that I have added functionality to accept a query string.</p>
<p>2. Create your dynamic file</p>
<p><em>hello.php</em><br />
<code><br />
Hello &lt;?=$this-&gt;first_name?&gt;!<br />
</code></p>
<p>3. Register your Protocol/Wrapper some where in your code and use it!</p>
<p><code><br />
&lt;?php<br />
//include the class<br />
include('PhpFileStream.php');<br />
//<br />
//register the wrapper<br />
stream_wrapper_register('phpfile', 'PhpFileStream');<br />
//<br />
//you can now pass the file path with the new protocol wrapper and it will be parsed<br />
echo file_get_contents('phpfile:///./hello.php?first_name=John');<br />
</code></p>
<p>This code will print:</p>
<p><code><br />
Hello John!<br />
</code></p>
<p>Note that You can pass a URL encoded query string to the file.  The values can be accessed from within the file using $this-&gt;<em>[key_name]</em> in the target file.</p>
<p>Now all you would have to do If you ever needed to create a dynamic WSDL file was to use the class I provide here and pass the wrapper path this way:</p>
<p><code><br />
&lt;?php<br />
//...<br />
SoapServer('phpfile:///path/to/dynamic.wsdl?key1=val1&amp;key2=val2');<br />
//...<br />
</code></p>
<p>Now you should be able to include PHP code in you WSDL for you dynamic needs</p>
<p>Enjoy</p>
]]></content:encoded>
			<wfw:commentRss>http://theclickpro.com/articles/?feed=rss2&amp;p=18</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Soap Testing Tool</title>
		<link>http://theclickpro.com/articles/?p=17</link>
		<comments>http://theclickpro.com/articles/?p=17#comments</comments>
		<pubDate>Thu, 24 Jul 2008 02:41:56 +0000</pubDate>
		<dc:creator>ricardo</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://theclickpro.com/articles/?p=17</guid>
		<description><![CDATA[The soap testing tool allows users to input a WSDL file and test a SOAP Api on a Web Interface.  The steps to test a SOAP interface are:

Provide an address to your WSDL, then hit save.
Click on the function desired to be tested.
Scroll down and fill in the function parameters, if any.
click on submit
Check the [...]]]></description>
			<content:encoded><![CDATA[<p>The soap testing tool allows users to input a WSDL file and test a SOAP Api on a Web Interface.  The steps to test a SOAP interface are:</p>
<ol>
<li>Provide an address to your WSDL, then hit save.</li>
<li>Click on the function desired to be tested.</li>
<li>Scroll down and fill in the function parameters, if any.</li>
<li>click on submit</li>
<li>Check the results in the &#8220;Return Dump&#8221;, &#8220;SOAP Request&#8221; and &#8220;SOAP Response&#8221;</li>
</ol>
<p>Soap Interface: <a href="http://theclickpro.com/soapTest.php">http://theclickpro.com/soapTest.php</a></p>
<p>Enjoy</p>
]]></content:encoded>
			<wfw:commentRss>http://theclickpro.com/articles/?feed=rss2&amp;p=17</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Writing valid HTML or XHTML</title>
		<link>http://theclickpro.com/articles/?p=14</link>
		<comments>http://theclickpro.com/articles/?p=14#comments</comments>
		<pubDate>Thu, 29 May 2008 16:13:40 +0000</pubDate>
		<dc:creator>ricardo</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[sgml]]></category>
		<category><![CDATA[validator]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://theclickpro.com/articles/?p=14</guid>
		<description><![CDATA[More than 98% of the web pages out there do not pass the W3C validation.  You can verify this by running your favorite site on the W3C validation page.  It&#8217;s very hard for web developers to keep track of every closing &#8216;/&#8217; (slash) on single tags or ALT text on images, specially when you [...]]]></description>
			<content:encoded><![CDATA[<p>More than 98% of the web pages out there do not pass the <a href="http://validator.w3.org/">W3C validation</a>.  You can verify this by running your favorite site on the <a href="http://validator.w3.org/">W3C validation page</a>.  It&#8217;s very hard for web developers to keep track of every closing &#8216;/&#8217; (slash) on single tags or ALT text on images, specially when you are in a project that has a dead line of Yesterday!, sounds familiar?</p>
<p>If you want to write perfect HTML or XHTML code, I recommend installing the <a href="http://users.skynet.be/mgueury/mozilla/index.html">HTML Validator Plug-in</a> for Firefox.  The HTML Validator Plug-in places it self in on the status bar.</p>
<p><a href="http://theclickpro.com/articles2/wp-content/uploads/2008/05/htmlvalidator.png"><img class="alignnone size-medium wp-image-15" title="Html Validator Image" src="http://theclickpro.com/articles2/wp-content/uploads/2008/05/htmlvalidator.png" alt="Html Validator" width="207" height="44" /></a></p>
<p>It gives you live validation for any web site you visit.  It will also give you tips on how to fix your code when double clicking on the icon.</p>
<p>After installing this plugin, you will be amazed (annoyed) to know how many web sites have broken HTML.</p>
]]></content:encoded>
			<wfw:commentRss>http://theclickpro.com/articles/?feed=rss2&amp;p=14</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MySQL Hierarchical Data</title>
		<link>http://theclickpro.com/articles/?p=13</link>
		<comments>http://theclickpro.com/articles/?p=13#comments</comments>
		<pubDate>Wed, 21 May 2008 14:52:09 +0000</pubDate>
		<dc:creator>ricardo</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[data structure]]></category>
		<category><![CDATA[datastructure]]></category>
		<category><![CDATA[hierarchi]]></category>
		<category><![CDATA[hierarchical]]></category>
		<category><![CDATA[model]]></category>
		<category><![CDATA[structure]]></category>
		<category><![CDATA[tree]]></category>

		<guid isPermaLink="false">http://theclickpro.com/articles/?p=13</guid>
		<description><![CDATA[Two common ways of storing hierarchical data in MySQL are the Adjacency List Model and the Nested Set Model.  The Adjacency uses a `parent id` to determine de parent of a record. The Nested Set Model uses the `left` and `right` values to determine the parent.


Adjacency List Model
Pros

Easy to implement
Queries are simpler to write
Fast updates
Fast [...]]]></description>
			<content:encoded><![CDATA[<p>Two common ways of storing hierarchical data in MySQL are the Adjacency List Model and the Nested Set Model.  The Adjacency uses a `parent id` to determine de parent of a record. The Nested Set Model uses the `left` and `right` values to determine the parent.</p>
<p><strong><br />
</strong></p>
<p><strong>Adjacency List Model</strong></p>
<p><strong>Pros</strong></p>
<ul>
<li>Easy to implement</li>
<li>Queries are simpler to write</li>
<li>Fast updates</li>
<li>Fast Inserts</li>
</ul>
<p><strong>Cons</strong></p>
<ul>
<li>Retrieving the data is slower since it requires recursion to do it.</li>
</ul>
<p><strong>Nested Set Model</strong></p>
<p><strong>Pros</strong></p>
<ul>
<li>Faster selects.</li>
<li>Indefinite number of levels since with one query.</li>
</ul>
<p><strong>Cons</strong></p>
<ul>
<li>Queries are a little bit more complicated to write.</li>
<li>Updates are slow since multiple rows have to be updated.</li>
<li>Inserts are slower since multiple rows have to be updated.</li>
</ul>
<p><strong><br />
</strong></p>
<p><strong>Sample table structure for Adjacency List Model:</strong></p>
<pre>CREATE TABLE category(
category_id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(20) NOT NULL,
parent INT DEFAULT NULL);</pre>
<p><strong>Sample Table Structure for Nested Set Model:</strong></p>
<pre>CREATE TABLE nested_category (
 category_id INT AUTO_INCREMENT PRIMARY KEY,
 name VARCHAR(20) NOT NULL,
 lft INT NOT NULL,
 rgt INT NOT NULL
);</pre>
<p>For more information on how to use these models visit the MySQL article by Mike Hillyer at <a href="http://http://dev.mysql.com/tech-resources/articles/hierarchical-data.html">http://dev.mysql.com/tech-resources/articles/hierarchical-data.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://theclickpro.com/articles/?feed=rss2&amp;p=13</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Forward mail to another MTA (overwriting the php mail() function)</title>
		<link>http://theclickpro.com/articles/?p=9</link>
		<comments>http://theclickpro.com/articles/?p=9#comments</comments>
		<pubDate>Fri, 09 May 2008 01:38:14 +0000</pubDate>
		<dc:creator>ricardo</dc:creator>
				<category><![CDATA[Mail]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[overwrite]]></category>

		<guid isPermaLink="false">http://theclickpro.com/articles/?p=7</guid>
		<description><![CDATA[This post explains how to forward all the mail for an existing site using an MTA other than the site&#8217;s server it self. The usual technique to achieve this is to configure the local MTA to forward all the mail to another server. In this document I apply a different technique that overwrites the mail() [...]]]></description>
			<content:encoded><![CDATA[<p>This post explains how to forward all the mail for an existing site using an MTA other than the site&#8217;s server it self. The usual technique to achieve this is to configure the local MTA to forward all the mail to another server. In this document I apply a different technique that overwrites the mail() function call to the `sendmail` command.</p>
<p>The advantage of this technique is that no extra headers are added to the message envelope. Why it is necessary to avoid adding extra headers differs from business to business.</p>
<p>Note: the technique here only applies to web applications running on *Nix machines. Windows machines running PHP applications can provide host and port in the php.ini or the apache configuration to achieve the same results.</p>
<p>Overwriting the sendmail Call</p>
<p>There is a couple of ways the `sendmail` path can be overwritten. The most common one is the php.ini and the least common one the php_admin_value directive in the apache configuration. We are going focus on the later one since this directive gives us the possibility to change the value for a single site on a machine that runs multiple virtual web accounts.</p>
<p>Configuration:</p>
<p>1. AS root create a directory for your `sendmail` replacement<br />
<code>mkdir -p /usr/local/forwarder</code></p>
<p>2. Download the SMTP Class.<br />
<code>wget http://theclickpro.com/articles/wp-content/uploads/2008/05/smtpclassphp.txt -O /usr/local/forwarder/smtp.class.php</code></p>
<p>3. Download the sendmail replacement script<br />
<code>wget http://theclickpro.com/articles/wp-content/uploads/2008/05/mailphp.txt -O /usr/local/forwarder/mail.php</code></p>
<p>4. Open the mail.php file on your favorite editor and change the $HOST, $default_from and<br />
$default_return_path variables to suit your needs.<br />
<code><br />
$HOST = 'mail.example.com'; //mx server to forward to<br />
$default_from = '"Web Master" &lt;webmaster@example.com&gt;'; //default from line<br />
$default_return_path = '&lt;mailer-daemon@example.com&gt;'; // address to deliver the bounces to</code></p>
<p>5. Open your Apache virtual host configuration file for your domain and put the following line some where close to the &lt;VirtualHost&gt; or &lt;/VirtualHost&gt; tags<br />
<code>php_admin_value sendmail_path /usr/local/bin/forwarder/mail.php</code></p>
<p>6. Restart you Apache server.</p>
<p>Enjoy</p>
]]></content:encoded>
			<wfw:commentRss>http://theclickpro.com/articles/?feed=rss2&amp;p=9</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
