Archive for February, 2006

PHP4Mono

Saturday, February 25th, 2006

I found an interesting project reading planet gnome today. It seems someone has written a PHP compiler for mono. Its hard to tell how far along the project is, since the focus seems on doing mono-ish things in PHP rather then running PHP apps on mono. But the project is open source (GPL) and it does let you use PHP within the wider mono world so thats pretty cool.

Of course that brings up the question, does anyone really want to use PHP inside a managed runtime like mono. I can see the advantage of using PHP to make a GUI app using mono’s gnome stuff since it would be less to learn (if thats actually true) but what would I gain running my web apps using mono, besides less compatability.

Also I know there is the Phalanger project but its not open source so im not interested in looking at it at all.

Cleaning up bugs

Friday, February 24th, 2006

I woke up this morning with 52 emails from Sourceforge. Nothing like being huge loads of bug spam because Greg is working on cleaning up phpDocumentor bugs.

Anyhow I just wanted to thank Greg, and make a couple notes about what good bugs contain.

phpDocumentor Bug submission guide:

  • phpDocumentor Version
  • PHP Version
  • OS Version
  • How your running phpDocumentor, CLI, CLI+ini file, Web interface
  • Instructions on howto reproduce the error
    • A simplified set of code to parse that produces the error
    • How you have phpDocumentor configured, an ini file being the prefered way rather then a mile of command line parameters

Oh patches for bugs are more then welcome, just make note that phpDocumentor 1.3.x development is taking place in PEAR cvs so make it against that.

AJAX and Latency

Monday, February 13th, 2006

So i just saw a great piece by Harry Fuecks on how latency can effect AJAX requests. Its one of his demo’s from the ajax@localhost presentation he gave at the PHP Conference Uk.

Now this showed a number of interesting problems, and while HTML_AJAX does a bit better then some toolkits it doesn’t handle them all. However thanks to HTML_AJAX’s design it not that hard to work around some of them.

So to that extent here is a really simple livesearch demo that keeps the reponses in the same order as the requests. The server is adding latency for you so you don’t need to worry about setting up a proxy to try it out. This is only available from HTML_AJAX svn right now, but we should do a release in another week or so there are lots of other good fixes in it.

Please note this queue isn’t really all that great for livesearch (ie it pounds your server). The current queue that is recommened for livesearch (and the one that HTML_Quickform_Livesearch (demo on my server, not the final version) uses sends a request at a maximum rate of every 350ms (this rate is configurable) instead of per character typed.

Finally this is just a quick hack, if you set the latency up too about 10 seconds you’ll start hitting some bug in the timeout code. The timeout is getting combined amoung multiple elements or something. The JS code might be really leak happy too, the queue doesn’t actually have all that much control of what happens when a request is complete just in when it sent in the current design. So to get around this i replace the users callback with one in the queue, and then do some closure fun. And here is the new queue code if you want to take a look.

HTML FAQ Answer: Other library integration plans

Tuesday, February 7th, 2006

I answered an FAQ question tonight on the HTML_AJAX wiki, im posting the answer here as well since I know most people don’t check the wiki for changes every day.

Outside of this answer I’d like to hear from what other libraries people would like too see integrated with HTML_AJAX and the reasons for this.

Question:
Will HTML_AJAX integrate with other Javascript AJAX libraries such as scriptaculous? How would this integration look like?

HTML_AJAX doesn’t have specific plans to integrate with other JavaScript libraries. Part of this is because external dependencies make for a more complicated installation process. It might make sense to offer some optional dependencies on a library like scriptaculous automatically using its visual effects for the loading box or something, but there isn’t a lot to gain from making default visuals like that flashier since they are designed to be easily replaceable.

Most integration would take place in higher level components. Its unclear weather higher level components like that should be part of HTML_AJAX delivered through PEAR or if they should just be supported by HTML_AJAX and made available from http://htmlajax.org or some other site. If your interested in building widgets or components based on HTML_AJAX please let me know.

HTML_AJAX does however offer the ability to use its library loading mechanism with any JavaScript library. I use scriptaculous in conjunction with HTML_AJAX and I load both libraries through the server.

To do this you just need to register the library with your server and load add its flag to your include line.

PHP code

<?php

$this->server->registerJSLibrary('scriptaculous',
    array('prototype.js','scriptaculous.js','builder.js','effects.js','dragdrop.js','controls.js','slider.js'),'/pathto/scriptaculous/');

?>

HTML

PHPMagazine.net Interview

Thursday, February 2nd, 2006

I did an email interview with PHP Magazine.

Its mainly about HTML_AJAX but there were also some general AJAX questions and questions about PEAR. Responding to an interview like that takes a lot longer then I thought. Anyhow if your interested in the future plans of HTML_AJAX check it out.

This circle expands additional navigation