<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>PHP Freaks Content</title>
    <link>http://www.phpfreaks.com/feed/all</link>
    <description>The latest tutorials and blog posts from PHP Freaks.</description>
    <pubDate>Sat, 04 Jul 2009 04:10:06 +0000</pubDate>
    <webMaster>contact@phpfreaks.com</webMaster>
    <generator>Zend_Feed</generator>
    <language>en-US</language>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/phpfreaks" type="application/rss+xml" /><feedburner:emailServiceId>phpfreaks</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
      <title><![CDATA[10 Ways to Avoid Writing Crappy Code]]></title>
      <link>http://feedproxy.google.com/~r/phpfreaks/~3/x8OddDu91BY/10-ways-to-avoid-writing-crappy-code</link>
      <guid isPermaLink="false">http://www.phpfreaks.com/blog/10-ways-to-avoid-writing-crappy-code</guid>
      <description>&lt;h3&gt;1. Learn OOP and common OO principles&lt;/h3&gt;&lt;p&gt;This is an absolute requirement. If you are still coding procedural, this is no small task. What are you waiting for?&lt;/p&gt;
&lt;h3&gt;1. Employ Test Driven Design&lt;/h3&gt;&lt;p&gt;Code that is buggy or simply doesn't work at all can safely be considered &amp;quot;crappy code&amp;quot;. TDD gives you the confidence that your code works, and the side effects force better and more flexible software design.&lt;/p&gt;
&lt;p&gt;If you are not familiar with TDD yet, and this post has prompted you to try it, be warned: at first it will seem very cumbersome. What definitely will help is this piece of advice, which is at the core of Test &lt;span style="text-decoration:underline"&gt;Driven&lt;/span&gt; Design: don't write tests afterwards, write them first. Without going to much into the details, and somewhat simplified the general mantra is this: write a test first, make it work by writing the application code, refactor, write another test, make it work, refactor, etc etc. It's a cycle. The application code follows the test code, not the other way around.&lt;/p&gt;
&lt;p&gt;I recommend PHPUnit. It has the most features and the largest adoption.&lt;/p&gt;
&lt;h3&gt;2. Refactor, refactor, refactor&lt;/h3&gt;&lt;p&gt;Refactoring means &amp;quot;to improve the design of existing code&amp;quot;. Making changes to code results in an increasing loss of quality of that code, this is known as &amp;quot;software decay&amp;quot;. To battle this phenomenon, you have to constantly evaluate if the code hasn't lost it's quality, and look for opportunities to improve the design beyond it's original. But there's a catch. And it isn't the time that refactoring takes, if you do it properly you'll save those hours by having avoided software decay. It is the risk of change.&lt;/p&gt;
&lt;p&gt;I can understand if you are hesitant to change code that works (at least for now). But this is where number two comes back into play: as long as you've written the right tests, you can make sure your changes don't break anything.&lt;/p&gt;
&lt;h3&gt;3. Simpler is better&lt;/h3&gt;&lt;p&gt;Your mind should constantly be waging a battle between simplicity and flexibility. Avoid unnecessary complication.&lt;/p&gt;
&lt;h3&gt;4. Use Design Patterns &lt;/h3&gt;&lt;p&gt;Design Patterns describe real world software design problem and solutions. Make sure you are familiar with them, buy some books. If you encounter a design problem that seems familiar take your trusty GoF and PoEAA from the shelf and look it up.&lt;/p&gt;
&lt;h3&gt;5. Don't Use Design Patterns &lt;/h3&gt;&lt;p&gt;Once you are familiar with Design Patterns, or even just with the existence of them, it can be tempting to start sprinkling pattern implementations over your application code, just because you can. Don't. Remember a Design Pattern consists of a problem and one or more solutions to that problem. Until you have the problem, don't use the solution. &lt;/p&gt;
&lt;h3&gt;6. Accept the limitations of your language&lt;/h3&gt;&lt;p&gt;Believe me, I know that  as a programmer it is difficult to accept limitations on bending your code to your will, but trying to change the behaviour of PHP is not the solution. PHP has limitations, you'll have to live with them. If you try to &amp;quot;patch&amp;quot; them, chances are you will do more harm than good.&lt;/p&gt;
&lt;h3&gt;7. Pretend you are writing a book&lt;/h3&gt;&lt;p&gt;It has been said that &amp;quot;code should be easy to read rather than easy to write&amp;quot;. Maybe somebody else will need to understand your code at some stage. Maybe two years from now, you will revisit this code and need to re-learn it's inner workings.&lt;/p&gt;
&lt;p&gt;Semantics, meaningful docblocks and clear execution flow are everything. Imagine reading an instruction manual without pictures, filled with meaningless abbreviations, and with the pages in arbitrary order, without page numbers. That's how someone, maybe you, will feel if you ignore this advice.&lt;/p&gt;
&lt;h3&gt;8. Peer Review&lt;/h3&gt;&lt;p&gt;Believe it or not, you don't know everything and you aren't always right. Nobody is. Getting a &amp;quot;second opinion&amp;quot; can only improve the end result.&lt;/p&gt;
&lt;h3&gt;9. E_STRICT is your friend &lt;/h3&gt;&lt;p&gt;Make sure your code runs properly with E_STRICT turned on. Although, if you have gotten this far, I don't think that will be a problem.&lt;/p&gt;
&lt;h3&gt;10. Create a distinction between &amp;quot;source code&amp;quot; and a &amp;quot;build&amp;quot;&lt;/h3&gt;&lt;p&gt;Even though PHP is an interpreted language, this is an important distinction in my opinion, even though practically noone employs this in the PHP world. A build in PHP is a copy of (part of) the source code, which includes assets like HTML, CSS and JavaScript, and is stripped of anything not necessary for running the application. Maybe your build is a Phar file, or maybe you have combined some source files into a single file (like the guys at Doctrine do). Maybe you can provide different build of the same project to server different purposes..&lt;/p&gt;
&lt;p&gt;How does this help you avoid crappy code? It allows you to have the source code and build differ, avoiding any compromises you might be tempted to make to facilitate runing or developing the application. Bonus points if you allow the user to choose between placing everything in the server document root or just a bootstrap and the static files.&lt;/p&gt;
&lt;p&gt;There are various build tools available, personally I use PHPUnderControl, which is a patch for CruiseControl and gives you a variety of build server features. It uses Ant by default, but I also use Phing.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/phpfreaks?a=x8OddDu91BY:LMDqp3ywlhA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/phpfreaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/phpfreaks?a=x8OddDu91BY:LMDqp3ywlhA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/phpfreaks?i=x8OddDu91BY:LMDqp3ywlhA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/phpfreaks?a=x8OddDu91BY:LMDqp3ywlhA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/phpfreaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/phpfreaks?a=x8OddDu91BY:LMDqp3ywlhA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/phpfreaks?i=x8OddDu91BY:LMDqp3ywlhA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/phpfreaks?a=x8OddDu91BY:LMDqp3ywlhA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/phpfreaks?i=x8OddDu91BY:LMDqp3ywlhA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/phpfreaks/~4/x8OddDu91BY" height="1" width="1"/&gt;</description>
      <pubDate>Fri, 03 Jul 2009 14:15:32 +0000</pubDate>
      <comments>http://www.phpfreaks.com/blog/10-ways-to-avoid-writing-crappy-code#comments</comments>
    <feedburner:origLink>http://www.phpfreaks.com/blog/10-ways-to-avoid-writing-crappy-code</feedburner:origLink></item>
    <item>
      <title><![CDATA[10 Signs of Crappy PHP Software]]></title>
      <link>http://feedproxy.google.com/~r/phpfreaks/~3/eIJ6VnDEJdw/10-signs-of-crappy-php-software</link>
      <guid isPermaLink="false">http://www.phpfreaks.com/blog/10-signs-of-crappy-php-software</guid>
      <description>&lt;p&gt;Like it or not, as a professional developer, sooner or later you are going to do some customising (if you are lucky, &amp;quot;extending&amp;quot;) of existing software.&lt;/p&gt;
