Archive for the 'Web Development' Category

Afraid of CSS and Standards?

Thursday, September 28th, 2006

If you are, then take comfort in the fact that you are not alone. Here is an excellent article covering some of the frustrations of moving from table-based layouts to pure CSS. I could relate to a lot of the article's content – maybe you can too…

Issue One of Visual jQuery Magazine Released

Saturday, September 23rd, 2006

Visual jQuery Mag - Issue OneI have posted a number of times about jQuery – a JavaScript (JS) framework that will revolutionise the way you write JS. The community uptake of this framework has been quite impressive. Now there is even a monthly magazine available, courtesy of Yehuda Katz. The first release of the magazine includes the following topics:

  • an editor's note about the magazine
  • a profile of jQuery's founder, John Resig
  • an introduction to jQuery's basic principles
  • an argument for jQuery's philosophy
  • an interview with the creator of the jqMinMax plugin, Dave Cardwell
  • a roundup of three plugins that are useful for creating rich web applications

Why is this framework worthy of so much attention? You need to be a JavaScript coder to really appreciate it's beauty. Basically jQuery allows web developers to write JS the way we think, the way we see the world within the context of the DOM. Not only is it logical and simple to work with, it will drastically reduce the amount of JS you write. That means smaller files, your code is easier to read and understand, and you spend less time coding. It enables you to easily work with AJAX, animations, forms, CSS, and the list goes on – all for including a file only 16k in size.

On top of that, the jQuery community is rapidly adding new plugins and widgets that work with jQuery. The mailing list is also extremely responsive and helpful.

Once upon a time the developer world went crazy about Prototype and Scriptaculous. For me jQuery and Interface leave such alternatives in the dust. Why? Apart from the fact that jQuery+Interface = 66k (16+50) and Prototype+Scriptaculous = 188k (50+128)? jQuery and Interface are just more intuitive to work with and offer the same core features.

Here are some links to get you excited:

Anyway – it is time for me to stop raving. If I keep posting only about jQuery this blog is going to get fairly monotonous! I will now leave you to form your own impressions…

It's Been A While…

Saturday, August 19th, 2006

As regular visitors to this site will have noticed I have not posted any articles for a while. But I am still alive and well! My wife and I have successfully relocated to Wellington, New Zealand, and I am now settled into my new role as Systems Delivery Manager for Database Communications.

I have been working on some pretty interesting projects for companies like BP, Castrol, and Australia Post. The projects have involved the use of several of the tools I have discussed on my weblog over past months. In particular I have been actively using jQuery and the Zend Framework and highly recommend them as a key part of any web developers toolkit.

So … now that I have shown my face again I hope I can return more often. In the meantime, perhaps you would be interested in reading a new 18 page tutorial to help get started with the Zend Framework. Or maybe you would like to check out the new improved jQuery website (still in beta) and some of the great jQuery plugins that have been released over recent weeks.

Until next time…

Lucene and the Zend Framework

Thursday, April 27th, 2006

Zend FrameworkOne of the most talked about features of the Zend Framework is its port of the Apache Lucene project – a Java-based full-text search-engine framework. The Zend Framework allows PHP developers to use Lucene without requiring additional PHP extensions or Java, or even a database.

The theory is that Zend_Search_Lucene overcomes the usual limitations of relational databases with features such as:

  • Fast indexing
  • Ranked result sets
  • A powerful but simple query syntax
  • The ability to index multiple fields

Lucene is well-known for it's speed. For an example have a look at DamnFastDotLucene – this demo site tests the performance of a .Net implementation of Lucene on quite a large set of documents:

  • 9150 text files from the Gutenberg Project
  • The total size of indexed documents is 3.5 GB
  • The index size is 880 MB
  • The Hardware: Pentium 4 3Ghz 800/1MB Cache, 1 GB DDRII Kingston 533, Western Digital Raptor 80GB

The result – it takes approximately the same time to search 5 MB of text as it does to search 3.5 GB of text. I was getting speeds less than 0.125 seconds. That is fast.

That was .Net though – what about the PHP implementation in the Zend Framework?

The reality for PHP developers using the Zend Framework may be a little different from the hype. Some developers are reporting Zend_Search_Lucene as being significantly slower than the queries being run from MySQL or PostGres. Have a look at the following comments in the Zend Framework Mailing List for details.

