Archive for the 'Web Development' Category

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.

WordPress Plugin: Visual.SpellCheck

Saturday, February 4th, 2006

Current Version: 0.95

I don't use the WYSIWYG Editor that comes with WordPress 2.0, and as a result have been getting extremely frustrated with the lack of a spell-checker. So I decided to try and get one working, preferably using AJAX to make it as fast and user-friendly as possible.

I am now proud to present Visual.SpellCheck – an AJAX-based Spell Checker for WordPress. It includes the ability to:

  • Highlight incorrectly spelled words
  • List suggested words from the aspell dictionary
  • List suggested words from your custom dictionary
  • Allow new words to be added to your Custom Dictionary

The Spell Checker works in Firefox, Internet Explorer, Opera and Safari.

Demo

Here is a demo of Visual.SpellCheck. It should work fine in Mozilla browsers (including Firefox) and Internet Explorer. It will also function in Opera, although there are some small issues. Follow the instructions in the textarea itself, and feel free to edit it's contents and then test.

Installation

Follow these basic steps:

  • Download this file: Visual.SpellCheck.zip (37Kb)
  • Unzip the file on your computer.
  • Upload the complete folder "Visual.SpellCheck" to your WordPress plugins directory (found in "/wp-content/plugins")
  • Login to WordPress and go to the Plugins module
  • Find the line that says "Visual.SpellCheck" and click "Activate"
  • Change the permissions on the file Visual.Syntax/personal_dictionary/dict.txt" to "757″ so that the server can write to the file

Note: Pspell must be installed on the server for this to work. Also this plugin is not compatible with the WYSIWYG HTML Editor that comes with WordPress (TinyMCE comes with its own spellchecker anyway). You will have to disable the WYSIWYG and be using the old-style editor (textarea).

Credits

This project is based on code from Broken-Notebook. Thanks to Garrison who has modified his original code to allow the plugin to integrate with WordPress and minimise issues with future compatibility.

Known Minor Bugs

This is the only bug I am aware of – and it is pretty minor:

  1. In Opera the popup menu that shows the suggested words always sits top-left of the textarea

If you are able to help with this that would be great. :)

ChangeLog

2006-02-04 - Firefox QuickTags conflict fixed. Now version 0.95
2006-02-04 - Public release of version 0.90

If you liked this plugin you can digg it here or please leave a comment.

IBM in the News: AJAX, DB2, LAMP

Friday, February 3rd, 2006

IBMThere have been some very exciting developments from IBM over the last few weeks. Here are four areas of major interest to me:

AJAX Toolkit Framework (ATF) Project

In January 2006 IBM announced the ATF Project. The goal is to extend the Eclipse platform to allow for extensible frameworks and exemplary tools for building IDEs (integrated development environments) for the many different AJAX runtime offerings such as Dojo, OpenRico, and Zimbra. These tools will contain features for developing, deploying, debugging and testing AJAX applications, which is not so easy to do using development tools of today.

The tools built upon these frameworks will include some very exciting features:

  • Enhanced JavaScript editing such as edit-time syntax checking;
  • An embedded Mozilla web browser;
  • An embedded DOM (Document Object Model) browser;
  • An embedded JavaScript debugger.

Open Ajax Initiative

On February 1st IBM and other industry leaders announced the "Open AJAX" initiative to promote the adoption of AJAX technology. This project is going to see collaboration between BEA, Borland, the Dojo Foundation, Eclipse Foundation, IBM, Laszlo Systems, Mozilla Corporation, Novell, Openwave Systems, Oracle, Red Hat, Yahoo, Zend and Zimbra.

The goal? To promote Ajax's promise of universal compatibility with any computer device, application, desktop or operating system, and easy incorporation into new and existing software programs.

DB2 Express-C

On January 30th IBM introduced a free version of its DB2 database. DB2 Express-C is the same database as IBM's commercial offerings but the company places limits on what kind of hardware it can run on. It can be deployed on systems with two processor cores or up to two dual-core chips on AMD or Intel-based servers. The memory limit is 4GB but there are no limits on the size of database or number of users.

This move really follows the footsteps of Microsoft with SQL Server Express, and Oracle with Oracle 10g Express Edition.

Already the LAMP-based community is showing interest in using DB2. For example ActiveGrid has just released an edition of its front-end development tool and server software to work with DB2 Express-C. DB2 offers some exciting functionality not found in PostGres or MySQL, such as the ability to combine PHP with DB2′s native XML capabilities.

PHP Collaboration Project

This is now old news, but late last year IBM joined forces with Oracle, MySQL, Intel, Actuate, ADP, FileMaker, Schematic, StepUp Commerce, OmniTI, 100days.de, SugarCRM, bebe.com, and Marco Tabini (publisher of PHP Architect Magazine) in the PHP Collaboration Project. The initial objectives of the project are:

  • Zend PHP Framework: A Web application framework which will standardize the way PHP applications are built. The framework will accelerate and improve the development and deployment of mission-critical PHP Web applications
  • Engagement with the Eclipse Foundation: Zend is joining the IBM founded Eclipse Foundation as a Strategic Developer. Zend is now proposing to lead a project focused on PHP within Eclipse

 

I for one am enjoying seeing IBM partnering with other companies and projects to help formalise the future of AJAX and a PHP Framework / toolset. I haven't decided about DB2 yet for my everyday projects – but I will be taking a look for sure.

AjaxTK: The Ajax Toolkit from Zimbra

Thursday, February 2nd, 2006

