<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Wed, 15 Oct 2008 22:05:58 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Debuggable Blog: Two CakePHP Tricks]]></title>
      <guid>http://www.phpdeveloper.org/news/10894</guid>
      <link>http://www.phpdeveloper.org/news/10894</link>
      <description><![CDATA[<p>
On the Debuggable blog <i>Felix</i> has <a href="http://feeds.feedburner.com/~r/thinkingphp/~3/373239376/4-cakephp-tricks:4811ad82-32dc-4a38-bc10-36304834cda3">posted two quick tips</a> you can use in your CakePHP application - one related to debugging and the other about custom config files.
</p>
<p>For tip #1</p>
<blockquote>
If you just put a debug() statement in, you will see hundreds of outputs and would not know which one belongs to the case you are interested in. My favorite solution to this problem is to use the Configure class as a toggle for showing the debug information.
</blockquote>
<p>For tip #2</p>
<blockquote>
This is a very simple one. To make your application configurable via a global config file, all you need to do is the following.
</blockquote>
<p>
Both come complete with <a href="http://feeds.feedburner.com/~r/thinkingphp/~3/373239376/4-cakephp-tricks:4811ad82-32dc-4a38-bc10-36304834cda3">code examples</a>.
</p>]]></description>
      <pubDate>Mon, 25 Aug 2008 15:58:03 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[David Otton's Blog: Stupid PHP Tricks: Illegal Variable Names]]></title>
      <guid>http://www.phpdeveloper.org/news/10885</guid>
      <link>http://www.phpdeveloper.org/news/10885</link>
      <description><![CDATA[<p>
<i>David Otton</i> has shared another of his "stupid PHP tricks" on his blog today. <A href="http://www.otton.org/2008/08/21/stupid-php-tricks-illegal-variable-names/">This one</a> looks at illegal variable names that don't match the "can't start with a number" rule the manual points out.
</p>
<blockquote>
A valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores. As a regular expression, it would be expressed thus: '[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*'
</blockquote>
<p>
Technically, you can get around this in two different ways - variable varaibles and the more complex notation with curly braces. He points to the <a href="http://www.php.net/compact">compact</a> function for proof that they're set.
</p>]]></description>
      <pubDate>Fri, 22 Aug 2008 13:47:52 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[David Otton's Blog: Neat PHP tricks: Casting Arrays to Objects]]></title>
      <guid>http://www.phpdeveloper.org/news/10834</guid>
      <link>http://www.phpdeveloper.org/news/10834</link>
      <description><![CDATA[<p>
<i>David Otton</i> has a <a href="http://www.otton.org/2008/08/14/neat-php-tricks-casting-arrays-to-objects/">handy little tip</a> if you're looking for a cleaner way to deal with array data - casting it to an object.
</p>
<blockquote>
Array notation is fine, but it can look a bit clunky when you're working with complex structures. [...] Casting the array to an object allows us to use object notation (->) and makes the code more readable.
</blockquote>
<p>
He includes examples of the casting, showing the difference between the array and object notations including a method for creating an object based on a simple array that has basic properties built in. This sort of transformation can be useful if you want consistency through out the application - just passing objects with their properties rather than arrays.
</p>]]></description>
      <pubDate>Thu, 14 Aug 2008 13:38:10 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Brian Moon's Blog: Stupid PHP Tricks: Normalizing SimpleXML Data]]></title>
      <guid>http://www.phpdeveloper.org/news/10328</guid>
      <link>http://www.phpdeveloper.org/news/10328</link>
      <description><![CDATA[<p>
<i>Brian Moon</i> has a "stupid PHP trick" posted to his blog today - <a href="http://brian.moonspot.net/2008/06/03/stupid-php-tricks-normalizing-simplexml-data/">normalizing SimpleXML data</a> you've pulled in from just about any external source.
</p>
<blockquote>
Anyhow, one annoying thing about SimpleXML has to do with caching.  When using web services, we often cache the contents we get back.  We were having a problem where we would get an error about a SimpleXML node not existing.
</blockquote>
<p>
They were using memcache to store the information but came across problems when their code tried to use a (sometimes) empty tag. He gives two solutions - one using a recursive function that identifies the empty items and the other that encodes then decodes the object to and from JSON, keeping the values intact.
</p>]]></description>
      <pubDate>Tue, 03 Jun 2008 09:34:22 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[John Rockefeller's Blog: PHP Tricks: How To Handle Multiple Domains]]></title>
      <guid>http://www.phpdeveloper.org/news/10278</guid>
      <link>http://www.phpdeveloper.org/news/10278</link>
      <description><![CDATA[<p>
<i>John Rockefeller</i> has <a href="http://www.johnrockefeller.net/?p=194">a tip</a> he'd like to share with all of the other PHP developers out there - a little method he's come up with to host multiple domains off of the same code.
</p>
<blockquote>
This is really handy for those of us who have the same code handling multiple sites or multiple sub-domains. A case in point: When I coded NetBoardz (my free forum hosting service now defunct), I had one codebase handling all 250 forums. How? Simple. When the code runs, it determines which site the user is loading and does different things (like using different databases) dynamically.
</blockquote>
<p>
He shows the two <a href="http://www.johnrockefeller.net/?p=194">key points</a> to dividing things up - grabbing the domain and subdomain they were trying to access. This can be fed into a script that can switch things like layout or even functionality based on which site they've chosen.
</p>]]></description>
      <pubDate>Tue, 27 May 2008 11:11:01 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[SaniSoft Blog:  Help! vendor() is deprecated.]]></title>
      <guid>http://www.phpdeveloper.org/news/10160</guid>
      <link>http://www.phpdeveloper.org/news/10160</link>
      <description><![CDATA[<p>
On the SaniSoft blog today, <i>Tarique Sani</i> has a <a href="http://www.sanisoft.com/blog/2008/05/10/help-vendor-is-deprecated/">quick hack</a> for CakePHP users needing to transition over from the deprecated vendor() call - import().
</p>
<blockquote>
Use of vendor() function to load third party libs in CakePHP has been deprecated for some time now... It has been replaced with the more generic App::import() the usage is simple.
</blockquote>
<p>
There's also a little trick you'll need to know for files with underscores (drop it and replace with an uppercase) and how to get it to be a bit more flexible and recognize vendor files in subdirectories or ones differently named.
</p>]]></description>
      <pubDate>Mon, 12 May 2008 09:35:48 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Blogge: Things You Must Know About CakePHP]]></title>
      <guid>http://www.phpdeveloper.org/news/8308</guid>
      <link>http://www.phpdeveloper.org/news/8308</link>
      <description><![CDATA[<p>
On the Blogge site, there's a <a href="http://www.dassnagar.com/blogge/2007/07/15/you_must_know_about_cakephp/">listing of "must knows"</a> that developers should understand about the CakePHP framework when working with it.
</p>
<blockquote>
CakePHP is a rapid development framework for PHP which uses commonly known design patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC. Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility.
</blockquote>
<p>
Among those on <a href="http://www.dassnagar.com/blogge/2007/07/15/you_must_know_about_cakephp/">the list of handy tips</a> for using the framework are things like:
</p>
<ul>
<li>Static pages - Adjusting other data sent to the layout
<li>Viewing the SQL queries that are running behind the scenes
<li>Using bake.php
<li>Complex model validation
<li>Creating a model for a table that doesn't actually exist in the database
<li>Inserting multiple rows in succession
</ul>]]></description>
      <pubDate>Mon, 23 Jul 2007 12:52:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Brian Moon's Blog: PHP/MySQL Debug Trick]]></title>
      <guid>http://www.phpdeveloper.org/news/6161</guid>
      <link>http://www.phpdeveloper.org/news/6161</link>
      <description><![CDATA[<p>
<i>Brian Moon</i> has had his share of issues with connecting PHP to MySQL, but sometimes, it's harder to track down the problem than others. So, he decided to put <a href="http://doughboy.wordpress.com/2006/08/28/phpmysql-debug-trick/">a simple trick</a> in place to help him (and the mysqladmin proc command) locate the offending query.
</p>
<blockquote>
<p>
We use a class that I wrote for all of our access to mysql. Its basically a wrapper for mysql_connect, mysql_select_db, mysql_query, mysql_num_rows(), etc. One method to handle all of that. Lots of you probably have one of these objects or libraries. Anyhow, what I did was add a comment into the sql just before I run the query.
</p>
<p>
Now, mysqladmin proc has the request URI for every query in it. The MySQL slow query log does as well. I know this is a simple little thing, but man, is it useful.
</p>
</blockquote>
<p>
<a href="http://doughboy.wordpress.com/2006/08/28/phpmysql-debug-trick/">This trick</a> is a quick and easy way to help see what page it is that's causing the issue (since multiple pages can use one SQL call), but it can also be used to help track down other values effecting the SQL as well. Very handy.
</p>]]></description>
      <pubDate>Tue, 29 Aug 2006 07:28:56 -0500</pubDate>
    </item>
  </channel>
</rss>
