Archive for June, 2008

Firefox add-ons

Seems a lot of people publish their list of most used Firefox add-ons. And since i get this questions regulary. I decided to make a list of the firefox add-ons i mostly use. Although some don’t have firefox 3 support yet. These tools have made life as a developer easier. And in some cases speed things up :)

Firebug

This is one of those tools that are indispensable in every web developers toolkit. It’s a great tool for debugging interfaces. You can actively step through the DOM elements. It also allows for dynamically updating the CSS and HTML. But one of the greatest features for me is the displaying of asynchronous JavaScript calls. This makes debugging Ajax applications a lot easier.

FirePHP

This tool integrates nicely with firebug. It makes it possible to show PHP debug information on the firebug console. So the debug data doesn’t interfere with the page your working on. I have to admit. I don’t use it very often. But it’s still a great tool.

Greasemonkey

An extremely power full tool. That let’s you add scripts to automate tasks. Or to trigger certain attack vector’s :)

NoScript

If you’re scared of malicious JavaScript or just want to block those annoying ads. Then this is a great tool.

YSlow

Amazing tool from Yahoo. it let’s you analyze the page load process. It’s great to
track down problems with slow loading pages. Or just a tool to help with optimization.

Event Spy

A nice tool to track DOM events.

Header Spy

Want to know what the web server actually sends back? A great tool for analyzing web traffic.

Live HTTP Headers

Watch HTTP headers send between your browser and the web server.

Measurit

A virtual ruler to use inside your browser. It’s always good to be able to visually measure something

Modify Headers

Gives the ability to change HTTP headers

Tamper data

A nice tool for editing headers and post data. Great security tool for testing webapplications.

Technika

This is an awsome tool from the GNUcitizen project. It adds an active scripting envirement to the browsers. In which it is possible to script almost everything. From the current page to the browser chrome. This add-on acts as the base for other tools. For more information head over the GNUcitizen.

Zend Studio Toolbar

The toolbar that comes with Zend Studio or Zend Studio for Eclipse. It add some PHP IDE features to the browser. Like debugging and profiling. Just a shame that it’s a toolbar and not some status bar icon. The toolbar takes up a lot of space.

LeetKey

This tool adds some text transformation features to the right click menu. When enabled it’s possible to transform / encrypt text with the following encoding / encryption (L337, ROT13, BASE64, HEX, URL, BIN, DES, AES, Morse code)

Unicode Input Tool / Converter

Conver hexidecimal || decimal entities or characters to unicode.

del.icio.us Digg DZone reddit SlashDot StumbleUpon Technorati

Zend Framework is confused

I decided to give the Zend Framework a try. The first attempt to create a simple SOAP based login.

In the first few hours i had absolutely now problems building my small application. But for some strange reason after a few hours ZF started to throw error’s. Mainly for files it was trying to include. These files were in the correct location. Nothing changed. The include path was still set correctly. I found a few bug reports with similar problems. Although there were some solutions. I was not satisfied with them. And had the feeling the problems were caused by something else.

So after i read threw all code. I notice a few lines i copied from Cal Evans book. These lines mainly set the include_path for the current application. And it looked something like this:

$lib_paths = array();
$lib_paths[] = "/path/to/application";
$lib_paths[] = "/path/to/library";
$inc_path = implode(PATH_SEPARATOR, $lib_paths);
set_include_path($inc_path);

I noticed the application directory was added first. So this is also the first part where PHP starts looking for it’s include files. So i decided to switch them. So the code looks like this now:

$lib_paths = array();
$lib_paths[] = "/path/to/library";
$lib_paths[] = "/path/to/application";
$inc_path = implode(PATH_SEPARATOR, $lib_paths);
set_include_path($inc_path);

After this change the problem seems to have been resolved. I still would like to figure out why ZF has problems with finding it’s own include files. Maybe it’s a combination of the wrong include order and the .htaccess file not working well together.

del.icio.us Digg DZone reddit SlashDot StumbleUpon Technorati

Multiple versions of Internet Explorer on one machine

