Dave Dash's Blog: Saving a file to a database using symfony and doctrine
605153
From the Spindrop blog, there's a quick new post that shares the code needed to save a file to a database inside of a symfony application:   I like to save content uploaded by website visitors to a database versus the file system. It makes it easy having the data all in one spot. I tend to overcomplicate this process, so I wanted to write down the important steps.   His two step process involves modifying your application's form helper and the code to pull the binary data out of the submit and push it into a new object.
242013
Popular posts from PHPDeveloper.org for the past week:ProDevTips.com: Writing a CMS/Community with Smarty and the Zend Framework: Part 6Nessa's Blog: Using an .htaccess with PHP Compiled as CGIArnold Daniels' Blog: How I PHP: The Output Handler - ContinuedMartynas Jusevicius' Blog: PHP 5 features: Class autoloadingSean Coates' Blog: Actually Solving a Problem (believe it or not)The Northclick Blog: Message Queue Project: First working versionStefan Mischook's Blog: A Question about object properties in PHP ClassesJob Posting: G2 Technology Seeks PHP Developer (Memphis, TN)Rob Allen's Blog: Zend_View: Access the view from a view helperDavid Walsh's Blog: Using PHP Generic Objects To Organize Your Code
548706
The Zend Developer Zone has posted a review of Packt Publishing's "Learning PHP Data Objects" book writen up by Akash Mehta.   In Learning PHP Data Objects, the author Dennis Popel examines this new [database access] system and explains how to begin using PDO in development as a replacement for typical database drivers. The book is an excellent introduction to the data abstraction layer and also provides essential insight into the inner workings of database interaction with PHP.   Akash talks briefly about the history of PDO and what it can be used for first, then gets into the contents of the book (things like the intro chapters and the quality of the writing). The thing he thinks makes the bok stand out, though, is the examples and sample code that reflect both simple methods and more complex issues PDO developers might run into.
575210
Popular posts from PHPDeveloper.org for the past week:PHP-Coding-Practices.com: How I Turned A Slow Array Sort Into A Quick One Using Quicksort AlgorithmZend Developer Zone: PHP Abstract Podcast Episode 4: Planning ProgrammingWeb Development Blog: Save bandwidth with PHProxy and ip2nationJob Posting: Assembleron Ltd Seeks PHP 5/MySQL/Ajax Developers (Reading, UK)PÃ¡draic Brady's Blog: Complex Views with the Zend Framework - Part 6: Setting The TerminologyThe Bakery: Four New Articles - Load Balancing, Request Info, UUID Behavior & Upload ThumbnailsCommunity News: PEAR Installer version 1.6.0 releasedChristopher Kunz's Blog: Building PHP with cURL and libmysqlclient5DevShed: Working with Prepared Queries with PDO Objects in PHP 5Secunia.com: rPath update for gd, php, php-mysql, and php-pgsql
503521
On the symfony blog today, there's a new article looking to dispel some misunderstanding that's come up surrounding the speed of symfony applications and what effect it can have in a real-world situation.    We regularly see framework benchmarks pop up somewhere on the net, comparing symfony to other frameworks, either in PHP or in other languages. The conclusion of some of them is "symfony takes more time than other frameworks to display a 'hello, world', which makes it unsuitable for real-world web applications".   If some benchmarks show that symfony is slower, jumping to the conclusion that symfony is not optimized is a big mistake. [...] If symfony is well implemented (or so we think), then its speed is just the sum of the individual speeds of all the features it includes. Or, to put it differently, Symfony's speed is the consequence of a series of choices that we made to decide whether a feature should or should not make it to the core.    They suggest that the speed of symfony applications does not come as a result of the main portion of the framework, but rather as a choice of the development team as to what parts they wanted to include in the core and what not to. They also point out that, while speed does matter somewhat, especially in larger applications, it shouldn't be highest on the list.
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
211060
A few days back there was a post on the "The Codist" blog about why the author would never quite understand the appeal of PHP to the masses and some of his thoughts behind it. Well, there was such an outcry and response to his comments that he's written up another post on what he learned from comments made.   Clearly I touched a nerve. However I did learn a lot of things that you don't read in a quickly tutorial on PHP. The whole point of writing something is to get feedback, positive or negative, and hopefully learn from it.   He admits that his experience with PHP and its developers has been limited, so his perspective might have been thrown off a bit. He still holds to one thing from the previous article, though - that PHP just isn't for him.
198996
Continuing on from the first part of the series looking at the use of Adapter objects, DevShed has posted part two today - using the Adapter objects along with Directory Iterators to integrate with a MySQL database.   Provided that you understand the basic concepts of the adapter pattern, in this final tutorial, I'll show you how to use it in conjunction with the "DirectoryIterator" class, bundled with PHP 5, and with a couple of MySQL wrappers as well.   They jump right in (as was said, assuming you read the previous article) to using the directory iterators and the adapters together to make a class that gets information about the files in a directory. They take this and show a sample use that's then transformed into a class capable of using the same logic on MySQL results.
670884
Why a standard single-file SQL format is necessary and how SQLite can get us there.
345914
Perl is so good at handling plain text files that it's seductively easy to use them when you need something better. Yet sometimes using a full-fledged database is just Too Much Work. If only Dave Baker had written an article on using complex, persistent data structures with MLDBM.
241556
Cody Caughlan has created a project that brings one of the popular features of Ruby on Rails to the world of PHP5 - database migrations.   One of the cool things I like about Ruby on Rails is the use of "migrations" for maintaining your DB. Migrations have proven to be pretty handy in keeping a local database in sync with the work of other developers. [...] Because migrations are incremental and they are done in a structured manner, it is a great way of pushing out new DB changes to the production database servers.   His framework, Ruckusing Migrations, is a modular framework that makes use of some of the more advanced features of PHP5. It's portable (via an adapter interface) and uses a generic task interface (task files) to load functionality into the framework. There's also plenty of API hooks to allow for a developer to easily create their own custom operations.   Check out the project homepage for more information.
553589
Zend has a new tutorial posted in their PHP 101 series - PHP 101 (part 9): SQLite My Fire!
710066
DevShed continues their series covering SQLite in PHP5 today with the final tutorial - "Additional Methods for Using SQLite with PHP 5":   The list of additional features offered by SQLite is really impressive. Therefore, in this last article of the series, I'll be taking an in-depth look at them. This will complete our analysis of this excellent RDBMS integrated with PHP 5.   First up is a look at the usage of the seek and lastInsertRowid functions followed by the changes and queryExec methods. They show how to use the createFunction method and show one of the more advanced features of SQLite - creating a database that only exists in the server's memory.
767079
After struggling with it for a good while, Maggie Nelson finally figured out the answer to her problems with Oracle, PDO and CLOBs - they're just not supported.   LOB support was added to PDO_OCI in PHP 5.1. This is really cool, however, it appears that the LOB support really means BLOB support. After much investigation and self-doubt (e.g. "what if we're using streams incorrectly?"), we found out that PDO_OCI does not currently support CLOBs (BLOBs only!).   The bug's already been documented and remains open, but Maggie encourages all of the Oracle developers out there with the fact that Chris Jones (of Oracle) knows about the issue and plans to correct it in the next release of the extension.
259923
Chris Hartjes has a quick post (but complete with code) about moving files around a bit differently than the norm - it's his method for using a HTTP-PUT to push a file out.   A work project is getting close to 0.1 status. Pretty underwhelming, I know. One of the last 'milestones' for 0.1 is taking these wonderful XML documents that my web app creates and sends them to an internal web service. This web service will accept documents via an HTTP PUT [...] so I dug around a bit on the web and put together some code.   The code is a generic "publish" method that opens a stream to the remote server and, in a binary format, pushes the contents of a local file and parses out the response.
622401
The International PHP Magazine has posted results from their latest poll conducted over this past week asking which, of their given options, is the best helpful hint for creating a web application in PHP.   Two of the options ranked higher than the rest with one (Page/object caching) coming out on top of the other (Don't save performance testing for the end of the project). The remainder of the votes were divided pretty evenly between the last three options: "Use multi result set queries to your database", "gzip compression", and "Tune your web server".   While you're in the polling mood, you should check out this week's new poll that wonders which of their options might be the biggest hindrance to PHP5's adoption in the community.
404798
The International PHP Magazine is back this week with the results from their latest user poll that asked the question "Which Stage Comes First in the Development of the Basic CMS?"   Of course, of the options they gave, "Planning your CMS" came in with an overwhelming lead of 60.5 percent of the votes. Lagging far behind that was "Further Development" and "Database creation". It is good to see that a large majority of the people out there think that taking the time out to plan out the application first is the best way to go. Throwing something together, especially something that can get as complex as a CMS, is a very bad idea.   Be sure and get your votes in on this week's poll that asks which of the given options including "Web and command-line interface" and "Generates a todo list from @todo tags in source") wouldn't be a good option to be added to the phpDocumentor functionality.