To be fair it is only very early days for the Zend Framework and Lucene – the project is still in early Alpha. However it is already being adopted by the community for live projects.

If you want to learn more about Zend_Search_Lucene I recommend the following links:

If you have any experiences with Zend_Search_Lucene that you would like to share I would appreciate hearing about it…

Web Developer Toolbar for Internet Explorer 6

Sunday, March 26th, 2006

Internet Explorer LogoWell … it's not as good as its counterpart for Firefox, but it is certainly a useful tool for web developers. The Internet Explorer Developer Toolbar from Microsoft offers the following features:

  • Explore and modify the document object model (DOM) of a Web page.
  • Locate and select specific elements on a Web page through a variety of techniques.
  • Selectively disable Internet Explorer settings – Cache, Cookies, Images, Scripts, Popups.
  • View HTML object class names, ID's, and details such as link paths, tab index values, and access keys.
  • Outline tables, table cells, images, or selected tags.
  • Validate HTML, CSS, WAI, and RSS Web feed links.
  • Display image dimensions, file sizes, path information, and alternate (ALT) text.
  • Immediately resize the browser window to a new resolution.
  • Selectively clear the browser cache and saved cookies. Choose from all objects or those associated with a given domain.
  • Choose direct links to W3C specification references, the Internet Explorer team weblog (blog), and other resources.
  • Display a fully featured design ruler to help accurately align and measure objects on your pages.

There is certainly an abundance of useful features for developers to play with. Enjoy…

Do PHP Files Require Closing Tags?

Thursday, March 9th, 2006

I don't know about you – but I always learnt to open and close my PHP files properly:

<?php
// Included PHP File
// Code goes here
?>

And yet now I am learning for the very first time that the closing PHP tags are not necessary, and in fact in some cases is not recommended!

The first clue I received was when I downloaded the Zend Framework. I noticed that most of the files were missing the closing tags (?>). Then somebody raised the issue on the Zend Framework Mailing List and the penny dropped:

  • PHP files have apparently never required closing tags
  • Leaving out the closing tags helps prevent whitespace sneaking into the ouput and messing with functions like header(), session_register() functions etc.

Well, that is definitely a new thought for me – and not one I have ever read anywhere. It sounds like it will make it into the Zend Coding Conventions though, so take note ;)

Zend Framework Tutorial

Wednesday, March 8th, 2006

For those who want to get started on the Zend Framework, Chris Shiftlett has just written a 6 page tutorial for the php|architect website. It is a good introduction to how the framework fits togethor, and will demonstrate how to structure a web application/site using the MVC (Model-View-Controller) approach.

Chris Shiftlett is a PHP security consultant and he developed a lot of the security features (input filtering etc) in the framework – his tutorial is certainly worth a look

It's Finally Here: The Zend Framework for PHP

Saturday, March 4th, 2006

ZendAfter many weeks of waiting impatiently the Zend Framework has finally arrived – proving that it is not the "vapourware" it has been labelled by many.

The news came from Zend came just a few minutes ago, and includes the following announcements from Andi Gutmans:

We have finally updated the static PHP Collaboration Project page which now points to the individual projects which we have started:

The Zend Framework – We have released a preview release of the Zend Framework. I'd like to thank all the initial contributors who have been of tremendous help in getting this off the ground. There is a lot of work still to do, but after having already seen four applications build with the framework, it is clear that it already includes some very cool and useful modules.

The Eclipse PHP IDE framework – We have submitted a proposal to the Eclipse Foundation for a community based open-source PHP IDE framework. If all goes well in next week's creation review, we will be submitting the initial code drop shortly thereafter. In the spirit of Eclipse, we have already reached out to community members, including the PHP/Eclipse project, and have received great interest to join the effort.

The Zend Developer Zone – We have launched our new developer zone. The goal of this developer zone is to provide best practices with high-quality content from partners and the community. We already have many companies and invidiuals lined up to collaborate around this site who will share their knowledge for the benefit of the PHP community. The site will cover many aspects of best practices including Zend Framework use, interoperating with other technologies, and general PHP best practices around subjects such as security. The Zend Developer Zone is still under active development so expect further changes in the coming week.

Here is a run-down of the features/classes included in the initial Framework release:

Zend_Controller and Zend_View

