| Procurios Blog: Syntactic Sugar for MySQLi Results using SPL Iterators |
Rating: 0.00 (0 votes)
From the Procurios blog there's a recent post looking at a method letting you use a foreach on the results from a MySQLi request - SPL Iterators.
Ever wondered why you can't use foreach() on MySQLi Results, and instead have to write less convenient while() loops with fetch_row? Actually, you can use foreach() on MySQLi Results. All it takes is some SPL Iterator magic.
The code examples show how to create an Iterator interface (with rewind, current, key, next and valid methods) to create a ResultIterator class for moving back and forth between the values in the result. This allows you to define the new Iterator object and use the foreach structure like you would a normal result set.
They also show how to bypass this whole problem by using a IteratorAggregate in an extension of the MySQLi interface.
|
|
|
|
 |
| Stuart Herbert's Blog: Researching Distro-Specific PHP Problems |
Rating: 0.00 (0 votes)
Stuart Herbert is looking for some more input on a different sort of question (one that I can't say I've seen asked before) - what are some of the issues with default Linux distribution PHP installs.
Most Linux distributions ship with packages for PHP, but not everyone is happy with these packages. If you're not happy with the PHP packages for a specific Linux distro (no matter how obscure), I'd love to hear what you think the problems are and (if possible) what the correct solution should be.
Just leave a comment on the post with the things you might have noticed. Comments already made reference issues in Debian/Ubuntu, RedHat and a few other more general "state of PHP packages" comments too.
|
|
|
|
 |
| SitePoint PHP Blog: Debug PHP with Firebug and FirePHP |
Rating: 0.00 (0 votes)
bOn the SitePoint PHP blog today there's a new post showing you how to debug applications with FirePHP (an extension of the popular Fireug extension for Firefox).
By combining this extension, which sits on top of Firebug, with a server-side library, your PHP scripts will be able to send debugging information to the browser, handily encoded in the HTTP response headers. Once you're set up, you can log warnings and errors in your PHP scripts to the Firebug console, just as if you were developing JavaScript.
Once you've installed the extension and grabbed the FirePHP library, you can follow along with their example showing the push of a simple message - in this case array values - out to your browser and into the Fireug panel.
|
|
|
|
 |
