Sometimes you’ll need to clean up the memory used by PHP. Especially if you have long running CLI scripts this will make sure to avoid the “PHP Fatal error: Allowed memory size of N bytes exhausted”. The basic idea is to remove unused variables from memory by using PHP’s unset() command.
In it’s simpliest form, unset() will look like this:
php $i = "is now set";
unset($i); // remove $i from memory, i.e. tell the garbage collector that it may unallocate $i
Internally, PHP works more or less like Java when it comes to unsetting variables. Thus, unset() will not immediately unset the corresponding variable. Instead, it simply tells it’s garbage collector that the variable is no longer needed and may now be removed from memory. Good news are that the garbage collector now works quite smart and usually you don’t have to take care of how it works. Bad news are, that there are still some cases when the garbage collector fails. Continue Reading
Posted April 4th, 2012. 2 comments
I’ve been working with Zend Studio for quite a while now. And actually, I was pretty happy with Zend Studio aka Eclipse. If you install Zend Studio you’ll get a very nice integrated development environment with everything a programmer needs: a text editor (well, that’s no surprise), a built in debugger, a ready to use profiler, SVN client, and so on.
However, I really hate Zend Studio when in comes to performance. It takes ages to start up (and believe me, I have a pretty fast machine here) and if Eclipse is updating its whatsoever-files you can start your coffee break because the text editor gets freakingly slow. Continue Reading
Posted February 28th, 2012. Add a comment
A few months ago, I wrote an article about how to implement an “under maintenance” plugin using Zend Framework plugins. This plugin allows you to easily redirect users of your website to an “under maintenance” in case of a planned downtime. Simply set a flag in your application.ini and that’s it. In this post we will extend this plugin.
Posted January 18th, 2012. Add a comment - 1 pingback / trackback
It’s finally done. The project that I’ve been working on during the last couple of months is online. Basically, Scoops is a Semantic Web application that enables you to… well, maybe it’s easier if you simply have a look at it ;-).
Some technical notes: the project has been implemented using Zend Framework on the server-side and jQuery on the client-side. The backend (the process that crawls the web, analyzes & organizes text, and calculates a relevance for each user) uses dozens of free or commercial web services.
Posted January 12th, 2012. Add a comment
Version 1.0.1 of ZIDS (Zend Framework Intruder Detection System) has been released. You may download the source code here (Google Code).
If you don’t know yet what ZIDS is, or want to know how it works, please have a look at the manual
Posted August 9th, 2011. 1 comment
Just in case you missed the webinar of Michelangelo van Dam: have a look at his excellent webinar on QA (Quality Assurance) Tools for PHP. Michelangelo presents some really useful tools like PHPUnit, PHP_CodeSniffer, PHP Mess Detector and so on.
You’ll find the webinar here…
If you read my post regarding how to integrate Doctrine using the Zend Framework, you might also be interested in this post written by Matthew Weier O’Phinney on how to autoload Doctrine and Doctrine entities using the Zend Framework.
Posted February 12th, 2011. Add a comment - 1 pingback / trackback
Sameer Borate published his version of a Google Translate Wrapper for PHP on his blog and on Google code. Actually, Sameer’s class pretty much does what I expected it to do, i.e. translating text. The only thing I didn’t like was the fact that – as Google’s API only accepts text up to 5000 characters – it simply creates chunks of text by chopping the text using a dumb
str_split($text, 5000). So here is a smarter version of Sameer’s Google Translate Wrapper. Continue Reading
Posted February 4th, 2011. 3 comments - 1 pingback / trackback
Are you an excellent PHP programmer? Wanna win a ride to MIX 2012 in Las Vegas, a Windows Phone 7 or a Kinect device? Here is your chance…
Posted January 31st, 2011. Add a comment
A few days ago I stumbled uppon an Open Source project that I find very useful: ZFDataGrid. ZFDataGrid enables you to automatically display data stemming from Zend_Table, an array, Doctrine, etc. as a table. Continue Reading
Posted January 30th, 2011. 4 comments - 1 pingback / trackback