When designing pages for multiple browsers. It’s pretty much a pain in the ass to get things looking similar cross all browsers. There are many Javascript libraries to help and ease the pain. But it doesn’t solve all. And hoping people will stop using IE 6 also doesn’t really help. So we are stuck in getting things work in all those quirky browsers. So a developer / designer probably has multiple browsers installed. On my dev box i only use Firefox.

But when i have to build a design. I need to check al those browsers. So i have Firefox, Opera and Internet Explorer installed. The problem with internet explorer is that you can’t run multiple versions on the same machine. Well at least not without a long hacking session. To solve this problem most of the time i used something like Virtual Machine or Virtual Desktop. The problem is that applications like that eat memory. And there is always the minor annoyances with losing focus on my IDE because the VM window is still active.

Some time ago. My coworker Bart send a link to a tool called IETester. This nice little (24mb) tool let’s you run multiple versions of Internet explorer on one machine. It’s possible to test pages in version 5.5 and up. even the upcomming (still in beta) version 8 is supported. At the time of writing it is still in alpha stage. But it works great. I did have some unexplainable crashes. And there are some known issue’s like:

  • When resizing, the content may disappear. I am working to correct it on the next version.
  • The Previous/Next buttons are not working properly
  • Focus is not working properly
  • Java applets are not working
  • Flash is not working on IE6 instance.

Besides that it does what it’s build for. A nice tool to add to your arsenal.

del.icio.us Digg DZone reddit SlashDot StumbleUpon Technorati

Mootools FX.Slide Flicker bug II

Today i got a question from Richard. About the flicker bug and how to implement the fix. The problem that he had with Javascript throwing an illegal character error was because of copy pasting from this blog. I’m not sure why the single quotes get screwed up. But i will have a look at it. I also didn’t state which version of mootools i was using. It was 1.1 at the time. And i was using the full uncompressed version.

But since then version 1.2 of mootools came out. And id didn’t really had time yet to look into it. But this version also has the same annoying bug. So i looked at the code. The FX.Slide class changed a bit. And the core and plugins are split up into separate files now. But the fix remains the same. And since i don’t really want to write a whole article about it right now. I decided to create two sets of archives. One with the fix for version 1.1 and one for version 1.2. The changes i made are explained in the previous article. But for 1.1 they are around line 4453 and 4458. For 1.2 if you only use the FX.Slide plugin it’s around line 17 and 29.

You can download the archives here:
version 1.1
version 1.2

del.icio.us Digg DZone reddit SlashDot StumbleUpon Technorati

PHP 5.2.6-Win32 unable to load mysql & pgsql extension

Normally i have no problems installing PHP. So when i decided to upgrade 5.2.5 to 5.2.6 on my windows dev box. I was surprised to see that php_mysql.dll and php_pgsql.dll were not loading after a clean install. No matter what i tried. I kept getting the “PHP Startup: Unable to load dynamic library” error.

Some years ago this problem was obvious. The problem was always solved by copying the libmysql.dll to windows/system32. But this changed. For the last year i never had to copy this file. So i couldn’t really believe this was the problem. But after trying for some hours. I gave up. Copied the libmysql.dll file to windows/system32. And voila…. the mysql extension now loads. But i still have no solution for the pgsql extension. Which i really need by the way. WTF happened here? How is it possible that two of the most used extensions do not load after a clean install?

UPDATE*

The postgres problem is solvable by installing the postgres server. And adding the PostgreSQL\8.3\bin to the PATH variable. Weird stuff…

del.icio.us Digg DZone reddit SlashDot StumbleUpon Technorati

Dutch PHP Conference 2008 :) +20%

I wanted to finish this post last weekend, But i was feelings so bad (flew). I haven’t really been near my computer untill now. So here goes. Last Saturday me, Bart and Robbert headed over to the second edition of the Dutch PHP Conference. After getting the name tags. We headed over to the main room. Where i scored a nice PHPWoman t’ shirt for my wife :) Not much later the first keynotes started.

The first keynote was by Zeev. Which i had high hopes for. It’s a opportunity to hear one of the guys that made PHP to what it is. Give a talk. It was mainly about the history of PHP. Because nobody in the audience seemed to know about it. Or they just wanted to hear it from the master himself. I don’t know. I enjoyed the talk.

