Archive for May 2008
PHP Compiler for the .NET Framework
Phalanger makes PHP first-class citizen in the .NET languages family. It gives PHP programmers the ability to benefit from both the ease-of-use and effectiveness of the PHP language and the power and richness of the .NET platform taking profit from the best from both sides.
I have to admit, I’m a big fan of .NET and Anders Hejlsberg, the lead architect of the team developing C#. That’s right, I said it! I’m a fan of .NET! Anders created an excellent programming language, which has a procedural, object-oriented syntax based on C++ and includes influences from aspects of several other programming languages, most notably Delphi and Java. C# and PHP have a lot in common, they are both simple, modern, object-oriented programming languages. In fact, a lot of C# programmers are familiar with PHP, and vice versa.
What is Phalanger?
Phalanger is a new PHP implementation introducing the PHP language into the family of compiled .NET languages. It provides PHP applications an execution environment that is fast and extremely compatible with the vast array of existing PHP code. Phalanger compiles PHP scripts into MSIL (Microsoft Intermediate Language) which can be executed by .NET or Mono runtime. This runtime executes MSIL code using JIT (Just-In-Time) compilation, which makes the execution far more effective than interpretation and significantly improves application speed.
Thanks to the Visual Studio 2008 Shell provided by Microsoft, you can now get Visual Studio with Phalanger for free.
Phalanger Features
- Compiles PHP language to the MSIL (Microsoft Intermediate Language), which is a byte-code assembly used by the .NET CLR
- Compiles PHP scripts directly to the .NET/Mono assemblies
- Phalanger makes it possible to use any .NET object in PHP applications
- Allows using .NET objects from the PHP language thanks to the PHP/CLR Language Extensions
- Enables using libraries written in PHP from other .NET languages
- Allows using .NET generics including writing and extending generic objects in the PHP language
- Allows writing objects fully compatible with .NET languages (like C#) in the pure mode
- Thanks to Phalanger you can use PHP for developing presentation layer on top of bussines logic written in C#
Tutorials
30 Useful PHP Classes and Components
Simplicity and extensibility are the main reasons why PHP became the favourite dynamic language of the Web. In the last decade, PHP has developed from a niche language for adding dynamic functionality to small websites to a powerful tool making strong inroads into large-scale Web systems.
Below I present 30 useful PHP classes and components that you can use to test, develop, debug and deploy your PHP applications. Let me know if I missed anything or if you have something to add.
Version Control for Multiple Agile Teams
This article describes an example of how to handle version control in an agile environment with multiple teams. It’s not primarily targeted for version control experts, in fact such experts probably won’t find anything new here. It’s aimed at the rest of us, those of us that just want to learn simple and useful ways to collaborate. It may be of interest to anyone directly involved in agile software development, regardless of role, branching and merging is everybody’s business, not just the configuration manager.
Version Control for Multiple Agile Teams, another great article written by Henrik Kniberg.
Cygwin, a Linux-like environment for Windows
If you are an experienced Linux user who misses a powerful command-line environment in Windows, you will enjoy Cygwin.
What is Cygwin?
Cygwin is a set of powerful tools to assist developers in migrating applications from Linux to the Windows platform. Cygwin delivers the open source standard Red Hat GNU gcc compiler and gdb debugger on Windows. In addition, it provides for a standard Linux development environment on Windows including APIs and command shells.
What can Cygwin do?
With Cygwin, Windows users can easily run shell command scripts, ls, cat, grep, sed, awk, etc. Standard Windows command line tools can even be intermixed within the Linux shell script environment to administer the Windows system. Over the years, Linux system administrators have developed a large toolbox set of management scripts for their Linux machines. Cygwin provides the ability to continue using these scripts on Windows machines.
Why use Cygwin?
One of the largest problems developers face today is supporting their applications on disparate platforms. Windows workstations continue to be added to an environment already populated by Linux and other UNIX-based Operating Systems. Using Cygwin, developers can manage heterogeneous environments in a consistent, efficient way.
Installing Cygwin
First go to Cygwin’s site and select Install or update now. This will download their online installer, setup.exe. The rest will be downloaded by the installer itself.
- Start the installer. Click Next.
- Choose Install from Internet. Next.
- Choose root directory, keep it as it is. Next.
- Choose local package directory, should be the desktop as default. Next.
- Choose connection. If you are behind a firewall, change the settings. Next.
- Choose location.
- Choose packages.
- The files are now downloaded from Internet and installed.
- When done click the finish button.
- To see that the installation works, click the shortcut that was made on the desktop.
- A console window is opened, showing some text.
- Close the console window.
Tutorials
An introduction to Cygwin
Cygwin, changing the face of Windows
Cygwin Website
Virtual Appliances: LAMP development made easy
The LAMP stack of open-source software, which includes the Linux operating system, Apache Web server, MySQL database, PHP and Python, has pushed its way into mainstream corporate software development. In this article I will show you why the LAMP platform has become the platform of choice for the development and deployment of high performance Web applications.
To get a LAMP development environment fired up without the hassles of configuring everything from scratch you only need one thing, a Virtual Appliance.
What is a Virtual Appliance?
A Virtual appliances is a pre-built, pre-configured, ready-to-run enterprise applications packaged with an operating system inside a virtual machine (I’m using Ubuntu 8.04). Virtual appliances are changing how Web applications are developed, distributed, deployed and managed, and they have many obvious benefits for developers.

Reasons for using a Virtual Appliance
- For developing and testing Web applications on multiple platforms.
- For quickly rolling back changes to a known state or creating a “read-only” environment.
- For internal deployment of custom Web applications.
- For customer demos during the sales process.
- For training employees and customers.
- For creating a flexible and open development environment whilst keeping the primary OS compliant with a locked down IT policy.
Now that you’ve learned about the benefits of using a virtual appliance, it’s time you try it out and experience it yourself.
Getting Started
1. Set up a development environment
1.1. If you don’t already have a VMware virtualization solution installed, download VMware Player for free.
1.2. Download a virtual appliance: Ubuntu 8.04 Desktop (568 MB) or Ubuntu 8.04 Server (256 MB).
1.3. Unzip the ZIP file and double-click the .vmx file.
2. Install Software
2.1. Install the LAMP stack. In Ubuntu 8.04 you can use Tasksel:
$ sudo tasksel install lamp-server
If you need help configuring Apache, visit this page.
2.2. Install the Zend Framework package. With the release of Hardy, the Ubuntu repositories now include a package for the Zend Framework, so you can have just one copy of the library on your server that is automatically updated.
$ sudo apt-get install zend-framework
This will install the Zend Framework in:
/usr/share/php/libzend-framework-php
3. Have fun
Enjoy your new Virtual Appliance, and welcome to the wonderful world of LAMP!
20 Most Influential Open-Source Web Applications
From managing databases to shopping, writing blogs to sending emails. Ten years of passion, great software architectures, team work and revolutionary ideas. Here are the most influential open-source PHP applications to date:
1998
phpMyAdmin is a tool written in PHP intended to handle the administration of MySQL over the Web. Currently it can create and drop databases, create/drop/alter tables, delete/edit/add fields, execute any SQL statement, manage keys on fields, manage privileges, export data into various formats and is available in 50 languages. Development is backed up by the phpMyAdmin team.
1999
SquirrelMail is a standards-based Webmail package. It includes built-in pure PHP support for the IMAP and SMTP protocols, and all pages are rendered in pure HTML 4.0 for maximum compatibility across browsers. It has very few requirements, and is very easy to configure and install. It has all the functionality you would want from an email client, including strong MIME support, address books, and folder manipulation.
2000
osCommerce is an open source e-commerce solution under on going development by the open source community. Its feature packed out-of-the- box installation allows store owners to setup, run, and maintain their online stores with minimum effort and with no costs involved. osCommerce combines open source solutions to provide a free and open development platform, which includes the powerful PHP web scripting language, the stable Apache web server, and the fast MySQL database server.
OpenX began as phpAdsNew, a fork from a similar project called phpAds, created by Tobias Ratschiller in 1998. OpenX is a hugely popular, free ad server designed by web publishers for web publishers. It provides everything you need to manage your on-line advertising. It allows paid banners to be easily rotated along with your own in-house advertisements, and can even integrate banners from third party advertising companies.
phpBB is a fast, efficient discussion board program built in PHP with a muti-database backend. Features include: posting, replying, private messages, polls, username/ip banning, strong encryption for storing passwords, user rankings, very advanced access control for private forums, full templating, simple yet robust translation system and much more.
2001
Gallery is a slick Web-based photo album written using PHP. It is easy to install, includes a config wizard, and provides users with the ability to create and maintain their own albums in the album collection via an intuitive Web interface. Photo management includes automatic thumbnail creation, image resizing, rotation, ordering, captioning and more. Albums can have read, write, and caption permissions per individual authenticated user for an additional level of privacy.
Drupal is a modular content management system, forum, blogging and community engine. It is database driven and can be used with MySQL, MySQLi and PostgreSQL. Its features include (but are not limited to) discussion forums, Web-based administration, theme support, a submission queue, content rating, content versioning, taxonomy support, user management with a fine-grained permission system based on user roles (groups), error logging, support for content syndication, locale support, and much more. It is considered to be an excellent platform for developers due to its clean code and extensibility, and it can also be used as a Web application framework.
2002
MediaWiki is a web-based wiki software application used by all projects of the Wikimedia Foundation, all wikis hosted by Wikia, and many other wikis, including some of the largest and most popular ones. Originally developed to serve the needs of the free content Wikipedia encyclopedia, today it has also been deployed by companies for internal knowledge management, and as a content management system. Notably, Novell uses it to operate several of its high traffic websites.
2003
WordPress is a state-of-the-art, semantic, personal publishing platform with a focus on aesthetics, Web standards, and usability. It was born out of a desire for an elegant, well-architected personal publishing system. While primarily geared towards functioning as a Weblog, WordPress is also a flexible CMS capable of managing many types of Web sites. In addition to the basic blog functions, it also has an integrated link manager (e.g. for blogrolls), file attachments, XFN support, support for stand-alone pages, Atom and RSS feeds for both content and comments, blogging API support (Atom Publishing Protocol, Blogger, MetaWeblog, and Movable Type APIs), spam blocking features, advanced cruft-free URL generation, a flexible theme system, and an advanced plugin API.
2004
SugarCRM is a complete CRM system for businesses of all sizes. Core CRM functionality includes sales force automation, marketing campaigns, support cases, project mgmt, calendaring and more. Built in PHP, supports MySQL and SQL Server.
2005
Joomla! is an award-winning Web-based content management system. It provides for split front end content access and backend administrator access. Group-based access control allows for different levels of system control for both the site and the administrator. The Joomla! framework allows for extension by installable components (applications), modules (template blocks), languages, templates, and mambots (plugins that enhance system functions).
Pligg is an Open source Social Networking Content Management System (CMS) Combining social bookmarking, blogging, and syndication and a democratic editorial system enables users to collaboratively submit and vote articles. It was influenced by the extremely popular and proprietary software Digg, where when a user submits a news article it is placed in the “upcoming” area until it gains sufficient votes to be promoted to the main page.
2007
Magento is a new professional open-source eCommerce solution offering unprecedented flexibility and control. It was designed with the notion that each eCommerce implementation has to be unique since no two businesses are alike. Magento’s modular architecture puts the control back in the hands of the online merchant and places no constraints on business processes and flow.
eyeOS is an open source web desktop following the cloud computing concept that leverages collaboration and communication among users. It is mainly written in PHP, XML, and JavaScript. It acts as a platform for web applications written using the eyeOS Toolkit. It includes a Desktop environment with 67 applications and system utilities. It is accessible by portable devices via its mobile front-end.
2008
Elgg is a open source social networking platform. It offers blogging, networking, community, collecting of news using feeds aggregation and file sharing features. Everything can be shared among users with access controls and everything can be cataloged by tags as well.
PHPmotion is a free video sharing software that also has support for other types of media such as audio/mp3 sharing. The Content Managent System or (media cms application) will allow you to create and run your very own Video Sharing website, Music Sharing Site, Picture Sharing Site. With very little knowledge required you can now have a website just like YouTube, DailyMotion, Veoh, hi5 and other proprietary applications. Best of all, its 100% free to download and use.
2009
Piwik aims to be an open source alternative to Google Analytics. Piwik is a software that you download and install on your own webserver. At the end of the five minute installation process you will be given a JavaScript tag. Simply copy and paste this tag on websites you wish to track, or use an existing plugin to do it automatically for you.
Open Atrium is a platform for building team portals that can be extended to meet highly custom knowledge management needs for large organizations’ intranets and extranets. It starts with “out of the box” features like a blog, a wiki, a calendar, a case tracker, a shoutbox, and a dashboard to manage content. These features can be expanded to meet unique needs for large organizations so that full scale enterprise collaboration sites can be built with Open Atrium as a base. By fully leveraging Drupal, all of the strengths of Drupal can contribute to creating custom features for Open Atrium within a framework that is already tailored for team collaboration.
Service-oriented Architecture
My girlfriend finally understood what Service-oriented Architecture is:
Managing and applying database changes with LiquiBase
LiquiBase is an open source, DBMS-independent library for tracking, managing and applying database changes. It is built on a simple premise: All database changes (structure and data) are stored in an XML-based descriptive manner and checked into source control.
Adding a changeset
<?xml version="1.0" encoding="UTF-8"?> <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.6" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.6 http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.6.xsd"> <changeSet id="1" author="bob"> <createTable tableName="department"> <column name="id" type="int"> <constraints primaryKey="true" nullable="false"/> </column> <column name="name" type="varchar(50)"> <constraints nullable="false"/> </column> <column name="active" type="boolean" defaultValue="1"/> </createTable> </changeSet> </databaseChangeLog>
Running the ChangeSet
There are many ways to execute your change log including via command line, Ant, Maven, Grails, etc.
liquibase --driver=com.mysql.jdbc.Driver \ --classpath=/path/to/classes \ --changeLogFile=com/example/db.changelog.xml \ --url="jdbc:mysql://localhost/example" \ --username=user \ --password=asdf \ migrate
Done!
You will see that your database now contains a table called “department”. Two other tables are created as well: “databasechangelog” and “databasechangeloglock”. The databasechangelog table contains a list of all the statements that have been run against the database. The databasechangeloglock table is used to make sure two machines don’t attempt to modify the database at the same time.
Related Articles
13 reasons why UML failed
One of the reasons is that UML attempts to become a programming language.
By aiming to be able to generate full code actually UML tries to be a programming language. In my mind there is a big problem with a general purpose graphical programming language. In human history the written form of all languages evolved from graphical to textual (see also Visual Designs Don’t Scale). Alphabets proved to be more versatile and more expressive than pictures in capturing ideas. Try to describe any simple process in images. The funny thing is you still have to annotate the images with words. And the full text version with no pictures still gives you more details. Pictures prove to be good at sharing ideas and allowing people to visualize concepts. But in the end words are better at describing the fine details.
The best Software Developers are in China
If, statistically, we’re all average programmers, how can an enterprise IT department find the best? That’s right, holding a contest.
That’s the premise behind TopCoder, an online community of 100,000 developers from all over the world. Client projects are broken into well defined, manageable components. A cash prize is offered for each component’s successful completion and the winning component is, indeed, the very best you can get for the money.
According to TopCoder’s ranking, the top 10 software developers are from China.
Please, support earthquake relief in China
Your donations will help survivors and other disaster victims rebuild their communities and their lives. Find out what you can do to help