| Styling a Blog`s Links Bar with CSS Sprites |
Rating: 0.00 (0 votes) 
In this fifth article of a seven-part series I demonstrate how to use a set of CSS sprites to define the visual style corresponding to the normal state of a navigation bar of a fictional blog site. The most complex facet of this process was to create the background image containing the corresponding sprites the rest of the procedure merely involves manipulating the image s X and Y coordinates via CSS....
Email Marketing Software No Mthly Fees - Powerful email marketing software that installs on your server. |
|
|
|
 |
| Community News: Facebook Releases HipHop for PHP |
Rating: 0.00 (0 votes)
Facebook has made their official announcement about their secretive PHP project today and have scheduled an event for them to give the world more information on the project.
Today I'm excited to share the project a small team of amazing people and I have been working on for the past two years; HipHop for PHP. With HipHop we've reduced the CPU usage on our Web servers on average by about fifty percent, depending on the page. Less CPU means fewer servers, which means less overhead. This project has had a tremendous impact on Facebook. We feel the Web at large can benefit from HipHop, so we are releasing it as open source this evening in hope that it brings a new focus toward scaling large complex websites with PHP.
The post elaborates a bit more on what the tool is (not really a compiler, more of an optimizer) and why they decided to go this direction. There's a bit of description on how the tool works and how the transformation happens.
Stay tuned to this post around 7:30pm Pacific time for more information.
|
|
|
|
 |
| Using jQuery to Preload Images with CSS and JavaScript |
Rating: 0.00 (0 votes) 
If you re a web designer searching for a guide to implementing the most common graphic preloading methods available nowadays then you ve come to the right place. This five-part article series lets you accomplish this task by utilizing either a few basic style sheet properties or the functionality provided by client-side scripting. In this fifth part of the series we ll employ the jQuery JavaScript library to assist in preloading our images....
Download a Free Trial of Windows 7 Reduce Management Costs and Improve Productivity with Windows 7 |
|
|
|
 |
| Site News: Popular Posts for the Week of 03.05.2010 |
Rating: 0.00 (0 votes) 
Popular posts from PHPDeveloper.org for the past week:Doru Moisa's Blog: Static call versus Singleton call in PHP
php|architect: TEK-X Webcast Series
Lukas Smith's Blog: Stop building gold on top of crap
Lorna Mitchell's Blog: Simple Database Patching Strategy
Nefarious Designs Blog: Website builds using Make
LifeHacker.com: Synchronize Google Voice with Your GPS Location
DevSnippets.com: Getting Started with CodeIgniter and How to Create All Those Great Apps
Joomla Blog: Joomla Performance Basics
PHP.net: PHP 5.2.13 Released!
Brian Swan's Blog: How to Run PHP in Windows Azure
|
|
|
|
 |
| Don Raman's Blog: Performance improvement in Joomla using WINCACHE user cache |
Rating: 0.00 (0 votes) 
Don Raman has a new post to his IIS blog today with a quick bit of information that Joomla users could use to get better performance with WinCache, integrated directly into the CMS's caching system.
Now that we have WINCACHE 1.1 Beta released which has got implementation for both user and session cache, one can easily take advantage of WINCACHE user cache and increase performance of Joomla. In this post I am going to tell you steps to use WINCACHE user cache with Joomla.
There's a class you'll need to copy and paste to create a new Joomla caching component, but after that it's as easy as having the WinCache tool installed and changing your configuration options to use the new wincache connector class for the CMS's caching.
Here's a direct link to grab this latest version of WinCache since it only works with version 1.1.0 and higher - WinCache.zip.
|
|
|
|
 |
| Johannes Schluter's Blog: Class posing and overloading the "new" operator |
Rating: 0.00 (0 votes)
In this recent post to his blog Johannes Schluter talks about a method he's suggested for testing objects in unit tests - overriding the "new" operator to replace specific classes with mocks.
Two years ago at some conference I had a conversation with Sebastian about the need for a way to overload the new operator in PHP so, probably, bad designed code can be tested more easily by replacing specific classes with mocks. [...] Sebastian then pushed the code as part of a new test_helpers extension with some documentation to github and I fixed some bugs in it. The aim of the extension is to collect functionality which might be beneficial for phpUnit and other test scenarios but which should never reach a production environment.
He includes some sample code to show it in action - defining the mock class, using the set_new_overload function to define it as what should be called when the "new" operator is used and a dump of the result.
|
|
|
|
 |
| Lorna Mitchell's Blog: Simple Database Patching Strategy |
Rating: 0.00 (0 votes) 
In a new post to her blog today Lorna Mitchell has a few suggestions for handling database patching when your application starts to outgrow its simple roots.
One problem that seems to need solving too often is how to keep databases in sync across different platforms, different developers working on a project, and deploying database changes along with code changes. There are lots of ways of approaching this, none of them are really excellent however and personally I tend to err on the side of simple being better. Fewer dependencies means a solution more likely to work on every platform (and no additional complications for the live platform). Usually this means patch files of some kind.
She outlines her usual approach - creating a table with metadata and version information, export the structure of the database in push it into a row, creating numbered patch files and keeping it all stashed away in versioned source control for easy access. Check out the comments for some more interesting ideas.
|
|
|
|
 |
| PHP.net: PHP 5.3.2 Release Announcement |
Rating: 0.00 (0 votes) 
The PHP.net site has posted the release announcement for the latest PHP version in the PHP 5.3.x series - 5.3.2:
The PHP development team is proud to announce the immediate release of PHP 5.3.2. This is a maintenance release in the 5.3 series, which includes a large number of bug fixes. [...] For users upgrading from PHP 5.2 there is a migration guide available here, detailing the changes between those releases and PHP 5.3.
Security/bug fixes included in this release take care of things like:
Safe_mode validation inside tempnam
A possible open_basedir/safe_mode bypass in sessions
Added support for SHA-256 and SHA-512 to php's crypt.
Fixed a bug in the garbage collector that could cause a crash
Crashing when using ldap_next_reference
For more information on the release and what was fixed see the Changelog. You can download this release immediately - source code or Windows package.
|
|
|
|
 |
 |
| Developer.com: Build your own MVC Framework: Getting your Framework Up And Running |
Rating: 0.00 (0 votes)
On developer.com today they've posted the third part of their series about getting your own home-brew PHP MVC application framework up and running.
Welcome to the third part of our voyage into the world of MVC. Our mission: To build an MVC framework that is: Simple, Extensible, Lightweight, Versatile, Fast-loading, Self Templating
In this new part the look at exception handling, create a simple "hello world" example and things to watch out for in their simple framework's current state - like the access control issues it might face.
|
|
|
|
 |
| Jeez Tech: Using APIs With PHP? Here Are Your Classes |
Rating: 0.00 (0 votes)
Jeez Tech has a new post with a great (and long) list of PHP scripts to connect your application to any number of popular APIs out there.
Do you want to use an API but you are too lazy to write your own code to handle the requests? If you code in PHP as I do, then you will definitely need these classes. By using the classes listed here you will be able of using a great number of web services with an easy and documented way.
They link to libraries to work with the APIs for Alexa, Babelfish, Bing, eBay, Facebooks, Flickr, Linkedin, MSN, Twitter, Skype and Yahoo. They also mention PEAR and the role it plays in the foundation of many web service connections.
|
|
|
|
 |
| Lukas Smith's Blog: Stop building gold on top of crap |
Rating: 0.00 (0 votes)
There's a new post on Lukas Smith's blog where he talks about frameworks, phpBB's decision and building "gold on top of crap".
See the various symfony CMS solutions are an example of how wrong things can go. We now have several solutions whose architectural differences are either cosmetic or simply bad design decisions probably a result of trying to invent things in the small ecosystem of a company project team. So I was very happy to hear then that phpBB will adopt Symfony 2 for their next version. Hopefully this will become a role model for others.
He talks about how several of the popular CMS systems these days have worked harder on their external functionality than on the base (where they need the most work). He also looks towards a future where there are good, solid CMS solutions and leaders will emerge from the pack and provide quality content management for the PHP masses.
There's also some great discussion in the comments of the post with people who both share and disagree with some of Lukas' thoughts.
|
|
|
|
 |
| ZendCasts.com: Creating Custom Zend_Form Decorators |
Rating: 0.00 (0 votes) 
On ZendCasts.com today there's a new screencast aimed at showing off custom Zend_Form decorators for your Zend Framework application.
This little video tutorial should set you up for building your own custom Zend_Form decorators in 15 minutes. I'll show you how you can make the necessary class and have it easily added to your existing Zend_Form_Decorator configuration.
If you'd like to follow along with the tutorial as he walks through it you can grab a copy of the source or, for other examples, look through their repository.
|
|
|
|
 |
| Mike Willbanks' Blog: PHP Continuous Integration with Atlassian Bamboo |
Rating: 0.00 (0 votes) 
Mike Willbanks as put together a new post talking about continuous integration with Atlassian's Bamboo software and getting it to cooperate with the needed PHP tools to round out your deployment (like PHP Depend, PHP Code Sniffer, PHP Mess Detector and PHPUnit).
Continuous integration is all the rage these days; you are unit testing your code are you not? During some consulting in January with the help of Sebastian Bergmann, from thePHP.cc, we setup continuous integration utilizing Atlassian Bamboo and received training on PHPUnit. Using Atlassian Bamboo for continuous integration will take you a bit to setup, however, I have found it to be an invaluable tool when utilizing the Atlassian stack (JIRA, Confluence, Crucible, Bamboo and Crowd).
He walks you through the process of getting the PHP tools installed (from PEAR packages) and includes links to two Bamboo plugins to help gather some metrics on the deployment process. He talks about the actual build tool (they went with ant), setting up the locations for where output and external dependencies will be stored and includes the ant build.xml file they use to tie it all together.
|
|
|
|
 |
| Creating an Artistic Blog Header with CSS Sprites |
Rating: 0.00 (0 votes) 
In this fourth part of a seven-part series I build the header section of a sample blog site. It will use another set of CSS sprites -- or in other words a different background image -- to decorate the sections comprising its navigation bar....
Download a Free Trial of Windows 7 Reduce Management Costs and Improve Productivity with Windows 7 |
|
|
|
 |
| Defining the Active State of Menu Sections for a CSS Sprite-Based Navigation Bar |
Rating: 0.00 (0 votes) 
In this third part of a series I put the final touches on our sample navigation bar which uses the functionality of CSS sprites to define the visual presentation of the normal hover and active states of its sections. Constructing a graphic user interface like this is a two-step process. First one creates a good-looking background image and then tweaks its X and Y coordinates via CSS....
Microsoft SQL Server® Value Calculator Reduce Costs & Increase Value with Microsoft SQL Server® 2008. Download Today! |
|
|
|
 |
| CatsWhoCode.com: Getting started with CouchDB: a beginner's guide |
Rating: 0.00 (0 votes) 
From CatsWhoCode.com there's a new tutorial looking at some of the basics of using CouchDB with PHP (the popular NoSQL database). They don't cover the install of CouchDB, so you'll need to have that up and running to follow along.
Have you ever dreamt about a powerful database that you can access easily, without using the SQL language? That what Apache CouchDB is all about. In this tutorial, I'm going to show you how to get started with this document-riented database and how you can use it with PHP.
They briefly cover what CouchDB (and NoSQL databases) are and how their records are stored - document based rather than row/column based like standard RDBMS. They use the PHPillow library to connect to their database and include the code to do an insert and pull that same data back out.
|
|
|
|
 |