After Zeev Marco Tabini hit the stage. Which was pretty funny. This guy has a way of talking. And his slides connect to that perfectly. It was amusing and interesting. Although i had some problems getting comfortable in the main room chairs. the name of the talk was “PHP and the Taste of Mayo”. And it was mainly about keeping it simple. And choosing the right tools for the job.

After the keynotes it was time for lunch. Because i was feeling a bit sick i wasn’t really hungry. But the food was good. All kinds of sandwiches and the tasty saucijzenbroodjes. Just good variety. Outside we sniffed some fresh air.. And tried to figure out to which talk we wanted to go. Since we don’t do anything with unit testing at the moment. We decided to go to Sebastian Bergmann‘s talk about PHPUnit 3.3.

Sebastian quickly skimmed through the basics of PHPUnit. How to create a test class and the use of mock objects. After that he showed some new features in PHPUnit 3.3. One of wich is based on behavior based development. It was a story based testing. With the use of method chaining phrases can be build to execute the execute scenario’s. I have to say it’s a strange way. And the code looks kinda weird. I had the feeling Sebastian was also not to happy about it. I guess he tries to keep his users happy. He dropped some words about a new project. I think it was PHP Depend. But i kinda forgot. Couldn’t find any info about it on the net. So we keep that for another time. I had the feeling Sebastian was rushing a bit. He didn’t have enough time. But it was good talk. His slides can be found here.

After the first talk we took something to drink and walked around a bit. Waiting for the next talk to start. We decided to go to Mayflower and Sektioneins security talk. Which was something different then i expected. It was not as technical as i had hoped. But it touched some nice topics. I had hoped Stefan Esser would be there also. But Johann-Peter Hartmann did a great job. The talk was mainly was about Risk assessment. How to identify risk points in your application flow. And how to anticipate to those points. The talk also showed some malicious web trends. Some nice graphs that hacking web applications is not for fun anymore.

When the second talk was over we went outside. i was feeling pretty bad. Seems every time when there’s a conference i come down with the flew. Was thinking about going home. But decided i didn’t want to miss the last two talks. So we headed back to the main room. After getting a nice cold coke. We picked some nice seats and waited for Stefan Priebsch to begin his talk about PHP 5.3 and PHP 6. This was one of the best talks i think. it was pretty interesting to hear about some new features. Although i knew about most. There was a bit of e discussion about namespaces. Some guy in the audience was screaming for attention. Although he made some points. I had the feeling i was sitting near a real life troll :) Anyway Stefan’s talk was good. A bit of irony about the up coming PHP 6 with Unicode support. And some new features in PHP5.3 like, Garbage Collection, SPL, Late static binding which was very interesting. With some nice examples. I ended with a small plug for his new book. Which you can buy over at PHP|Architect. The slides for his talk can be found here.

The final talk was given by Terry chay (the PHP terrorist). I looked forward to this talk. I heard and read a lot about his way of presenting in front of a crowd. And i can tell you. This guy rocks. The talk was of course not without some Ruby on Rails bashing. I had to say this was one hell of an inspiring talk. The talk was titled The Internet is an Ogre: Finding Art in the internet Architecture. His talk was about what he called the four s’s (Stability, Scalability, Speed, and Security). How to build an application the right way. From the bottom up. I didn’t find any slides to the talk yet. They will probably pop up somewhere.

After the last talk ended. All speakers got on stage and received some goodies and a big applause from the audience. The conference was over. And because i wasn’t feeling to well. I went home immediately. Overall i think it was a great day. I learned some new thing. Witch for me is the main thing about conferences. On our way out we picked up a goody bag. Which had a very nice t’ shirt. And some promotion materials. Thanks to all the people who made this happen. And hope till next year

By now some pictures are apearring on flickr.

del.icio.us Digg DZone reddit SlashDot StumbleUpon Technorati

PHP testFest pays off.

It’ s been some time ago already. But on May the 10th. I joined some other Dutch PHP Developers in the PHP TestFest in Roosendaal. It was a small group. But it’s always good to meet fellow developers. I wasn’t at my best that day. With a big party the day before. But never the less i made it to the testfest. And was half a sleep all day. Still one of my test made it into 5_3. No biggie. Just cool! And looking at the list of added tests. A lot of developers around the world did a great job. A thanks to phpgg.nl and Sebastian Bergmann