Zimbra LogoZimbra released the AjaxTK JavaScript development library last year. Running under the Mozilla Public License (MPL) developers can use this toolkit in their browser-based applications. The toolkit is actively used by Zimbra in developing the Zimbra Collaboration Suite, one of the most full-featured AJAX applications I have ever seen. Because of it's development in conjunction with a real-world application, and because of the number of widgets and JavaScript utilities included, AjaxTK may well be one of the most advanced JavaScript toolkits available at the moment.

There is a problem however – there is basically no documentation for using AjaxTK, other than an extremely technical overview of the framework in PDF format. There are currrently no online examples of the widgets being used (other than the demo of the Zimbra Collaboration Suite itself). And while you can download the toolkit from Zimbra, their examples are heavily tied into JSP which is a major problem for me because I have no intention of using JSP.

So – here is a small step toward helping the community to get started. Full credit goes to Xiris, Chouser, Zuser and especially Smies for their posts on the Zimbra AjaxTK Forums.

AjaxTK Tree ExampleZimbra AjaxTK Tree Example

open example here

This is a standard DHTML tree, but it also demonstrates Drag 'n' Drop and custom Tooltips. Try dragging a contact from the top branch onto the label of the second branch.

AjaxTK Grid ExampleZimbra AjaxTK Grid Example

open example here

This is an extremely full-featured example. It demonstrates tabs and a grid that has resizable columns, movable columns and column sorting. You can filter the listings on the left (which is fully client-side). And the grid listings are paginated, allowing you to open 3 pages of listings in the grid.

Download Examples and AjaxTK Library

The above examples and the full source code are available for download in a ZIP file (466kb). Once again, thanks to Smies for getting this working.

 

So … what do you think? How does this compare to other AJAX libraries in your opinion? To be fair to Zimbra, they have only fairly recently released this toolkit to the community and it is yet early days (like most AJAX projects). They have some very positive thoughts on what AJAX libraries should be able to acheive in the future, so hopefully this is an indication of where they will take AjaxTK…

If you liked this post you can digg it here.

Optimise your JavaScript and CSS

Thursday, February 2nd, 2006

The Zimbra team have posted an article with some very interesting tips on how to optimise your Javascript and CSS so that you can reduce the launch time of your website or application. There are detailed explanations of the methods used and a case scenario demonstrating a reduction in file-size of around 300-400%. You may pick up some good tips here

It’s here: Internet Explorer 7 Beta 2

Wednesday, February 1st, 2006

Internet Explorer 7 Logo

Microsoft has released Beta 2 of the next version of Internet Explorer. This release is really aimed at developers/designers who want to test their current websites and web applications with the new software. Microsoft has posted checklists that can be used when testing the browser:

The browser is available for download right now. There is a list of FAQ's for the new release on the IEBlog website that you may want to read. Oh yes … and you need to have SP2 installed on Windows XP if you want to use IE7.

Go and have a play if you dare…

Sage: The Firefox Atom & RSS Feed Reader

Saturday, January 28th, 2006

Sage Screenshot

If you are like me you are still figuring out the best way to manage your favorite RSS feeds. Today I discovered Sage, a Firefox extension that lets you read your RSS and Atom feeds inside your browser – which makes sense to me. It is very simple to use and is not cluttered with features I don't need. Here are some of the features I like about it:

  • Press "Alt-S" to toggle Sage on/off in the Sidebar.
  • Press the magnifying glass icon to auto-discover feeds on the current page.
  • Manage your list of feeds exactly like managing your bookmarks – you can sort them any way you like, rename them and place a seperator between them.
  • This is probably my favorite feature – Sage very quickly renders a column formatted list of the posts to read. See the image posted above for an example. The look and feel of this layout can be customised via CSS – in fact there are additional styles already created for you to download.

Catching up on the latest via RSS is now a logical extension of my browsing experience thanks to Sage

Should It Open a New Window?

Saturday, January 28th, 2006

One question I have been asking myself when writing this blog is – should external links in my blog open a new window by default, or should it stay in the current window? What is considered "best practice" nowadays? So I decided to do a bit of research. As usual when it comes to such topics the opinions are many and varied, and everyone thinks they are right. So I decided to share with the world my conclusions. :)

I have decided that it is best practice to not open new windows to external sites by default. Why?

  • New windows popping up can confuse inexperienced surfers who are used to the safety of the "Back" button. A new window does not retain the browser history of previous windows, thus rendering the Back button useless.
  • Experienced surfers know how to open new windows or tabs – let them choose. Tip: In Internet Explorer and Firefox hold down the "shift" key when clicking a link to open it in a new Window, or in Firefox use the "ctrl" key to open in a new Tab.

  • New windows opening up are a big problem for the visually impaired whose speech-to-text software may not have been warned of the window change, or they have missed hearing the warning that a new window was opened.

Of course, there are always exceptions to the rule. In some situations opening a new browser window is the logical thing to do – but not for every link by default.

If you do…

When/if you do want to open a new Window keep in mind that the target attribute of the <a> tag is deprecated, and will prevent your pages from validating in HTML 4.01 Strict, XHTML 1.0 Strict, or any future version. There are a number of alternative methods around – most of them using JavaScript. Here is the method I recommend:

<a href="http://google.com/" onclick="window.open(this.href); return false;">
  A Test Link
</a>

Here is a sample link using this code.

Why is this recommended method? It achieves our objective of opening a new window, but it also:

  • Preserves the href element for Search Engines
  • Users who want control can still right-click
  • The link can still be Bookmarked or added to the browser Favorites
  • Your code will validate

—————

So … future external links on this blog will not open a new window by default. And on the odd occasion it is a good idea, I will use the method outlined above.

If you have any thoughts on this topic I would love to hear them…