<?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>Sun, 12 Feb 2012 16:09:23 -0600</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Robert Basic's Blog: A Zend Framework 2 EventManager use case]]></title>
      <guid>http://www.phpdeveloper.org/news/17021</guid>
      <link>http://www.phpdeveloper.org/news/17021</link>
      <description><![CDATA[<p>
<i>Robert Basic</i> has a new post to his blog today with an <a href="http://robertbasic.com/blog/azend-framework-2-eventmanager-use-case/">use case for Zend Framework 2's event manager</a> to solve a problem he has with "repetitive code" in some of his models.
</p>
<blockquote>
Basically, this allows us to have one piece of code to trigger an event and to have one or more listeners listening to this event. When the event gets triggered, the listeners are called and then we can do *something*, like caching or logging. Logging or caching. [...] See, that's my problem. All the event examples stop at logging and caching. Truly there must be some other example for which this event stuff can be used for.
</blockquote>
<p>
In his example code, he's used the EventManager in one of his models to add listeners to validate the post and "slugify" the post's title for use on the URL. You can <a href="https://github.com/robertbasic/blog-examples/blob/master/zf2-event-manager/index.php">find his code on github</a> if you're interested in the full implementation.
</p>]]></description>
      <pubDate>Thu, 20 Oct 2011 11:05:43 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Volker Dusch's Blog: Running your Unittests everytime you save a file]]></title>
      <guid>http://www.phpdeveloper.org/news/15626</guid>
      <link>http://www.phpdeveloper.org/news/15626</link>
      <description><![CDATA[<p>
<i>Volker Dusch</i> has a suggestion for all of those developers out there really concerned about the quality of your code - consider running your unit tests every time you save a file with the help of a tool called <a href="http://heisel.org/blog/code/pywatch/">PyWatch</a>.
</p>
<blockquote>
At the moment he placed the Idea in my head that i want my testsuite to run every time a file changes anyway, let someone else figure out how that is triggered. Well, <a href="http://heisel.org/blog/code/pywatch/">someone did figure that out, thank you</a>. It's called "PyWatch" and is a simple python script that monitors files for changes and executes a script if one has changed.
</blockquote>
<p>
Obviously you wouldn't want to keep this going for larger code bases (the potential for overlap is horrible) but it could be quite useful when doing test-driven development to save yourself some hassle at the outset. He includes the commands you'll need to get things running and a simple PHP script that points the PyWatch instance to the correct files.
</p>]]></description>
      <pubDate>Thu, 23 Dec 2010 11:55:23 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Hasin Hayder's Blog: Using new PECL Memcached extension for storing session data]]></title>
      <guid>http://www.phpdeveloper.org/news/13406</guid>
      <link>http://www.phpdeveloper.org/news/13406</link>
      <description><![CDATA[<p>
<i>Hasin Hayder</i> has <a href="http://hasin.wordpress.com/2009/10/18/using-new-pecl-memcached-extension-for-storing-session-data/">a new post</a> talking about the new memcached extension for PHP (<a href="http://pecl.php.net/package/memcached">memcached</a> from PECL) and how it can be used to store sessions data.
</p>
<blockquote>
Many of you already know that managing session is a critical task for web applications, specially when you want to avoid I/O hop and also a significant load over your database by writing a custom session handler. [...] This is why a central session manager is very important for your application to scale.
</blockquote>
<p>
He walks you through the whole process - installation, setting up memcached instances and getting the extension installed and working with your PHP installation. By adding two lines to your php.ini file, the sessions can quickly and easily be stored in memcache instead of on the local server.
</p>]]></description>
      <pubDate>Mon, 19 Oct 2009 09:51:21 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Vinu Thomas' Blog: Saving Data into Excel the Easy Way using PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/12799</guid>
      <link>http://www.phpdeveloper.org/news/12799</link>
      <description><![CDATA[<p>
<i>Vinu Thomas</i> has <a href="http://blogs.vinuthomas.com/2009/07/01/saving-data-into-excel-the-easy-way-using-php/">a new post</a> to his blog looking at using the <a href="http://www.phpclasses.org/browse/package/1919.html">MS-Excel Stream Handler</a> class to push your data out to Excel (in more than just a CSV file).
</p>
<blockquote>
If you're looking for an easy way to output your data from a PHP script into a Excel file, you've got to check out this script <a href="http://www.phpclasses.org/browse/package/1919.html"MS-Excel Stream Handler</a> which I came across at the <a href="http://www.phpclasses.org/">PHP Classes</a> site. What this script essentially does is to implement a stream handler interface to write Microsoft Excel spreadsheet files.
</blockquote>
<p>
Code snippets are included showing how to structure the data for the import and how to push that generated Excel file out to the user's waiting client.
</p>]]></description>
      <pubDate>Thu, 02 Jul 2009 10:18:51 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Maarten Balliauw's Blog: Saving a PHPExcel spreadsheet to Google Documents]]></title>
      <guid>http://www.phpdeveloper.org/news/11871</guid>
      <link>http://www.phpdeveloper.org/news/11871</link>
      <description><![CDATA[<p>
<i>Maarten Balliauw</i> has <a href="http://blog.maartenballiauw.be/post/2009/02/03/Saving-a-PHPExcel-spreadsheet-to-Google-Documents.aspx">written up a guide</a> to saving the output of your <a href="http://www.phpexcel.net/">PHPExcel</a> applications out to the Documents service that Google offers.
</p>
<blockquote>
As you may know, <a href="http://www.phpexcel.net/">PHPExcel</a> is built using an extensible model, supporting different input and output formats. The PHPExcel core class library features a spreadsheet engine, which is supported by IReader and IWriter instances used for reading and writing a spreadsheet to/from a file. Currently, PHPExcel supports writers for Excel2007, Excel5 (Excel 97+), CSV, HTML and PDF. Wouldnt it be nice if we could use PHPExcel to store a spreadsheet on <a href="http://docs.google.com/">Google Documents</a>? Let's combine some technologies.
</blockquote>
<p>
The two technologies in question are a standard install of the <a href="http://www.phpexcel.net/">PHPExcel</a> library and the <a href="http://framework.zend.com/">Zend Framework</a> (with its Zend_Gdata component). Using the component, a save() method is created and hooked into the IWriter interface of PHPExcel. When this save method is called, the Zend_Gdata component connects to the Documents service and uploads the resulting information for the account you supply.
</p>]]></description>
      <pubDate>Tue, 03 Feb 2009 12:58:56 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[CSSGallery.info: Textmate - php syntax check]]></title>
      <guid>http://www.phpdeveloper.org/news/11826</guid>
      <link>http://www.phpdeveloper.org/news/11826</link>
      <description><![CDATA[<p>
If you're a fan of the <a href="http://macromates.com/">Textmate</a> editor for the Mac platform, you might want to check out <a href="http://cssgallery.info/textmate-php-syntax-check/">this new post</a> from the cssgallery website. It shows how you can get your favorite editor to check your PHP syntax for you.
</p>
<blockquote>
A nice "hidden" feature that Textmate has, is to check the syntax of the php files you are writing, and display a popup with the result. [...] Each time you save, a syntax check will be done, and a popup will show you the result
</blockquote>
<p>
You'll need to edit the PHP bundle slightly to get things working, but that's as easy as going through the UI and changing a drop-down value to activate the check. You'll need to have a php binary where the editor can use it, but most OS X installs will have that in place anyway. Check out <a href="http://cssgallery.info/wp-content/uploads/2009/01/capture-21.png">this image</a> to see the end result.
</p>]]></description>
      <pubDate>Tue, 27 Jan 2009 12:55:22 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Ask Apache Blog: A better way to use PDF files online]]></title>
      <guid>http://www.phpdeveloper.org/news/9114</guid>
      <link>http://www.phpdeveloper.org/news/9114</link>
      <description><![CDATA[<p>
From the Ask Apache blog, there's a <a href="http://www.askapache.com/htaccess/pdf-plugin-adobe.html">quick tip</a> that makes it simple to give your site's visitors the option to either download or view a PDF file no matter what their browser default is.
</p>
<blockquote>
One of the most annoying things on the Internet for me is when I click on a link to an Adobe PDF file. For me this is annoying to the extreme because the PDF file is openened directly in your browser because of the Adobe PDF Plugin that almost all browsers have installed. [...] For me an ideal solution would be to offer me choices.
</blockquote>
<p>
His <a href="http://www.askapache.com/htaccess/pdf-plugin-adobe.html">solution</a> uses mod_rewrite in an .htaccess file to push the visitor to a PHP file. This file grabs the filename they want and pulls in the content, pushing it back out the other side with the "attachment" header that forces a request box on the browser.
</p>]]></description>
      <pubDate>Mon, 26 Nov 2007 11:11:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Felix Geisendorfer's Blog: Model::save() now returns an array!]]></title>
      <guid>http://www.phpdeveloper.org/news/8991</guid>
      <link>http://www.phpdeveloper.org/news/8991</link>
      <description><![CDATA[<p>
<i>Felix Geisendorfer</i> has a <a href="http://www.thinkingphp.org/2007/11/03/modelsave-now-returns-an-array/">quick tip</a> for CakePHPers out there today - an update to the framework that might cause a "gotcha" moment in your code:
</p>
<blockquote>
Just got bitten by this one when updating to the latest version of CakePHP. If you use code [checking to see if the return from a save() is true] in your app, you're in for a surprise. Because as of revision 5895 Model::save() now returns Model::data on success if its not empty.
</blockquote>
<p>
He notes that most developers don't seem to do it this way, but it tripped him up enough to where he wanted to share it with the CakePHP community so they'd know. Check out the comments on the post for other issues that might be caused by the change.
</p>]]></description>
      <pubDate>Wed, 07 Nov 2007 10:23:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Internet Super Hero Blog: mysqlnd saves 40% memory, finally (new tuning options)!]]></title>
      <guid>http://www.phpdeveloper.org/news/8536</guid>
      <link>http://www.phpdeveloper.org/news/8536</link>
      <description><![CDATA[<p>
Even more good news for mysqlnd users out there - according to <a href="http://blog.ulf-wendel.de/?p=157">this new post</a> on the Internet Super Hero blog, some of the tuning options it enables can help you save 40% of the memory you were using before.
</p>
<blockquote>
mysqlnd saves memory. It consumes half as much memory as libmysql. This is what we have been convinced of. This is what we taught you. Then I tried to test it and made Andrey get nervous for a few hours'¦ Meanwhile he is fine again and we can announce: mysqlnd saves memory, not only in theory, we tested it - we can proof it, can we?
</blockquote>
<p>
The <a href="http://blog.ulf-wendel.de/?p=157">proof</a> comes in the form of a few "tricks" and some of the settings that the software can use to optimize buffer sizes. Benchmarks (and the code to run them) are also included to show what the differences are between mysqlnd and libmysql.
</p>]]></description>
      <pubDate>Mon, 27 Aug 2007 12:11:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Felix Geisendorfer's Blog: Making error handling for Model::save more beautiful in CakePHP]]></title>
      <guid>http://www.phpdeveloper.org/news/7229</guid>
      <link>http://www.phpdeveloper.org/news/7229</link>
      <description><![CDATA[<p>
In a <a href="http://www.thinkingphp.org/2007/02/03/making-error-handling-for-modelsave-more-beautiful-in-cakephp/">new post</a> to his blog today, <i>Felix Geisendorfer</i> shares a method to make error handling in the CakePHP model functionality a bit more "beautiful".
</p>
<blockquote>
Now I've written actions like the one above in the past as well. It's just that I've not had many MySql errors since I've switched to CakePHP. The Model class usually handles all the DB operations flawlessly and it's probably been over a year that I've written a custom MySql statement in my code somewhere. However, even CakePHP or, what's more likely, the database can fail or deny operations.
</blockquote>
<p>
He shows some code snippets of what he sees as less beautiful versions of database insertion code, methods that either don't check the response/errors or make a messy job of it. His solution works by returning the result into a switch statement to check the results and handling it there (versus a series of ifs). There's a class you'll need to make it work (Common), but he shows how to use it and creates a simple "add" example with it and a new Controller to handle the request.
</p>]]></description>
      <pubDate>Tue, 06 Feb 2007 10:05:00 -0600</pubDate>
    </item>
  </channel>
</rss>

