<?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 19:55:21 -0600</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Ulf Wendel's Blog: Using MySQL stored procedures with PHP mysqli]]></title>
      <guid>http://www.phpdeveloper.org/news/17088</guid>
      <link>http://www.phpdeveloper.org/news/17088</link>
      <description><![CDATA[<p>
<i>Ulf Wendel</i> has a new post today with details on <a href="http://blog.ulf-wendel.de/2011/using-mysql-stored-procedures-with-php-mysqli/">using stored procedures with mysqli</a> - not overly difficult if you know how to handle the IN, OUT and INOUT parameters. He includes a few code examples showing how to use them.
</p>
<blockquote>
Out of curiosity I asked another friend, a team lead, how things where going with their PHP MySQL project, for which they had planned to have most of their business logic in stored procedures. I got an email in reply stating something along the lines: "Our developers found that mysqli does not support stored procedures correctly. We use PDO.". Well, the existing documentation from PHP 5.0 times is not stellar, I confess. But still, that's a bit too much... it ain't that difficult. And, it works.
</blockquote>
<p>
He describes the three parameters (IN, OUT and INOUT) and gives some examples of setting/getting them from your SQL statements. They're all still set up using the <a href="http://us2.php.net/manual/en/mysqli.query.php">query method</a> on your connection as well as handling the result sets that come back and working with prepared statements.
</p>]]></description>
      <pubDate>Fri, 04 Nov 2011 11:39:18 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Anthony Ferrara's Blog: IteratorIterator - PHP Inconsistencies And WTFs]]></title>
      <guid>http://www.phpdeveloper.org/news/17071</guid>
      <link>http://www.phpdeveloper.org/news/17071</link>
      <description><![CDATA[<p>
<i>Anthony Ferrara</i> has a new post to his blog sharing some <a href="http://blog.ircmaxell.com/2011/10/iteratoriterator-php-inconsistencies.html">inconsistencies with iterators</a> that he discovered as discussed with a <a href="http://twitter.com/#!/go_oh">fellow developer</a> - why some iterators only accept Iterator arguments and others don't.
</p>
<blockquote>
We were talking about why some of the SPL Iterators accept only an Iterator as the constructor argument (Such as <a href="http://us2.php.net/manual/en/class.limititerator.php">LimitIterator</a>), and others accept either an Iterator or an IteratorAggregate as the argument (Such as <a href="http://us2.php.net/manual/en/class.iteratoriterator.php">IteratorIterator</a>).  Feeling that this would be a useful feature to add (having all of them accept an IteratorAggregate), I opened up the PHP source and started looking at how hard of a change this would be.  What I found was... Interesting...
</blockquote>
<p>
He shares some of the C code he came across in his investigation including a "WTF" moment when he found a <a href="http://lxr.php.net/xref/PHP_5_3/ext/spl/spl_iterators.c#1418">case statement for DIT_IteratorIterator</a> in a constructor. Because of some of the logic in this constructor, the inputted iterator is "cast down" to a class. This is shown in a few code examples comparing simple iteration objects and arrays and how it seems to be able to bypass class inheritance to use methods from other classes.
</p>]]></description>
      <pubDate>Tue, 01 Nov 2011 12:58:07 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[rooJSolutions Blog: Watch-out PHP 5.3.7+ is about.. and the is_a() / __autoload() mess.]]></title>
      <guid>http://www.phpdeveloper.org/news/16810</guid>
      <link>http://www.phpdeveloper.org/news/16810</link>
      <description><![CDATA[<p>
New from the rooJSolutions blog there's a post pointing out an issue that PHP 5.3.7 has broken the <a href="http://php.net/is_a">is_a</a> functionality in a lot of cases. <a href="http://roojs.com/index.php/View/242/.html">The post</a> talks some about what's broken and how you can work around it if you're effected.
</p>
<blockquote>
The key issue was that 5.3.7 accidentally broke is_a() for a reasonably large number of users. Unfortunately the fixup release 5.3.8 did not address this 'mistake', and after a rather fruitless exchange I gave up trying to persuade the group (most people on mailing list), that reverting the change was rather critical (at least pierre supported reverting it in the 5.3.* series).
</blockquote>
<p>
This new issue was causing some strange errors to pop up in his code because of a parameter type change in the <a href="http://php.net/is_a">is_a</a> call, updating the first parameter to be an object instead of a class name. The is_a() call sends its requests to __autoload in some cases and the string->object mismatch of those parameters causes errors to be thrown. His workaround is, in your checking, just be sure to call an <a href="http://php.net/is_object">is_object</a> first before passing things off to be is_a() checked and autoloaded.
</p>]]></description>
      <pubDate>Fri, 02 Sep 2011 10:43:24 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Justin Carmony's Blog: PHP Itch to Scratch: Object Notation]]></title>
      <guid>http://www.phpdeveloper.org/news/16199</guid>
      <link>http://www.phpdeveloper.org/news/16199</link>
      <description><![CDATA[<p>
In a new post to his blog <i>Justin Carmony</i> talks about a few "itches" he's wanted to scratched when it comes to features of the PHP language - in this post it's the <a href="http://www.justincarmony.com/blog/2011/04/12/php-itch-to-scratch-object-notation/">notation that's used surrounding the use of objects</a>.
</p>
<blockquote>
At the end [of <a href="http://blog.tabini.ca/2011/04/is-php-running-out-of-itches-to-scratch/">Marco's post to his blog</a>], he states it ultimately boils down to find a better way to bring features build downstream back upstream. So I thought I would do my part by first my blogging about a few "itches" I'd love to see scratched. My first itch would be some form of Object Notation for PHP.
</blockquote>
<p>
He talks about the notation method that Javascript has always had and how it can help to make objects more flexible by not forcing their creation through a method/argument interface. He offers one potential solution - using arrays for settings values - but notes that it could be more trouble than it's worth in the implementation. He proposes a new sort of notation instead, one that allows the passing of something similar to the Javascript JSON-ish definition of values and callbacks as anonymous functions.
</p>]]></description>
      <pubDate>Thu, 14 Apr 2011 13:42:33 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Brian Swan's Blog: Why Pass Parameters by Reference in the SQLSRV Driver?]]></title>
      <guid>http://www.phpdeveloper.org/news/15491</guid>
      <link>http://www.phpdeveloper.org/news/15491</link>
      <description><![CDATA[<p>
<i>Brian Swaan</i> has <a href="http://blogs.msdn.com/b/brian_swan/archive/2010/11/23/why-pass-parameters-by-reference-in-the-sqlsrv-driver.aspx">a new post</a> to his blog talking about why you, in your SQL Server-based application, pass the parameters in by reference.
</p>
<blockquote>
Last week at <a href="http://jumpincamp.com/">JumpIn Camp</a> we spent quite a bit of time focusing on the <a href="http://sqlsrvphp.codeplex.com/">SQL Server Driver for PHP</a>. As developers worked to build SQL Server support into their applications, they had lots of questions about how both the <a href="http://msdn.microsoft.com/en-us/library/cc296152(SQL.90).aspx">SQLSRV</a> and <a href="http://msdn.microsoft.com/en-us/library/ff628175(SQL.90).aspx">PDO_SQLSRV</a> drivers work under the hood. One of the questions that came up was "When using the SQLSRV driver to execute parameterized queries, why do I have to pass parameters by reference?"
</blockquote>
<p>
He includes a simple code example to show this passing by reference - first without it on the call to sqlsrv_prepare (and the warning message it gives) then the more correct version of passing in the past parameter by reference. 
</p>
<blockquote>
The SQL Server Driver for PHP team understands that passing parameters by reference is not ideal. [...] With that said, the team is continuing to investigate solutions that would produce expected behavior without passing parameters by reference.
</blockquote>]]></description>
      <pubDate>Thu, 25 Nov 2010 09:15:22 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPClasses.org: Lately in PHP Ep. 6 - Unusual Site Speedup Techniques, Named params & Annotations]]></title>
      <guid>http://www.phpdeveloper.org/news/15359</guid>
      <link>http://www.phpdeveloper.org/news/15359</link>
      <description><![CDATA[<p>
On the PHPClasses.org site today they've posted the <a href="http://www.phpclasses.org/blog/post/134-Unusual-Site-Speedup-Techniques-debate-Named-parameters-and-Annotations--Lately-in-PHP-podcast-episode-6.html">latest episode</a> in their "Lately in PHP" podcast series - "Unusual Site Speedup Techniques debate, Named parameters and Annotations".
</p>
<blockquote>
In this episode, Manuel Lemos and Ernani Joppert discuss several unusual site speedup techniques presented in recent articles of the PHPClasses site blog. They also discuss the (non-)inclusion of new PHP features discussed by PHP core developers like having named parameters in function calls and the support of Java-like annotations in PHP code.
</blockquote>
<p>
To listen you can either use the <a href="http://www.phpclasses.org/blog/post/134-Unusual-Site-Speedup-Techniques-debate-Named-parameters-and-Annotations--Lately-in-PHP-podcast-episode-6.html">in-page player</a>, grab it <a href="http://itunes.apple.com/podcast/lately-in-php-podcast/id373016482">from iTunes</a> or just download <a href="http://www.phpclasses.org/blog/post/134/file/27/name/Lately-In-PHP-6.mp3">the mp3</a>. Complete show notes and transcript are also included in <a href="http://www.phpclasses.org/blog/post/134-Unusual-Site-Speedup-Techniques-debate-Named-parameters-and-Annotations--Lately-in-PHP-podcast-episode-6.html">the post</a>.
</p>]]></description>
      <pubDate>Mon, 01 Nov 2010 08:29:46 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[KillerPHP.com: Advanced PHP Video Tutorial - Passing Parameters Around an MVC Application]]></title>
      <guid>http://www.phpdeveloper.org/news/14935</guid>
      <link>http://www.phpdeveloper.org/news/14935</link>
      <description><![CDATA[<p>
On the KillerPHP.com blog today there's <a href="http://www.killerphp.com/articles/advanced-php-passing-parameters-around-our-mvc-application-video-tutorial/">a new screencast</a> looking at passing data around a MVC (Model/View/Controller) application.
</p>
<blockquote>
In this video tutorial from our <a href="http://www.killervideostore.com/video-courses/advanced-php.php">Advanced PHP</a> series, we look at how to write a very simple MVC (Model,View,Controller) framework from scratch using PHP 5.3, soon to be PHP 6
</blockquote>
<p>
You can find other advanced PHP videos on <a href="http://www.killerphp.com/articles/category/php-videos/">this page</a> of the KillerPHP.com site covering topics like Javascript, creating CRUD, making a login system, ORM and much more.
</p>]]></description>
      <pubDate>Tue, 10 Aug 2010 13:57:17 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Brian Swan's Blog: What's the Right Way to Prevent SQL Injection in PHP Scripts?]]></title>
      <guid>http://www.phpdeveloper.org/news/14140</guid>
      <link>http://www.phpdeveloper.org/news/14140</link>
      <description><![CDATA[<p>
<i>Brian Swan</i> has a new post today looking at one way you can protect your web application from potential attack - <a href="http://blogs.msdn.com/brian_swan/archive/2010/03/04/What_2700_s-the-right-way-to-avoid-SQL-injection-in-PHP-scripts_3F00_.aspx">preventing SQL injection</a> by filtering input.
</p>
<blockquote>
How to prevent SQL injection in PHP scripts is probably a topic that doesn't need anything more written about it. [...] However, it is important to have fresh information for new Web developers and I don't necessarily agree with some of the most common suggestions for preventing SQL injection. [...] So, this will be yet another post about preventing SQL injection, but I will offer my 2 cents about what I think is the right way to prevent it.
</blockquote>
<p>
He explains SQL injections for those that are unsure on the concept with a basic form example and what he thinks is a better way to prevent it than just trying to escape the SQL - bound parameters. These allow you to both filter and protect your application from any would-be attacks that might come your way. He is, of course, using SQL Server so the parameter binding is included in the database functionality. Other databases might have to use something like <a href="http://php.net/pdo">PDO</a> to accomplish the same kind of thing.
</p>]]></description>
      <pubDate>Fri, 05 Mar 2010 13:47:43 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Lorna Mitchell's Blog: Stopping CodeIgniter from Escaping SQL]]></title>
      <guid>http://www.phpdeveloper.org/news/13930</guid>
      <link>http://www.phpdeveloper.org/news/13930</link>
      <description><![CDATA[<p>
In <a href="http://joind.in">a project</a> she's been working on <i>Lorna Mitchell</i> was frustrated with something the <a href="http://codeigniter.com">CodeIgniter</a> framework does natively - escape SQL statements done through the databaase layer's "select()" method. Thankfully, there was a simple fix to turn this behavior off.
</p>
<blockquote>
I've been getting increasingly impatient with its tendency to try to escape my SQL code for me - this is a really useful default feature but it seems to assume I don't know what I'm doing and so it puts backticks all over perfectly acceptable SQL code, very annoying!
</blockquote>
<p>
Thanks to <a href="http://twitter.com/damiangostomski/statuses/8209882657">a reply on twitter from damiangostomski</a> to her frustrations she found the optional second parameter you can give the "select()" method, a boolean that tells it whether or not to escape the query (it's mentioned <a href="http://codeigniter.com/user_guide/database/active_record.html#select">here</a>) for those that were wondering.
</p>]]></description>
      <pubDate>Thu, 28 Jan 2010 13:39:45 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Zend Developer Zone: Request parameter mapping to action method parameters]]></title>
      <guid>http://www.phpdeveloper.org/news/13331</guid>
      <link>http://www.phpdeveloper.org/news/13331</link>
      <description><![CDATA[<p>
The Zend Developer Zone has <a href="http://devzone.zend.com/article/10861-Request-parameter-mapping-to-action-method-parameters">a quick post</a> from <i>albeva</i> about an extension from the default controller in the Zend Framework to map URL parameters directly to the methods.
</p>
<blockquote>
This not only makes parameter passing intuitive (rather than calling $this->_request->getParam() ) but also automatically uses the default value if provided and if typehinting is provided either via phpdoc comment or before the parameter (array or classname) it will do the required instantiation or type casting.
</blockquote>
<p>
<a href="http://devzone.zend.com/article/10861-Request-parameter-mapping-to-action-method-parameters">The post</a> includes a snippet of sample code, but you can learn more <a href="http://fbdevzone.com/2009/10/request-parameter-mapping/">about the script here</a>.
</p>]]></description>
      <pubDate>Mon, 05 Oct 2009 08:04:54 -0500</pubDate>
    </item>
  </channel>
</rss>

