Chuck Burgess has posted a discovery he made while working with Eclipse PDT and a command line script that he needed to debug:
This week, I found a need to do this same kind of remote debugging, but for a command-line PHP script. This seems to be something that Eclipse is not already designed to do, as there is no "perpetual listener" available for its debug client. Instructions for remote CLI debugging are available, which showed me that environment variables might be the missing link to getting it working with Eclipse. It turned out to be one of two missing links. The other link was tricking Eclipse into keeping a debug session open (and therefore "listening").
He found that by loading up the PHP file in a shell script with the XDEBUG_CONFIG and XDEBUG_SESSION variables defined, it allows the Eclipse listener to connect and work through the file like a normal web page request.
Evert Pot has a quick post showing how you can make your code fork MySQL connections for better performance.
For some of our long-running processes we use PHP. It makes total sense from our perspective, because we can re-use all our existing business logic from our main PHP web application. To make things more efficient, I recently started some work on using forks and have a couple of worker processes around.
His sample script makes use of the pcntl_fork and pcntl_wait functions in PHP to spawn off processes that will be closed off when no longer needed.
On DevShed today, there's a new tutorial posted looking at two things that can cause headaches for PHP developers (especially when evaluating and comparing values) - nulls and empty strings.
Anyone who has programmed for any length of time has encountered the concepts of null and empty strings. They are not the same, and confusing the two can cause some serious problems. This article deals with these concepts in the context of PHP and MySQL.
They start with a bit of a quiz before getting into how to handle them correctly - making null "safe" and working with it correctly in a MySQL context. SQL statements and table structures are included for their examples.
Let's take a look at 10 useful, yet rather unknown RSS-tricks for WordPress. Each section of the article presents a problem, suggests a solution and provides you with an explanation of the solution, so that you can not just solve some of your RSS-related problems but also understand what you are actually doing.
In this new post to his blog Padraic Brady takes a quick look at a book by Julien Pauli and Guillaume Poncon - "Zend Framework: Bien developper en PHP".
Weighing in at around 450 pages, the contents table is replete with all the topics one would expect including chapters on MVC in the Zend Framework, all the typical components, and appendices (a lot of appendices!) on topics like MVC Theory, Subversion, Databases, Object Oriented Programming, Testing with PHPUnit, etc. It's a very complete book that should be suitable even for absolute beginners to PHP web application frameworks, or anyone visiting from Ruby/Python/Java.
You can find the book at a local (French) bookseller or it can be ordered online from someplace like Amazon.fr.
Stefan Koopmanschap has a new post to the Ibuildings blog today about symfony's 1.2 release.
The first day of december started well: It meant the release of the new symfony 1.2.0 version. Aside from the additions and improvements in the code, this new branch of symfony also reinstates an old tradition in symfony: It comes paired with a huge amount of documentation in many forms. Let's have a look at what symfony 1.2 has to offer.
He mentions multiple updates and changes to the framework as well as three specific improvements in the realm of documentation - the jobeet advent calendar, a symfony + doctrine book and the constant stream of tutorials coming out of the community.
On the AskAboutPHP.com blog eldee takes a look at helpers, plugins and libraries in the CodeIgniter PHP framework including some examples.
With so many published PHP classes and functions, it would be a shame if we couldn't use them in CI. Fortunately CI (like all good frameworks) provides not one but three ways to integrate 3rd code, by using Helpers, Plugins and Libraries. [...] As I found out during the course of my CI project, Helpers, Plugins and Libraries are nothing more than glorified includes. I can pretty much take any 3rd party code and integrate into my application using any of the 3 methods.
His example uses the Google Graph class as each type (helper, library and plugin) with some example code.
Andre Liem has posted five simple tips (part one of a two-part series) on ways to optimize your PHP applications.
After experiencing some issues with an application running the Zend Framework, I realized there were a lot of things I was not doing to optimize my application. There are simple and more complex actions you can take to speed up your application. Since time is precious, and developers with an expertise on optimization are not always available, I've split this post into two sections (simple and more advanced). This post focuses on the simple part.
His simpler suggestions include using the YSlow extension in Firefox, minification of Javascript and CSS, merging CSS/JS requests, using gzip and avoiding CSS background images.
Robert Basic has posted a view helper for the Zend Framework he's developed - one to more correctly handle URLs without dropping the query string information.
Zend Framework's built in URL view helper - Zend_View_Helper_Url - is discarding the query string of the URL, thus breaking some links.
The included helper for URL building formats the output in a slightly unexpected way, so his helper uses this format and, with the help of a few loops and some string appending, spits a "more correct" version out the other side. Complete code and a usage example are included.