PHPDeveloper.org
Matthew Weier O'Phinney's Blog: Module Bootstraps in Zend Framework: Do's and Don'ts
Matthew Weier O'Phinney as a new post to his blog today looking at a few "do's" and "dont's" when it comes to working with module boostraps in your Zend Framework applications - an apparently somewhat confusing topic for several developers out there.
In Zend Framework 1.8.0, we added Zend_Application, which is intended to (a) formalize the bootstrapping process, and (b) make it re-usable. One aspect of it was to allow bootstrapping of individual application modules -- which are discrete collections of controllers, views, and models.He talks briefly about why module boostraps are run on every request (getting into some detail on Zend_Application), how you can properly set up your boostrapping process and how you can use plugins to initialize only the things you might need and, as he openly admits, that there's just not a really good way to handle this sort of module funcionality.
Pablo Viquez's Blog: Zend Framework Documentation
Pablo Viquez has put together something that all of the Windows-based Zend Framework developers might find very useful during their next offline (or online, really) development session - a Windows Help file version of the Zend Framework manual.
As you might now, you can view and download the Zend Framework reference manual from the Zend Framework site and download it from the download section, however what I wanted was the Windows compiled version of it (CHM file). In order to get this version you need to compile the documentation, after running into some small issues, I manage to do it, and to save you some work.He only had to fix an issue with one XML file to correct some escaping in the Zend_Feed_Writer.xml and zend.feed.writer.html files. You can download both the English CHM and the Spanish CHM files depending on your needs.
Johannes Schluter's Blog: Future of PHP 6
With the releases in the PHP 5.x series (5.3 and now a newly branched 5.4), people have been left wondering about PHP 6 and the promised Unicode support it will include. Development on that branch had all but stalled out and things weren't looking too good for the method of introducing full Unicode support to the language. Johannes Schluter has some good news, though - the effort has been restarted and a new approach has been decided on.
Yesterday the stagnation created by the situation has been resolved and it was decided that our trunk in svn will be based on 5.3 and we'll merge features from the old trunk and new features there so that 5.3 will be a true stable branch. The EOL for 5.2 has not yet been defined but I suggest you to really migrate over to 5.3, which usually can be done with very little work, as soon as possible.Discussion are being made about which type of Unicode support will actually be introduced with a "string class" wrapper gathering some support behind it to provide an alternative to the current string handling.
Ian Christian's Blog: Handling Uploaded file in symfony's admin generator
Ian Christian has an informative new post for the Symfony developers out there. He's figured out a way to handle uploaded files with Symfony's admin generator relatively easily, changing the filename option.
When a file is uploaded using sfForm in the admin generator, by default the filename that's used is a random string, which can look bad in URLs. If you want to change this, it's not immediately obvious how - but it is incredibly simple.The Symfony project does have some documentation on the topic, but it's not the easiest to read. It basically boils down to is defining a function in your extended class based on the name of the file where you can change the name however you'd like. Code snippets are included to make the point a bit more clear.
Jani Hartikainen's Blog: Should a failed function return a value or throw an exception?
Jani Hartikainen poses an interesting question on his blog today - is it more correct for a function, having failed at its job, to return a value of throw an exception.
You have created a nice, well written function, but you realize you forgot something: The failure case. What should a function do when it fails? There are two schools for this - the "throw an exception" school and the "return an error value" school. But which of these is the correct approach?He suggests that this debate has stuck around from the time when there weren't exceptions in several popular programming languages and that returning the value was the only valid way. He touches on what an exception condition is (with a few code examples) and situations where each choice might be the right way to go.
Brian Swan's Blog: MSSQL vs. SQLSRV: What's the Difference? (Part 2)
Brian Swan has posted the second part of his series looking at the difference between the MSSQL driver and the SQLSRV drivers for connecting to SQL Server databases from PHP (part one can be found here). He gets a bit more detailed in this second post.
I'm aiming to provide a high-level comparison that you might use if you were considering moving to the SQLSRV extension, but I think there is also some interesting information if you are just curious about the differences. [...] In cases where a short note wasn't enough (and there were several of these), I've provided relevant links to topics in the SQLSRV documentation.He talks about things that one offers that the other doesn't, like prepared statements (sqlsrv) and working with stored procedures (mssql). He also mentions error handlng, persistent connections and scrollable cursors in sqlsrv. Finally he gets into a one-to-one function comparison of the two drivers with the sqlsrv function list coming up a bit short compared to the features of the more recend (and well-supported) mssql driver.
Phil Sturgeon's Blog: CodeIgniter 2.0: Everything you need to know
Phil Sturgeon has posted a look ahead at everything you need to know about the next version of the popular CodeIgniter framework, version 2.0.
It has been 6 months since the last CodeIgniter minor update and 18 months since the last major update. Through all this time we were given no information about the next release of CodeIgniter, but finally 2.0 is on the way.Because of the Ellis Labs move to Mercurial for its version control system (and BitBucket for the repository), it allows for a more "social coding" environment where it's easier for developers to just fork and contribute. Other major changes for this upcoming version include the fact that PHP4 support will officially be deprecated, driver libraries, application "packages", a smaller reserved controller name list and the dismissal of plugins.
Check out the Changelog for more detailed information as things are updated.
Site News: Popular Posts for the Week of 03.12.2010
- Brian Swan's Blog: What's the Right Way to Prevent SQL Injection in PHP Scripts?
- Brian Teeman's Blog: Who is the Joker in the Joomla pack?
- PHP.net: PHP 5.3.2 Release Announcement
- CatsWhoCode.com: Getting started with CouchDB: a beginner's guide
- Matthew Weier O'Phinney's Blog: Responding to Different Content Types in RESTful ZF Apps
- Zend Developer Zone: How to avoid Identity Theft in Zend Framework with Zend Auth
- Alvaro Videla's Blog: Erlang as a Fast Key Value Store for PHP
- Site News: Job Postings for the week of 02.28.2010
- Template Monster Blog: It's coming! WordPress 3.0 - Pros and Cons
- Kavoir.com: Just Hashing is Far from Enough for Storing Passwords (Dictionary & Rainbow Attacks)
php|architect: Programming: you're doing it wrong
In an opinion piece posted to the php|architect site Marco Tabini suggests that we (as developers) are doing it wrong as we move further and further away from the pragmatic side of programming into the abstract.
No matter how advanced the techniques that we use, there is always something that we could be doing better. [...] Which one is right? The real problem is that the answer to that question is, "yes." That's because it lacks a specific context in which it can be inserted.He suggests that, in our quest to figure out what the perfect case for any situation, we stop focusing on the practicality of writing applications to accomplish goals. Sometimes it's not about getting the right theory behind the code - sometimes it's just doing it.
Brian Moon's Blog: PHP command line progress bar
Brian Moon has a quick post that links to a but of code that gives you a progress bar for the command line that's flexible enough to be used in an number of situations.
Was just looking through some code and came across this function I wrote some time ago. If you do a lot of your processing scripts in PHP like we do, you probably need to know what is going on sometimes. So, I made a progress bar for use on the cli. I thought I would share it.You can see a demo of it here (screencast) or just download the code. Comments on the post also point out the PEAR Console_Progressbar package and the ez Components class for creating a more advanced progress bar.
Alan Skorkin's Blog: How To Fix The WP-Syntax Special Character Escaping Issue
Alan Skorkin has a recent post to his blog about a trouble that many WordPress users have come across in working with their content and the WP-Syntax plugin (for displaying code) - a special character escaping bug that escapes characters that don't need it.
Suffice to say, [WP-Syntax] does the job fine except for one very annoying issue. Whenever you have any kind of special characters in your code (which you inevitably do e.g. <, >, & etc.), these always render as their escaped representations.It only happens with the WYSIWYG editor for writing content (which the tool's FAQ recommends turning off) but there's a better solution that Alan found - change a line of code in the plugin to use the htmlspecialchars_decode function to rid your install of this pesky escaping bug.
Eli White's Blog: An intriguing use of lambda functions
In a new post to his blog today Eli White takes a look at an interesting use of lambda functions he's figured out for a his development at work.
I found a very specific use out of the blue of Lambda functions that I have now used and I see as a great use-case. Which is specifically passing functions/logic from your Controller to your View. In the case of Goodsie, I'm using PHP for my templating language and as usual I'm trying to remove as much logic from my View as possible, while still allowing the view to be malleable.His method centered around a pagination subview that he wanted to make flexible enough to work with both the standard page view and with an ajax request. Lambda functions came to the rescue by dynamically creating a function based on the request need.
Site News: Blast from the Past - One Year Ago in PHP
- Noupe.com: Beautiful Forms - Design, Style, & make it work with PHP & Ajax
- Sameer Borate's Blog: Web scraping tutorial
- David Goodwin's Blog: Storing PHP objects in a database (please no!)
- Noupe.com: 10 AJAX-based, PHP WebMail Clients For a Great User Experience
- Juozas Kaziukenas' Blog: Starting with Zend_Search_Lucene
- AskAboutPHP.com: Codeigniter: Mixing segment-based URL with querystrings
- NETTUTS.com: Creating a File Hosting Site with CodeIgniter
- PHP.net: 5.2.9-1 (for Windows) released
- NETTUTS.com: Diving into PHP
- Christian Stocker's Blog: Upload Progress Meter for Windows - The next take
- Tony Bibbs' Blog: MVCnPHP (A Framework)
- Echolibre Blog: Customising Zend Framework Routing
- NetBeans Blog: Selenium plugin for PHP
- Community News: Responses to "PHP micro-optimization tips"
- Chris Jones' Blog: The PHP "./configure --with-oci8" Option in Detail
Perplexed Labs Blog: PHP Forking to Concurrency with pcntl_fork()
On the Perplexed Labs blog there's a recent post looking at how to fork processes in PHP with the help of the pcntl_fork function and the process management extension.
Let's say you want to take advantage of more than one core for a given process. Perhaps it performs many intensive computations and on a single core would take an hour to run. Since a PHP process is single threaded you won't optimally take advantage of the available multi-core resources you may have. Fortunately, via the Process Control (PCNTL) extension, PHP provides a way to fork new child processes.He gives a quick snippet of code showing how to spawn off a few new processes, get their process IDs and watches a max number of children until one dies (then starts another).
Community News: Microsoft Returns with The Ultimate Coder Battle
Microsoft is back with another round of their Ultimate Coder Battle for Canadian developers wanting to create Windows-based PHP applications for some great prizes (like a Dell computer makeover or a Dell notebook).
Now's your chance to put those skills to the test, going toe-to-toe with Canada's best and brightest web developers during the FTW! Coding Competition. Choose your weapon...ahem...language and platform to develop the next great Canadian Web App. Walk ten paces, turn, andWebitech.net: Create an Impressive Content Editing System with jQuery and PHP
On Webitech.net there's a new tutorial showing how to combine PHP and jQuery to create a simple content editing system when you don't need a full-blown CMS to manage the pages of your site.
I'm going to show you how to use jQuery and PHP to build a content editing system that will allow you or your client to easily edit .html pages visually. [...] Our file structure is going to be really simple - just admin.php, the wymeditor package and jquery together in the demo directory.The tool uses PHP's file_get_contents to pull in the source of the page into a textarea and edit it with jQuery and the WYM Editor. Full code is included for your cut and paste pleasure but if you need a quicker fix, you can download the source. There's also a demo to see it in action.
php|architect: It's not all about the code
In a recent (quick) post to the php|architect site Koen Van Urk reminds us that it's not all about the code, there's planning to consider too.
Sure, it is important to have your code as bug free as possible, well documented and as optimized as possible. It is, however, impossible to achieve this all without prior planning. Good project coordination.He suggests one of the most useful and reliable forms of planning and defining the requirements for an application - writing them down on a normal piece of paper. Then from there let the ideas flow with things like look and feel, mapping out page structure, etc. Website planning tools are good, but when it comes down to basic prototyping, sometimes there's just nothing better than a pencil and a few sheets of plain white paper.
Brian Swan's Blog: mssql vs. sqlsrv: What's the Difference? (Part 1)
In a new post to his blog Brian Swan compares the database drivers for MSSQL and SQLSRV by what they have to offer and what the real differences are to your applications.
In this post I want to begin looking at some of the differences between the two drivers and perhaps gain an understanding of why the mssql driver continues to be used (although I have some good guesses). There are lots of comparison points between the mssql and sqlsrv drivers. I'll break my comparison into two posts, focusing on high-level differences in this post and then dive into an API comparison in the next post.This first of the two parts looks at some of the differences between the two - the Microsoft support for the sqlsrv driver vs community-driven mssql and the fact that they're very different "under the hood" (see this diagram).
CMStr.com: How to manually install Joomla 1.5+
From CMStr.com there's a new tutorial showing you how to set up Joomla manually just in case something happens with the install and you need to change things yourself.
Why would I want to do a manual install when my web host has this Fantastico thingy that will install Joomla for me? Good question. [...] If you are building websites for a living, and or plan on using Joomla a lot, then you really need to start doing your own installs. [...] If you are an experienced parachute jumper, you would pack your own chute right? This is no different.Screenshots are included to help make the process easier as they walk you through setting up the basics like language settings and database information. They also touch on the FTP setting (off for security) and removing the admin user's information to help make things a bit more secure. It's not a comprehensive list of the things you'd need to do to get it 100% configured for just what you need, but it's a start.
Kavoir.com: Just Hashing is Far from Enough for Storing Passwords (Dictionary & Rainbow Attacks)
On Kavoir.com there's a new post that reminds you that hashing isn't enough anymore to protect your users and their passwords. They offer a suggestion or two of what you can do to help lock things down a bit more.
The common practice is to hash the user password and store the hash string of the password in the database. When the user tries to log in and supplies his password, it is used to generate a hash string to be compared to the one stored in the database. [...] This approach may be secure in the 70s of the last century, but barely any more.Computing has evolved enough to where hashed can be matched, sometimes in less than two or three minutes. Their answer to the problem? Generate a random salt each time you create the hash with a constant being used as a base. A code snippet calling a user-defined function and the sha1 function are included.