These components provide the base for a simple MVC website and are already used on the Zend Framework site and several others. A front controller dispatches requests to page controllers. It is as minimalist as possible and it will become even simpler. The Zend_View component provides encapsulation for view logic. It can use templates written in PHP or can be combined with a third-party template engine.
more >>

Zend_Db

Database access is a very light layer on top of PDO. Solutions for existing systems not using PDO (such as mysqli or oci8) are presently under development. Included are adapters, a profiler, a tool to assist with building everyday SELECT statements, and simple objects for working with table row.
more >>

Zend_Feed

The links on the sidebars of Zend Framework home page are generated using Zend_Feed. This component provides a very simple way to consume RSS and Atom data from feeds. It also includes utilities for discovering feed links, importing feeds from different sources, and feeds can even be modified and saved back as valid XML.
more >>

Zend_HttpClient

This component provides a client for the HTTP protocol and does not require any PHP extensions. It drives the web services components. In time, Zend will develop support for extension-based backends such as cURL.
more >>

Zend_InputFilter

The input filtering component encourages the development of secure websites by providing the basic tools necessary for input filtering and validation.
more >>

Zend_Json

Easily convert PHP structures into JSON for use in AJAX-enabled applications.
more >>

Zend_Log

Log data to the console, flat files, or a database. Its no-frills, simple, procedural API reduces the hassle of logging to one line and is perfect for cron jobs and error logs.
more >>

Zend_Mail and Zend_Mime

Almost every internet application needs to send email. Zend_Mail, assisted by Zend_Mime, creates email messages and sends them. It supports attachements and does all the MIME dirty work.
more >>

Zend_Pdf

Portable Document Format (PDF) from Adobe is the de facto standard for cross-platform rich documents. Now, PHP applications can create PDF documents on the fly, without the need to call utilities from the shell, depend on PHP extensions, or pay licensing fees. Zend_PDF can even modify existing PDF documents. Create a sharp customer invoice in Adobe Photoshop, fill in the order from Zend_Pdf, and send it with Zend_Mail.
more >>

Zend_Search_Lucene

The Apache Lucene engine is a powerful, feature-rich Java search engine that is flexible about document storage and supports many complex query types. Zend_Search_Lucene is a port of this engine written entirely in PHP 5, allowing PHP-powered websites to leverage powerful search capabilities without the need for web services or Java. Zend_Search_Lucene's file format is fully binary with its Java counterpart.
more >>

Zend_Service: Amazon, Flickr, and Yahoo!

Web services are becoming increasingly important to the PHP developer as mashups and composite applications become the standard for next generation web applications. The Zend Framework provides wrappers for service APIs from three major providers to make the as simple to use as possible. There is working on more wrappers and engaging API vendors directly to make PHP the premier platform for consuming web services.
more >>

Zend_XmlRpc

PHP 5's SOAP extension dramatically lowered the bar for communicating with SOAP services from PHP. Zend_XmlRpc brings the same capabilities to XML-RPC, mimmicking the SOAP extension and making these services easier to use than ever from PHP 5.

________

It's time to verify if this was worth the wait – click here to download the Framework (7.8Mb)

Is Oracle Buying Zend?

Friday, March 3rd, 2006

ZendThere was a rumor floating around a few weeks ago that suggested Oracle was looking at purchasing Zend. Articles such as this one on BusinessWeek talked about Oracle being in the market to purchase several Open Source companies – JBoss, Zend and Sleepcat Software were mentioned. Since then it has gone quiet, and I have just ignored it as just a rumor. However I am now beginning to wonder. Why? Several reasons…

First of all, Zend promised the first release of the Zend Framework by the end of February – which didn't happen. The forums for the Collaboration project are full of people asking what is going on, with Zend plainly ignoring everyone. The forums are also full of spam, indicating a lack of interest from the Zend team. Or is it? Perhaps it is a sign that Zend have much bigger things to think about – such as an Oracle take-over?

I found it quite interesting that a few days ago Zend placed a link on the PHP Collaboration home page pointing to an article announcing Oracle's purchase of HotSip and Sleepycat – and again highlighting Oracles interest in Zend. What is that link doing there I wonder?

Hmmm … time will tell.

Prototype.js Cheat Sheets

Wednesday, February 22nd, 2006

If you use the Prototype.js framework, or would like to learn more about it, Jonathan Snooks has created some very attractive "Cheat Sheets" that will definitely be of some help to you. Check them out here.