<?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>Sat, 18 May 2013 19:02:27 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[DevShed: Building an ORM in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17146</guid>
      <link>http://www.phpdeveloper.org/news/17146</link>
      <description><![CDATA[<p>
On DevShed today there's a new tutorial showing you how to <a href="http://www.devshed.com/c/a/MySQL/Building-an-ORM-in-PHP/">build a basic ORM layer</a> on top of a MySQL database. It includes all the code you'll need (cut&paste-able, not as a download).
</p>
<blockquote>
Obviously, with so many ORMs at one's disposal for free, it seems pretty pointless to develop a custom one; are we trying to reinvent the wheel? No, of course not. But if you need to create a simple application that performs a few CRUD operations on some related domain objects and don't want to climb the learning curve of a third-party library, then implementing a custom ORM might make sense. There's alos the educational aspect of the process (yes, learning one or two things never hurts).
</blockquote>
<p>
They start you off with the creation of the "data persistence layer" (an interface first) to connect to the database, building a MySQL-specific one on top of it. Next up is the data mapper layer making things like "fetch by ID" and the insert/update/delete possible. Their simple example doesn't include anything about ORM relationships, though - just fetching simple rows.
</p>]]></description>
      <pubDate>Fri, 18 Nov 2011 09:45:15 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Script-Tutorials.com: How to Use APC Caching with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16860</guid>
      <link>http://www.phpdeveloper.org/news/16860</link>
      <description><![CDATA[<p>
On Script-Tutorials.com today there's a new article introducing you to <a href="http://www.script-tutorials.com/how-to-use-apc-caching-with-php/">using APC caching</a> in your PHP applications. Their simple example sets up a caching class that handles the dirty work for you.
</p>
<blockquote>
Today I have another interesting article for PHP. We will talking about caching, and practice of using caching in php. I will make review of APC caching and will show you how you can use APC in PHP. [...] Now people have learned to use the server memory for data storage. RAM much faster than hard disk, and the price of memory falls all the time, so let's use all these advantages of this.
</blockquote>
<p>
Included in the post is the code for a few different files - the caching class itself that implements the <a href="http://php.net/apc">APC</a> functions in PHP and some examples of it in use: saving objects, fetching data from the cache and removing things from the cache.
</p>]]></description>
      <pubDate>Thu, 15 Sep 2011 08:29:14 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Timothy Boronczyk's Blog: Avoid Fetch-Object Abuse]]></title>
      <guid>http://www.phpdeveloper.org/news/16581</guid>
      <link>http://www.phpdeveloper.org/news/16581</link>
      <description><![CDATA[<p>
In a new post on his blog <i>Timothy Boronczyk</i> has a recommendation for developers working in PHP with databases that have a "fetch object" method - <a href="http://zaemis.blogspot.com/2011/07/avoid-fetch-object-abuse.html">use it correctly or avoid it all together</a>.
</p>
<blockquote>
Lately I'm finding a lot of instances of the mysql_fetch_object() function being used in a particular codebase I help maintain. Unfortunately, I've yet to see it used correctly. It always seems to be used to retrieve a stdClass object from a query result where mysql_fetch_array() or mysql_fetch_assoc() would be the more appropriate choice.
</blockquote>
<p>
Most of his complaint is that, despite pulling out the data as an object, most scripts continue to use it like you would an array, looping over it. There's extra overhead generated from the object creation that could cause issues, especially with large return data sets.
</p>
<blockquote>
The best advice I can offer is to educate yourself and others how the function should be used so its abuse isn't perpetuated. Then, be cautious when using mysql_fetch_object() correctly and understand the process it follows to create and return an object. If not for yourself, then do it for the kittens.
</blockquote>]]></description>
      <pubDate>Tue, 12 Jul 2011 12:10:02 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso's Blog: Performance analysis fetching data with PDO and PHP.]]></title>
      <guid>http://www.phpdeveloper.org/news/16106</guid>
      <link>http://www.phpdeveloper.org/news/16106</link>
      <description><![CDATA[<p>
<i>Gonzalo Ayuso</i> has a new post to his blog today with the results of some <a href="http://gonzalo123.wordpress.com/2011/03/28/performance-analysis-fetching-data-with-pdo-and-php/">performance analysis</a> he ran when fetching data with PHP and PDO.
</p>
<blockquote>
Fetching data from databases is a common operation in our work as developers. There are many drivers (normally I use PDO), but the usage of all of them are similar and switch from one to another is not difficult (they almost share the same interface). In this post I will focus on fetching data.
</blockquote>
<p>
He includes his sample scripts - one using just fetch() and the other using fetchAll() - that include some timing and memory checking logic and includes the results of his "limit 10000" queries from his tables. Not surprisingly, the fetchAll required more memory than the fetch call. Event changing it to a loop of fetch() methods results in about the same amount of memory as a fetchAll.
</p>]]></description>
      <pubDate>Mon, 28 Mar 2011 08:12:20 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Michelangelo van Dam's Blog: Single User Zend_Service_Twitter]]></title>
      <guid>http://www.phpdeveloper.org/news/15226</guid>
      <link>http://www.phpdeveloper.org/news/15226</link>
      <description><![CDATA[<p>
<i>Michelangelo van Dam</i> has <a href="http://www.dragonbe.com/2010/10/single-user-zendservicetwitter.html">a new post to his blog</a> today with an example of using the <a href="http://framework.zend.com/manual/en/zend.service.twitter.html">Zend_Service_Twitter</a> component of the Zend Framework to set up a simple <a href="http://twitter.com">Twitter</a> client to connect and grab the latest tweets from an account.
</p>
<blockquote>
Although the <a href="http://framework.zend.com/manual/en/">Zend Framework manual</a> extensively describes how to set up a true <a href="http://twitter.com/">Twitter</a> application with the new <a href="http://oauth.net/">OAuth</a> implementation of <a href="http://twitter.com/">Twitter</a> using <a href="http://framework.zend.com/manual/en/zend.service.twitter.html">Zend_Service_Twitter</a> and <a href="http://framework.zend.com/manual/en/zend.oauth.html">Zend_Oauth</a> (since ZF-1.10.0), this is not what you're looking for. You need a simple approach, using the single user <a href="http://oauth.net/">OAuth</a> implementation of <a href="http://twitter.com/">Twitter</a>.
</blockquote>
<p>
He shows (complete with screenshots) how to register for access to the Twitter API and how, once you've grabbed your access tokens, to pull the latest tweets from the selected account - complete with a code sample to show you how. It's a Zend Framework-specific example, but the components can be used outside the framework for the same effect.
</p>]]></description>
      <pubDate>Mon, 04 Oct 2010 13:36:21 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Brian Moon's Blog: PHP 5.3 and mysqlnd - Unexpected results]]></title>
      <guid>http://www.phpdeveloper.org/news/14908</guid>
      <link>http://www.phpdeveloper.org/news/14908</link>
      <description><![CDATA[<p>
On his blog today <i>Brian Moon</i> <a href="http://brian.moonspot.net/php-5-3-mysqlnd">takes a look</a> at the mysqlnd driver that comes with PHP 5.3 by default and some strangeness he found when trying to fetch results.
</p>
<blockquote>
I have spoken in the past (see my slides and interview: MySQL Tips and Tricks) about using mysql_unbuffered_query or using mysqli_query with the MYSQLI_USE_RESULT flag [...] So, my natural thought was that using MYSQLI_USE_RESULT with fetch_all would yield the most awesome performance ever. The data would not be buffered and it would get put into a PHP array in C instead of native code.
</blockquote>
<p>
He had hoped that the fetch_all would cooperate with the MYSQL_USE_RESULT setting, but it seemed to only work with the MYSQLI_STORE_RESULT default. He even filed a bug on the matter which was marked bogus and then reopened. He hopes to show, based on test results, that the result could be much faster.
</p>]]></description>
      <pubDate>Thu, 05 Aug 2010 10:33:01 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Mihai Corlan's Blog: Flex/AIR and PHP apps]]></title>
      <guid>http://www.phpdeveloper.org/news/11786</guid>
      <link>http://www.phpdeveloper.org/news/11786</link>
      <description><![CDATA[<p>
<i>Mihai Corlan</i> has put <a href="http://corlan.org/flexair-and-php-apps/">together a list</a> (ever growing) of AIR applications that use a PHP backend:
</p>
<blockquote>
I want to maintain a list with RIA applications created using Flex and PHP (could be web apps or desktop apps). While this list is unlikely to be a complete list, I hope there will be enough applications to serve as a reference point or to inspire any PHP programmer.
</blockquote>
<p>
On the list already are apps like <a href="http://shifd.com/welcome">Shifd</a>, <a href="http://flex.org/">Flex.org</a>, <a href="http://www.kizoa.fr/">Kizoa</a> and a <a href="http://www.stockfetcher.com/ui2/index.php">Stock Fetcher</a>. Keep checking back on <a href="http://corlan.org/flexair-and-php-apps/">the list</a> for more great AIR/Flex and PHP apps as they're added to the list.
</p>]]></description>
      <pubDate>Wed, 21 Jan 2009 20:47:13 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Lorna Mitchell's Blog: Introduction to Zend_Db]]></title>
      <guid>http://www.phpdeveloper.org/news/11326</guid>
      <link>http://www.phpdeveloper.org/news/11326</link>
      <description><![CDATA[<p>
<i>Lorna Mitchell</i> has an <a href="http://www.lornajane.net/posts/2008/Introduction-to-Zend_Db">introduction to Zend_Db</a>, the Zend Framework database abstraction layer posted to her blog today:
</p>
<blockquote>
I recently worked on a project which was based on Zend Framework - I haven't worked with it before and I was temporarily confused by the existing implementation of some of the database-level stuff. After much reading and untangling of code, I'm now pretty clear how this should look, so here's my overview. I'm not going to go into setting up a whole application, but this is a quick primer on how data models go together.
</blockquote>
<p>
She <a href="http://www.lornajane.net/posts/2008/Introduction-to-Zend_Db">talks about</a> table modeling, fetching rows/data from the model and working with rows/rowsets.
</p>]]></description>
      <pubDate>Fri, 31 Oct 2008 12:57:07 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Jani Hartikainen's Blog: Understanding Doctrine's NestedSet feature]]></title>
      <guid>http://www.phpdeveloper.org/news/10943</guid>
      <link>http://www.phpdeveloper.org/news/10943</link>
      <description><![CDATA[<p>
On his CodeUtopia blog <i>Jani Hartikainen</i> gives an <a href="http://codeutopia.net/blog/2008/08/30/understanding-doctrines-nestedset-feature/">inside look</a> at a feature of Doctrine, nested sets.
</p>
<blockquote>
The Doctrine library comes with a feature called nested set, which makes saving trees in a database easy. However, it's quite easy to accidentally cause a lot of extra unneeded queries if not being careful. Here are some pointers to keep in mind while working with the nested set, and some example queries to make understanding it easier.
</blockquote>
<p>
He gives an example, showing how to get rows from the database - parent and child - and some optimization tips to keep things light. There's also some pros and cons included for doing it either way (the standard fetching or using the more optimized versions).
</p>]]></description>
      <pubDate>Tue, 02 Sep 2008 10:29:56 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Stefan Mischook's Blog: SQL insert statements in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/10642</guid>
      <link>http://www.phpdeveloper.org/news/10642</link>
      <description><![CDATA[<p>
<i>Stefan Mischook</i> has posted a <a href="http://www.killerphp.com/articles/sql-insert-statements-in-php/">new introductory video</a> for those just starting out with SQL in their PHP scripts - a look at using a (MySQL) database.
</p>
<blockquote>
I've finally released my first <a href="http://www.killerphp.com/videos/sql_statements_in_php.php">video on using SQL statements</a> in PHP pages. This is the next step after connecting to a MySQL database. I hope you find the videos useful.
</blockquote>
<p>
The video looks at the "big four" - insert, update, delete and select, but focuses on the select statements and how to use them with function like <a href="http://php.net/mysql_fetch_assoc">mysql_fetch_assoc</a> and <a href="http://php.net/mysql_fetch_array">mysql_fetch_array</a> to get the results out of your database. 
</p>]]></description>
      <pubDate>Mon, 21 Jul 2008 07:58:46 -0500</pubDate>
    </item>
  </channel>
</rss>
