Paul Jones' Blog: New PDO Behavior In PHP 5.2.1
298536
http://www.phpdeveloper.org/form/view/type/addnews PHPDeveloper.org: PHP News, Views, and Community In a new post Paul Jones points out some of the new behaviors that the extension is showing in the latest of the PHP 5 seres (version 5.2).   He starts with a code example that would work with a previous version of PHP/PDO that would allow for the binding of a single value to multiple places in the SQL statement. But:   Sadly, this is no longer the case in PHP 5.2.1. For valid reasons of security and stability in memory handling, as noted to me by Wez Furlong, the above behavior is no longer supported. That is, you cannot bind a single parameter or value to multiple identical placeholders in a statement. If you try it, PDO will throw an exception or raise an error, and will not execute the query. In short, you now need to match exactly the number of bound parameters or values with the number of placeholders.   Unfortunately, this is used quite often in Paul's Solar framework, so an update to the Solar_Sql_Adapter::query() method has had to been made to allow for the binding of multiple items automatically. It works by incrementing the bind location (like ":foo") with numbers at the end - simple and effective - and you can still pass an array to it and have it automagically work.
686172
Ryan Malesevich is taking a break from his look at some handy WordPress packages to share a small series on how to move from using MD5 hashes out to SHA-1 hashes for passwords in a MySQL database. He's posted part one today.   What if you're using MD5 in your web application and want to switch over to another encryption method. It's actually not that hard and I plan to cover them in this multi-part tutorial (I know I planned on writing this months ago, but it's better late then never). In this first part I plan on going over updating the database structure and a 'pseudo-code' of what will need to be done.   As mentioned, he gives the outline (pseudo-code) of how the process will work - basically, creating an SHA1 hash of the MD5 and the username in a "newpassword" column added to your database.
59423
Christopher Jones has posted to his Oracle blog today about the release of a new beta for the PECL Oracle (OCI8) drivers for PHP.   I've created a PECL OCI8 1.3.1 Beta bundle of the code with Connection Pooling support that I mentioned in http://blogs.oracle.com/opal/2008/01/31.  You can get it from http://pecl.php.net/package/oci8.  The README contains the details.   Of course, it's still in beta, so any testing and feedback is more than welcome. This bundle also includes several other "non-DRCP related bug fixes" including an issue that caused constant pinging for persistent connections.
86929
In a new post to his Oracle blog today, Christopher Jones talks about a bug that's been found in the OCI8 extension involving statement caching and a fix he's presenting.   As part of some testing we were doing, we found that PHP's OCI8 extension had a bug in the way it used Oracle's statement caching. The fix is already in CVS and will be generally available in PHP 5.2.4. After a short period for you to send me comments, Antony Dovgal will also build a new PECL snapshot of OCI8.   He explains the issue, a problem attributed to the switching of a "hard pause" and "soft pause" when the script caching connects to the Oracle database server. This caching feature is enabled by adding an "oci8.statement_cache_size" value in your php.ini file (and has a default size of 20).    If you've been having issues with this request caching and want to get the fix right away, grab it from the CVS. Otherwise, keep an eye out for PHP 5.2.4 coming soon to correct the issue.
586003
Wez Furlong posted a request for comments to the php.internals and php.pdo mailing lists yesterday about a new ly proposed update to the current PDO functionality - PDO 2. He just wants to clear up a few things...   It became apparent over the past year or so that PDO has been a good and valuable addition to PHP. [...] We believe that having direct involvement from the data access providers would be most effective, which is why we set out to try and get them on board.   There were three steps they would need to make to push things to version two (documentation, define scope/direction and organize data provider integration methods) and the proposal that has caused a huge stir in the community - the idea of requiring a CLA contributors would need to sign.  Comments to this point from the community include:  Richard Thomas Antony Dovgal some of Wez's own comments Mike Willbanks Christopher Jones Lukas Smith Paul Jones Pierre-Alain Joye
656049
From Dotvoid.com, there's a new posting talking about the continued use of PHP4 by developers and hosting companies and how it's effecting the community as a whole.    It is true that the PHP 5 uptake has been slow. Many internet service providers as well as many developers are reluctant to switch. This is probably, as others have stated, a circular dependency.   As ISP:s are reluctant to upgrade the popular open source projects are hesitant to upgrade. I still think the wrong people are worried. Still PHP 5 is increasing it's share and finally the day will come when version 4 will be considered legacy. Hopefully before PHP 6 is here but not necessarily.    He continues on, talking about what PHP5 is really about (it's not just the objects!) and things that can help make it an easier sell to those still lagging in a PHP4 world - like the Zend Framework.
640050
In this new blog post today, Evert Pot shares some thoughts on a custom solution he was looking to create as an alternative for PHP's serialize function.   I wanted to build this as a helper class for a draft-PHP-RPC server. The reason I needed a custom one was because I wanted to make sure I would be able to spit out PHP4-compatible serialized data, and in the future, when its ported to PHP6, also PHP5-compatible data.   He came across several issues in the development process including the slowness of his method compared to serialize() and a lack of a way to tell if two variables reference the same data. If you'd like to check out what he has so far, he's made the code available for download.
565545
On Dotvoid.com, there's a new post that reminds us of two of the more "ajaxified" features of the new releases of PHP 5 (like 5.2) - the JSON extension and the functionality to track file uploads.   These features aren't competing for the heavy weight title in the release notes. Still, having these implemented in PHP makes it a lot easier to develop modern, more responsive, web based applications.   You can get more info on the JSON extension here and an example of the file upload monitor in this entry on the Bitflux blog.
248750
This is a followup on Marco Tablini's discussion of the PHP programmer availablity and my earlier attempt at defining enterprise PHP.
449459
DevShed continues their series looking at some of the fundamentals of working with PHP in this new tutorial posted today. It looks at one of the flow control statements the language has to offer and a very useful data structure - the switch statement and arrays.   In our last exciting adventure (back in early November), we braved crocodiles, ravenous editors, most of the PHP statements, and beginning loops. In this edition we'll cover the final statement, the Switch, and discuss arrays. So sit back, order your R2D2 robot to bring you a cold, frosty Jolt Cola, and let's get cracking.   They start with a simple example of a switch statement (to echo out strings) and follow it with a detailed description of the different sorts of arrays - numeric indexed, associative and multidimensional versions.
703645
In a new post to the PHP Security Blog, Stefan Esser points out a recent commit to the PHP core as a fix to the session handling in PHP:   I just came back home and saw a very recent commit to PHP's session management. It is another attempt to fix the session cookie attribute injection that the PHP developers already tried to fix in PHP 5.2.3 without giving any credits. [...] their new fix that consists of blacklisting a bunch of legal characters from the session id, will most probably result in hundreds or thousands of broken sites.   Stefan points out that the fix blocks several valid characters that sites could potentially use in their session IDs, and that with this new code in place, it could drastically effect those site's functionality.   As of the time of this post, however, it seems that the issue has been recognized and corrected so as not to cause the above mentioned issue in future updates.
703914
On his blog, Stuart Herbert has a quick tip showing how to mimic a feature of Ruby on Rails:   I'm still working on the next article in my series looking at PHP on servers, so in the mean time, check out this simple way to emulate Ruby's nice way of handling separate getter, setter and state query methods in PHP.   He admits his example isn't as elegant as the Ruby method, but it does get the job done. Code for the method is included in his post ready for cut and pasting.
336950
David Coallier has posted about a database abstraction layer that he's been developing for PHP 5.2.x only systems and wants some opinions on his methods:   I made a very light DBAL that uses PHP5.2.x only (Since many people seem to want that) and it has the exact same DSN syntax as MDB2 for now and the query method are also called the same (No API Changes). [...] The main goal of the DBAL is to have a very effective and light way of switching RDBMS but also the possibility to change your DBAL to something more "0feature complete" as such as MDB2.   He includes the list of query method names and the types of databases that he wants it to support (as well as mentioning the fact that it would be unit tested for reliability).
620214
On Paul Jones' weblog today, there's a posting covering one of the banes of PHP life - form processing/handling.
493955
Tony Bibbs takes a look at an increasingly popular bit of functionality in PHP5, the SOAP extension, and notes that it still has a "ways to go".   In my latest round of web services work in PHP5 I was creating a PHP5 client that interacts with our Java-based ERP. The client needs to be a combination of a couple of WSDL's into one, nice, compact and powerful client. It should be noted this client will be distributed via the State of Iowa PEAR channel so it will undoubted by used by other project in our organization and throughout state government so the result needs to have a lot more fit-and-finish than would be typical.   He mentions his expectations for PHP's usage of the protocol, including the automatic generation of variables/methods/etc to help the developer use the remote application easier.
553589
Zend has a new tutorial posted in their PHP 101 series - PHP 101 (part 9): SQLite My Fire!
385394
Stefan Esser has a post to the PHP Security Blog about his "Month of PHP Bugs" (March 2007) that will be happening and some of the new effects that the recent release of PHP 5.2.1 has had on it.   Today PHP 5.2.1 was released which fixes some (but not all) of the bugs I will cover in the "Month of PHP bugs". Actually the release announcement already gives a list of bugs that were fixed.    He also comments on the reporting of the bugs in the Changelog and updates in the release announcements and how they're handled.