&lt;p&gt;If you are not familiar with the software, it is good advice to look into it before accepting the job. I had to learn that the hard way. But how do you recognize crappy applications without getting knee deep into the code? 10 pointers to identify crappy PHP software quickly...&lt;/p&gt;
&lt;h3&gt;1. The software tries to reinvent the object model, or &amp;quot;fix&amp;quot; language features.&lt;/h3&gt;&lt;p&gt;See if you can find a class called &amp;quot;Object&amp;quot;. If you find it, it's a pretty clear indication that the author is in the business of trying to reinvent the object model (most commonly because of his own lacking understanding of OO). It is safe to assume that his &amp;quot;fixes&amp;quot; won't stop there. Unplug your phone and hide under your desk.&lt;/p&gt;
&lt;h3&gt;2. The code includes user defined global variables &lt;/h3&gt;&lt;p&gt;A search in the code for &amp;quot;global&amp;quot; or &amp;quot;$GLOBALS&amp;quot; may reveal something like this:&lt;/p&gt;
&lt;ol class="code"&gt;&lt;li&gt;global&amp;nbsp;$database,&amp;nbsp;$my,&amp;nbsp;$mainframe;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;The infamous global variable. If you can tell me what those last two variables contain you are either intimate with the software I pulled it from, or you're psychic. Unlimited bonus points if you can say what code has had it's claws on it before execution flow got to this point. In short, steer &lt;b&gt;well&lt;/b&gt; clear.&lt;/p&gt;
&lt;h3&gt;3. Scattered HTML and SQL&lt;/h3&gt;&lt;p&gt;Search for some common SQL and HTML strings. You should be able to determine very quickly whether these are appropriate places for HTML or SQL. If you find HTML and SQL in the same file, &amp;quot;crappyness&amp;quot; is most definitely confirmed.&lt;/p&gt;
&lt;h3&gt;4. Classes do too much&lt;/h3&gt;&lt;p&gt;Find the 3 largest class files by bit size. Take a look at the class name. Does it indicate a distinct responsibility? Look at the methods. Are the tasks they perform closely related? If not, run away screaming.&lt;/p&gt;
&lt;h3&gt;5. Lots of properties are public or lots of properties are static&lt;/h3&gt;&lt;p&gt;If lots of properties are declared &amp;quot;public static&amp;quot;, triple your quote. If I have to explain why, maybe there's an open position on the development team of the software for you.&lt;/p&gt;
&lt;h3&gt;6. Multiple levels of inheritance&lt;/h3&gt;&lt;p&gt;More than 2 levels inheritance should be avoided like the plague. I stake my life on the resulting objects having too much unrelated behaviour (ok, maybe not my life, but if you find a proper use of more than 2 levels of inheritance, I'll buy you a beer).&lt;/p&gt;
&lt;h3&gt;7. The authors &lt;span style="text-decoration:underline"&gt;try&lt;/span&gt; to use Design Patterns&lt;/h3&gt;&lt;p&gt;Whether or not the authors have a clue is easily determined by searching for some of the most common design patters. Search the code base and/or documentation for &amp;quot;factory&amp;quot;, &amp;quot;decorator&amp;quot;, &amp;quot;strategy&amp;quot; etc. If present, you can pretty quickly determine whether the authors know their stuff or are trying to look interesting. That is, if you know how the code should look. If not, refuse to take the project until you do.&lt;/p&gt;
&lt;h3&gt;8. The software messes with the error level&lt;/h3&gt;&lt;p&gt;Well written applications run fine at any error level. Searching the files for /error_level\(.*\)/ should do the trick. In case of hits, try replacing the value with E_STRICT. That's little more than a formality though.&lt;/p&gt;
&lt;h3&gt;9. In the code base, there is a directory called &amp;quot;core&amp;quot;&lt;/h3&gt;&lt;p&gt;This is usually used as an excuse to have the whole application dependent on whatever is in there. Despite the appeal of the term (it &lt;span style="text-decoration:underline"&gt;does&lt;/span&gt; make the contents sound pretty cool and important), defining a &amp;quot;core&amp;quot; is a sign of bad design.&lt;/p&gt;
&lt;h3&gt;10. The software uses it's own template language.&lt;/h3&gt;&lt;p&gt;Be afraid. Very afraid. These guys are definitely in the business of reinventing the wheel. Ignore this warning and you will find yourself spending the better part of a day simulating a &amp;quot;for&amp;quot; loop.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/phpfreaks?a=eIJ6VnDEJdw:OFHdvWl2xLk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/phpfreaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/phpfreaks?a=eIJ6VnDEJdw:OFHdvWl2xLk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/phpfreaks?i=eIJ6VnDEJdw:OFHdvWl2xLk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/phpfreaks?a=eIJ6VnDEJdw:OFHdvWl2xLk:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/phpfreaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/phpfreaks?a=eIJ6VnDEJdw:OFHdvWl2xLk:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/phpfreaks?i=eIJ6VnDEJdw:OFHdvWl2xLk:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/phpfreaks?a=eIJ6VnDEJdw:OFHdvWl2xLk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/phpfreaks?i=eIJ6VnDEJdw:OFHdvWl2xLk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/phpfreaks/~4/eIJ6VnDEJdw" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 02 Jul 2009 11:10:56 +0000</pubDate>
      <comments>http://www.phpfreaks.com/blog/10-signs-of-crappy-php-software#comments</comments>
    <feedburner:origLink>http://www.phpfreaks.com/blog/10-signs-of-crappy-php-software</feedburner:origLink></item>
    <item>
      <title><![CDATA[Using MySQL Administrator with WampServer]]></title>
      <link>http://feedproxy.google.com/~r/phpfreaks/~3/owFd9iY8PoA/using-mysql-administrator-with-wampserver</link>
      <guid isPermaLink="false">http://www.phpfreaks.com/blog/using-mysql-administrator-with-wampserver</guid>
      <description>&lt;p&gt;For those readers who do not develop PHP on Windows platform &lt;a href="http://www.wampserver.com/en/"&gt;WampServer&lt;/a&gt; is probably the most popular Apache + MySQL + PHP package for Windows. MySQL Administrator on the other hand, is a part of &lt;a href="http://dev.mysql.com/downloads/gui-tools/5.0.html"&gt;MySQL GUI Tools&lt;/a&gt; package.&lt;/p&gt;
&lt;p&gt;The problem with this pair, is that they don't want to work together. At least not right out of box. MySQL Administrator fails to find mysql service process as installed by WampServer. This leads to infamous 'Could not find settings' error message.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://img3.imageshack.us/img3/5092/couldnotfindsettings.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;You still will be able to use MySQL Administrator, but some of its features will be unavailable - among them quite important 'Startup variables' that lets you configure your server.&lt;/p&gt;
&lt;p&gt;The reason is simple. WampServer keeps MySQL's config file in a directory, that is not checked by MySQL Administrator's searching algorithm.&lt;/p&gt;
&lt;p&gt;Luckily, the solution is also simple.&lt;/p&gt;
&lt;p&gt;Open registry editor&lt;br /&gt;
Windows XP: Go to &lt;tt&gt;Start&lt;/tt&gt; &amp;gt; &lt;tt&gt;Run...&lt;/tt&gt;  type in &lt;tt&gt;regedit&lt;/tt&gt; and press Enter&lt;br /&gt;
Vista: Go to &lt;tt&gt;Start&lt;/tt&gt;, type &lt;tt&gt;regedit&lt;/tt&gt; into search box and press Enter&lt;/p&gt;
&lt;p&gt;A word of warning: be careful when using registry editor, as you might break your system if you change wrong variables.&lt;/p&gt;
&lt;p&gt;Using tree on the left go to:&lt;br /&gt;
&lt;tt&gt;HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\wampmysqld&lt;/tt&gt;&lt;/p&gt;
&lt;p&gt;In the window on the right find &lt;tt&gt;ImagePath&lt;/tt&gt; variable, double click it's name.&lt;/p&gt;
&lt;p&gt;In the dialog that opens you should see something like this:&lt;br /&gt;
&lt;tt&gt;c:\wamp\bin\mysql\mysql5.1.33\bin\mysqld.exe  wampmysqld&lt;/tt&gt;&lt;br /&gt;
(MySQL's version may vary)&lt;/p&gt;
&lt;p&gt;Change it like this:&lt;br /&gt;
&lt;tt&gt;&amp;quot;c:\wamp\bin\mysql\mysql5.1.33\bin\mysqld.exe&amp;quot; --defaults-file=&amp;quot;c:\wamp\bin\mysql\mysql5.1.33\my.ini&amp;quot; wampmysqld&lt;/tt&gt;&lt;br /&gt;
(be careful not to miss any double quotes!&lt;/p&gt;
&lt;p&gt;Close registry editor, then restart you MySQL server from WampServer's tray menu.&lt;/p&gt;
&lt;p&gt;MySQL Administrator should work fine now.&lt;/p&gt;
&lt;p&gt;That would be it ;)&lt;/p&gt;
&lt;p&gt;----&lt;/p&gt;
&lt;p&gt;&lt;a href="http://forums.mysql.com/read.php?34,128259,128297#msg-128297"&gt;MySQL Forums post, where I've found this solution&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/phpfreaks?a=owFd9iY8PoA:klud5IERs3o:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/phpfreaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/phpfreaks?a=owFd9iY8PoA:klud5IERs3o:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/phpfreaks?i=owFd9iY8PoA:klud5IERs3o:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/phpfreaks?a=owFd9iY8PoA:klud5IERs3o:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/phpfreaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/phpfreaks?a=owFd9iY8PoA:klud5IERs3o:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/phpfreaks?i=owFd9iY8PoA:klud5IERs3o:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/phpfreaks?a=owFd9iY8PoA:klud5IERs3o:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/phpfreaks?i=owFd9iY8PoA:klud5IERs3o:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/phpfreaks/~4/owFd9iY8PoA" height="1" width="1"/&gt;</description>
      <pubDate>Mon, 22 Jun 2009 16:38:35 +0000</pubDate>
      <comments>http://www.phpfreaks.com/blog/using-mysql-administrator-with-wampserver#comments</comments>
    <feedburner:origLink>http://www.phpfreaks.com/blog/using-mysql-administrator-with-wampserver</feedburner:origLink></item>
    <item>
      <title><![CDATA[SSH Auto-mount Network Share]]></title>
      <link>http://feedproxy.google.com/~r/phpfreaks/~3/4w4Nakpxdh4/ssh-auto-mount-network-share</link>
      <guid isPermaLink="false">http://www.phpfreaks.com/blog/ssh-auto-mount-network-share</guid>
      <description>&lt;p&gt;(&lt;b&gt;Beware&lt;/b&gt; - &lt;i&gt;This blog/tutorial is directed towards linux based users&lt;/i&gt;)&lt;br /&gt;
When doing any type of work, especially web work, one of the royal pains is FTPing to your server, or any type of file transfer.  Well now you can make it quick and painless.  Let me introduce SSHFS.  There are 3 major components when creating the SSHFS, and I will guide you through creating and installing all of the necessary steps.  Now you can mount and use your file system to automatically upload files and folders to your server with ease.&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline"&gt;&lt;i&gt;The 3 Major components:&lt;i&gt;&lt;/i&gt;&lt;/i&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;SSH Automatic Login&lt;/li&gt;
&lt;li&gt;Install SSHFS&lt;/li&gt;
&lt;li&gt;Mount your folder(s)&lt;/li&gt;&lt;/ol&gt;&lt;h3&gt;SSH Automatic Login&lt;/h3&gt;&lt;p&gt;Run this command (with the obvious variable substitutions).  It should create a public ssh key on your server.&lt;/p&gt;
&lt;pre class="bbcode"&gt;ssh-copy-id [-i [identity_file]] [user@]machine&lt;/pre&gt;&lt;ol&gt;
&lt;li&gt;ssh-keygen -t dsa&lt;/li&gt;
&lt;li&gt;ssh-copy-id user@machiner.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;
Check to make sure it's there, the file should be called, &amp;quot;authorized_keys&amp;quot;.&lt;br /&gt;
   &lt;/p&gt;
&lt;pre class="bbcode"&gt;ls -al ~/.ssh/&lt;/pre&gt;&lt;p&gt; If you're having trouble with this part, you can reference this tutorial which breaks this component into smaller steps: &lt;a href="http://wp.uberdose.com/2006/10/16/ssh-automatic-login/"&gt;SSH Automatic Login&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;Install SSHFS&lt;/h3&gt;&lt;pre class="bbcode"&gt;sudo apt-get install sshfs&lt;/pre&gt;&lt;p&gt;
Or use whatever package manager your distribution provides.&lt;/p&gt;
&lt;h3&gt;Mount&lt;/h3&gt;&lt;p&gt;
Create a shell script, we'll call it &amp;quot;mount.sh&amp;quot;, and add the contents:&lt;br /&gt;
   &lt;/p&gt;
&lt;pre class="bbcode"&gt;sshfs [user]@[your_server].com:/dir/on/server /dir/to/mount&lt;/pre&gt;&lt;p&gt;
Run the script:&lt;br /&gt;
   &lt;/p&gt;
&lt;pre class="bbcode"&gt;./mount.sh&lt;/pre&gt;&lt;p&gt;
Go to the mounted directory and run the 'ls' command to make sure all of your files/folders from your server show up in your local directory.&lt;/p&gt;
&lt;p&gt;After you have this successfully working you should at it to your startup scripts.&lt;br /&gt;
   &lt;/p&gt;
&lt;pre class="bbcode"&gt;System &amp;gt;&amp;gt; Preferences &amp;gt;&amp;gt; Sessions &amp;gt;&amp;gt; [add_a_new_entry]&lt;/pre&gt;&lt;p&gt;You should be all set.  You should have an automatic SSH login (no prompt for a password) from your computer to your server and a mounted folder to your server that acts as an automatic FTP client.  The files in your mounted directory should be synced with that of your server.  Now all you have to do is move or copy your desired files/folders into the mounted directory, and voila, they're on your server.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/phpfreaks?a=4w4Nakpxdh4:zqoO3UsDSOY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/phpfreaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/phpfreaks?a=4w4Nakpxdh4:zqoO3UsDSOY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/phpfreaks?i=4w4Nakpxdh4:zqoO3UsDSOY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/phpfreaks?a=4w4Nakpxdh4:zqoO3UsDSOY:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/phpfreaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/phpfreaks?a=4w4Nakpxdh4:zqoO3UsDSOY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/phpfreaks?i=4w4Nakpxdh4:zqoO3UsDSOY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/phpfreaks?a=4w4Nakpxdh4:zqoO3UsDSOY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/phpfreaks?i=4w4Nakpxdh4:zqoO3UsDSOY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/phpfreaks/~4/4w4Nakpxdh4" height="1" width="1"/&gt;</description>
      <pubDate>Fri, 12 Jun 2009 15:00:37 +0000</pubDate>
      <comments>http://www.phpfreaks.com/blog/ssh-auto-mount-network-share#comments</comments>
    <feedburner:origLink>http://www.phpfreaks.com/blog/ssh-auto-mount-network-share</feedburner:origLink></item>
    <item>
      <title><![CDATA[MySQL University: Boosting Performance With MySQL 5.1 Partitioning]]></title>
      <link>http://feedproxy.google.com/~r/phpfreaks/~3/TWYCiLEnVE4/mysql-university-boosting-performance-with-mysql-51-partitioning</link>
      <guid isPermaLink="false">http://www.phpfreaks.com/blog/mysql-university-boosting-performance-with-mysql-51-partitioning</guid>
      <description>&lt;p&gt;It's been some time some time since we had a MySQL Uni session subject that could be interesting to an 'average' PHP developer. The one that's going to take place next Thursday will definitely be of this sort.&lt;/p&gt;
&lt;p&gt;Introduced in MySQL 5.1, partitioning lets you divide your tables into smaller chunks of data... while still keeping them in one table. No more need for `invoices2006`, `invoices2007`, `invoices2008` tables to cope with archival data, no more wicked UNIONs. Now you can tell MySQL to keep invoices (or whatever you need to keep) from one year separate from all other years, thus improving queries that only deal with records from one year.&lt;/p&gt;
&lt;p&gt;That's just a simple example, as there are much more to partitioning than that. I urge you therefore to attend MySQL Uni's Dimdim session this Thursday, June 4th at 13:00GMT.&lt;/p&gt;
&lt;p&gt;The session will be presented by Giuseppe Maxia a.k.a. &lt;a href="http://datacharmer.blogspot.com/"&gt;The Data Charmer&lt;/a&gt;. I attended one of his sessions in the past, and he seems like a very interesting person to listen to.&lt;/p&gt;
&lt;p&gt;Check the &lt;a href="http://forge.mysql.com/wiki/MySQL_University"&gt;MySQL University home page&lt;/a&gt; for details (and possible last minute schedule changes!)&lt;br /&gt;
For more information about MySQL University, see &lt;a href="http://www.phpfreaks.com/blog/mysql-university"&gt;my introductory post&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/phpfreaks?a=TWYCiLEnVE4:EOnLvrurW0s:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/phpfreaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/phpfreaks?a=TWYCiLEnVE4:EOnLvrurW0s:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/phpfreaks?i=TWYCiLEnVE4:EOnLvrurW0s:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/phpfreaks?a=TWYCiLEnVE4:EOnLvrurW0s:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/phpfreaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/phpfreaks?a=TWYCiLEnVE4:EOnLvrurW0s:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/phpfreaks?i=TWYCiLEnVE4:EOnLvrurW0s:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/phpfreaks?a=TWYCiLEnVE4:EOnLvrurW0s:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/phpfreaks?i=TWYCiLEnVE4:EOnLvrurW0s:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/phpfreaks/~4/TWYCiLEnVE4" height="1" width="1"/&gt;</description>
      <pubDate>Fri, 29 May 2009 18:29:03 +0000</pubDate>
      <comments>http://www.phpfreaks.com/blog/mysql-university-boosting-performance-with-mysql-51-partitioning#comments</comments>
    <feedburner:origLink>http://www.phpfreaks.com/blog/mysql-university-boosting-performance-with-mysql-51-partitioning</feedburner:origLink></item>
  </channel>
</rss>
