DooPHP is a high performance open source PHP framework. It is also a rapid development framework for PHP application development. It uses common design patterns like MVC and ORM. The framework helps to write less code for performing tasks and also reduce development costs.
This article will explore DooPHP features, installation and implementation.
Introduction
DooPHP is one of the fastest available PHP frameworks. It helps developers to develop robust web applications based on web 2.0. It is very light weight and it has a small source code footprint. DooPHP is easy to learn. This framework is highly capable to deliver faster page loads beyond any comparison. While this framework is fast, it is also quite feature rich. DooPHP supports the common features which are essential on a web platform. As a developer, in order to learn DooPHP, one should only know PHP and Object Oriented Programming. DooPHP framework focuses on the following core areas:
• MVC
• REST
• URI Routing
• ORM
• Flexible Template Engine
• Easy to use
• High Performance
• Logging and profiling tools
• Authentication
Features of DooPHP
DooPHP includes features that are used in Web 2.0 development. It follows a very loosely coupled design which helps the developers to add new functionalities to the framework very easily.
• MVC Architecture – MVC stands for Model View Controller. The Doo framework adopts the proven technique of splitting the application into separate layers –
° The presentation layer – View
° The business logic layer – Controller
° The data access layer – Model Using these three components we can easily achieve robustness and code reusability.
• URI Routing – Doo provides sophisticated processes for URL mapping to controllers, actions and also to generate URLs. It can also be used for external code that doesn’t follow the MVC pattern. With the URI routing feature, we get clean and simple URL for our website.
For example a complicated URL such as “http://mydomain.net/mainPage.php?sectionPage=news&year=2014&month=07&day=25” can be simplified to “http://mydomain.net/news/2014/07/25 “with the help of URI routing feature
• Authorization – DooPHP has built in Authorization and Authentication support. It uses Access Control List (ACL) which is easy to use. ACL defines the rules in a single flat file that is easy to use and maintain.
• Database Replications – DooPHP is based on the master slave database setup. DooPHP can easily be integrated with a MYSQL database that supports the master slave feature.
• Data Cache – DooPHP has its own data caching mechanism and supports:
° Disk Cache
° APC or Alternative PHP Cache
° Mem Cache
° XCache
° EAccelerator
The best part of this caching mechanism is that the storage media for caching can be changed easily without making any change in the code.
• Frontend Cache – DooPHP has a very sophisticated frontend cache mechanism that supports both partial page cache and full page cache. In the frontend cache we can customise which page is to be cached and which is not. This provides a great help for speeding up any website.
• Code Generation – DooPHP provides tools that can easily and automatically generate required code such as routing, Controller and model files. These tools are GUI based, thus very easy to use, even for beginners.
• Internationalization – In DooPHP we can easily extend the controller to add new features such as multi lingual support to our application.
• High Performance – DooPHP is the fastest pattern which follows MVC. It uses the lazy loading approach and also avoids using functions or methods that are relatively slow. It has a small memory footprint that is used to store the frontend cache.
• Centralized Configuration – In DooPHP configurations are defined as an associative array that is easily readable and familiar to all PHP developers. Over all there are only three configuration files in DooPHP:
° Common Project settings
° Routing related settings and configurations
° Database related settings and configurations
• RESTful API – Most common websites that are based on Web 2.0 have REST enabled web services. If you are building your own RESTFull API that makes requests to third-party web service–for example social media websites such as facebook or twitter–we can easily integrate these using DooPHP as it has a native support for REST.
• Database ORM Tool – DooPHP has a database abstraction layer and built in ORM tool. We don’t need any manual SQL. It has the ability to escape malicious input characters. Using Doo, working with CRUD and relational databases has become much easier.
• Flexible templates – Doo has the ability to provide a flexible template mechanism, thus allowing the end user to customise the website as per their choice. While achieving this target, you wouldn’t want to have any malicious function call in the template that might crash the entire application. In short, the template should remain as much in HTML as it can be. DooPHP allows us to have control of the content and decide what should be allowed in the template and what is not.
• HTTP Authentication – DooPHP has out-of-the-box support for HTTP Digest auth. We can have simple authentication for a file, page, controller or action classes by defining the routes or by a simple method call.
• Works anywhere – DooPHP doesn’t require any other tools or utilities apart from the standard PHP library. It can run on any PHP mode: mod_php, CGI or FastCGI. Applications can be deployed on the domain root directory or on any sub folder or sub domain.
• E_Strict – DooPHP is E_Strict complaint and it doesn’t throw any unwanted notices, errors or warnings to the end users.
• AJAX Support – DooPHP has good support for the AJAX library. It also works fine with JavaScript, JQuery, etc.
Installation and Setup
DooPHP requires PHP version 5.1.x or higher. If you are a beginner, it is recommended to use the WAMP server that has Apache, MySQL and PHP combined.
Running DooPHP on Google App Engine
The Google App Engine is based on the PAAS concept. This engine comes up with the following advantages:
• Faster development
• Faster deployment
• Simple administration
• No need to take the hassle of patches and backups
• Easily scalable
The current version of Google App engine has support for only Python and Java. There is no direct support for PHP. However with the help of Quercus (open source Java Implementation of PHP) we can easily run DooPHP on Google App Engine.
Summary
In the discussion above, we covered the main features of DooPHP, its importance, installation, etc. It is one of the most popular rapid development frameworks for PHP developers with support for related components like ORM, authentication, caching, internationalization, and more.
About the Author
Kaushik Pal is a technical architect with 15 years of experience in enterprise application and product development. He has expertise in web technologies, architecture/design, java/j2ee, Open source and big data technologies. You can find more of his work at www.techalpine.com and you can email him here.