CVS commit

del.icio.us Digg DZone reddit SlashDot StumbleUpon Technorati

Dutch PHP Conference

In only two days it’s time for the Dutch PHP Conference. The second edition as far as i remember. Last year i also had the intention to go. And the ticket was ready. But two days before the conference i got sick. And stayed in bed for over a week. So this year i have a second chance. Looking at the list of speakers it’s gonna be a great day. With a lot of information to chew on for a while. For those who didn’t buy a ticket yet. At the time of writing there are still some tickets left. A big thanks to Ibuildings for making this happen.

del.icio.us Digg DZone reddit SlashDot StumbleUpon Technorati

Mootools FX.Slide Flicker bug

When my coworker decided to use mootools for a project we are working on. I decided to give it a try also.

I decided to use the FX.Slide effect on some tab based boxes. This was pretty straight forward. The mootools library is pretty easy in usage. And the documentation is darn good. Bellow i will show how to add the most basic FX.Slide effect. This is directly copied from the mootools manual.

To create the sliding effect all you need is the following lines of javascript.

window.addEvent('domready', function() {

    // create an instance of the FX.Slide object
    var mySlide = new Fx.Slide('test');

    // Attach the click event to the wrapper div
    $('toggle').addEvent('click', function(e) {
        e = new Event(e);
	mySlide.toggle();
	e.stop();
    });
});

And of course some HTML to represent the sliding elements.

<h3 class="section">Fx.Slide Vertical</h3>

<a id="toggle" href="#">toggle</a>
<div id="test">
foo
</div>

And some CSS to cover it all in a nice sauce.

#test {
    background: #222;
    color: #fff;
    padding: 10px;
    margin: 20px;
    border: 10px solid pink;
}

So this looks great. It functions well. And the sliding is very smooth. There is one small problem though. When the wrapper contains an element with a style attribute overflow set to “auto”. The sliding will cause a flicker effect on the page. This is probably caused by rescaling the wrapper. Witch in it’s turn rescales the element with attribute overflow set to auto.

I didn’t really try to figure out why this happens. Maybe that’s a later project. But i did come up with a small fix. When a slide object is created. FX.Slide wraps a div around the container that will slide in and out. This wrapper has the attribute overflow set to hidden. I couldn’t figure out why overflow is set to hidden on this wrapper. So i added the ability to set it through the options object. When overflow is set to auto the flicker bug disappears. To add this feature we need to add some small changes to the FX.Slide class.

options: {
	mode: 'vertical'
},

First we change the code above to reflect the code below:

options: {
	mode: 'vertical',
	overflow: 'hidden'
},

Then on the third line of the initialize function we change:

this.wrapper = new Element('div', {'styles': $extend(this.element.getStyles('margin'), {'overflow': "hidden"})}).injectAfter(this.element).adopt(this.element);

To:

this.wrapper = new Element('div', {'styles': $extend(this.element.getStyles('margin'), {'overflow': this.options.overflow})}).injectAfter(this.element).adopt(this.element);

When all this is done and we want to create a FX.Slide object without the flicker bug. We add the options parameter. The constructor will make sure the right value is used.

var mySlide2 = new Fx.Slide('test', {overflow: 'auto'});

$('toggle').addEvent('click', function(e){
    e = new Event(e);
    mySlide2.toggle();
    e.stop();
});
del.icio.us Digg DZone reddit SlashDot StumbleUpon Technorati

Hide .project files from SVN in Zend Studio for Eclipse

I’ve been using Zend Studio for Eclipse (ZendNeon) ever since it came out. I just love this IDE. The fact that i have all tools at my finger tips without needing to switch between applications is just great. Specially when using SVN. But one thing was bothering me. Every time i started a new project. I had to add the svn:ignore for the .project file. There is really no reason to store this in SVN.

Untill yesterday i just added the svn:ignore tag to every project i start. But my eye fell on this post in the yahoo group for ZendNeon. It’s an old post. But yesterday some guy posted a better way of settings this globally.

So to exclude the .profile file from being committed to SVN do the following:

Window > Preferences > Team > Ignored Resources and click the Add Pattern button.

del.icio.us Digg DZone reddit SlashDot StumbleUpon Technorati