12 Sep 09

First of all let me clarify, that if you are looking for a Symfony, CodeIgniter, CakePHP.. etc article, this is not what you are looking for. In this article you will find small and extra lightweight PHP frameworks that in some cases, can make your life easier. Really.

Why use a framework?

Because re-inventing the wheel again and again is something a productive (note the word used: productive* ) developer, should not do. By using a framework that supports the MVC patern (Model,View,Controler), you can keep your code readable and understandable, you seperate application logic from presentation and many more things that would require more than an article to cover.

Kohana

kohanaWe start our listing with the Kohana framework. The Kohana team describes the framework as a PHP5 framework with support to the MVC architectural pattern that aims to be secure, lightweight and easy to use. The full package sized only 1.5MB (629KB compressed) has everything you need to create great and fully functional php applications. Some of the modules included are:

  • Archive – Compressed archive creation, supports zip, tar, gzip, and bzip.
  • Auth – Simple authentication and user management. Uses ORM for models.
  • Gmaps – Google Maps integration, geolocation, and API support.
  • Kodoc – Dynamic self-generated documentation. (Beta!)
  • Payment – Provides merchant and payment gateway wrappers. Supports Authorize.net, PayPal, Trident, Trust Commerce, and YourPay.

Great documentation (Wiki based, this means that everyone can contribute. Something like the PHP Manual, where user comments are the real documentation) , excellent and small tutorials like : Creating a blog with Kohana Part 1 and Part 2, make learning the kohana framework a lot easier.

Rapyd

rapydRapyd is another small php framework that can also be used as a library. 250KB of compressed files with an uncomressed size of 484KB. It is definetely impressive what you can do with it. Some of it’s features:

  • No compiling, no command line needed, just unzip, it will work.
  • PHP5 Strict
  • Modules support
  • Nice URLs (SEO oriented)
  • Tiny MVC in few files

epicode

epicode is an extremely lightweight PHP framework. It includes caching, session, database, form validation, twitter, oauth and asynchronous/non-blocking curl components. EpiCode started off as an MVC framework but has evolved into a set of extremely useful tools. Every tool is completely decoupled so they can be used independently or in conjunction. Each library in EpiCode is thought out and implemented in an extremely cohesive manner. The documentation can be found here.

Extra Light Framework

ELF PHP is a php framework with a very small footprint, built on Model-View-Controller architecture. Believe it or not, PHP ELF is sized only 39KB compressed and when extracted it’s size is only 72KB. Although it’s small size it features:

  • Caching system
  • URL Routing system
  • Logging system
  • Requests handler
  • Image manipulation class
  • Database abstractization
  • Minimal server load

and the plans for the Beta 3 include adding:

  • Validation class
  • Session class
  • Pagination class
  • File upload
  • Common scripts
  • Improved caching engine
  • Improved models

BaseApp

BaseApp Framework is aimed at individual commercial developers or small web application builders who need a starting point.Also if you are a CakePHP User you will find yourself at home with the API. BaseApp was inspired by CakePHP And Codeigniter but tries to do everything under 50 kb.
It has support for most common features available in frameworks these days but achieves all this in under 50 Kb of compressed Code and not MBs of it. Some technical data:

  • PHP 5 with support for new features like autoloading etc.
  • Fully MVC ( But can be used as a library also ).
  • CakePHP API ( 80 % ) and Layout.
  • Active Records and Object Relation Ship Mapping (ORM).
  • Model Validation with complementing form helpers.
  • Data Abstraction Layer with Adodb Support ( Almost all databases supported ).
  • Extensive Debugging and Exception Handling facilities ( FireBug Support Built in ).
  • Extendable Cookie and Session Handling.
  • Search engine friendly and url routing features.
  • Ajax Support through Jquery.

The project is hosted on Google code.

 

Author Note:

On the Why use a framework chapter i used the word productive especially for one reason.  I wanted to note that re-inventing the wheel is bad only for productive purposes. If some people didn’t try to do things their way, we would miss some of the greatest achievements in mankind. My opinion though.

Popularity: 11%

  • Share/Bookmark

Related posts:

  1. YUI-FX Beta. Effects Library With Unobtrusive Javascript During my “to know us better” with the YUI library,...
  2. Integrated Development Environments For Qt And Not Only This is a list of some Qt and not only,...
  3. 20+ Open Source RAD Tools This is a list of Rapid Application Development tools that...
  4. The Javascript Libraries That Shape The New Web Web is like sea. It is always in the move...
  5. 10 Things to Consider Before Creating a Content Management System Having created more than 5 different content management systems, I...

About the Author:

Filed under: Tools - Trackback Uri


29 Comments.

  • php_coder says:

    Kohana is a fork of CodeIgniter. The code base is actually (slightly) larger and it benchmarks slower. Please do some research before posting. CI is a great, lean framework.

  • Brandon says:

    Funny you should mention this. I recently completed a lightweight MVC framework myself. It’s extremely bare bones (20KB) and allows you to create your own parsing rules. As it was a recent release and you seem to know a lot about what makes a good lightweight MVC framework, I’d love to get some feedback from you. Here is the link:

    http://www.suitframework.com/

  • Faltzer says:

    My issue with developers reinventing the wheel is that most of the time they don’t have anything productive to show. At times, it DOES open up many great ideas that were never thought of, but reinventing the wheel would mostly be beneficiary to the programmer if he wants to know how the wheel works.

    Beyond that, why? There are many solutions available that are accepted amongst communities. They have what these reinventions usually don’t, and probably won’t have for a very long time: support, stability, robustness, and all of the attributes that make a good piece of software.

    Instead of making entirely new solutions, developers should be improving already existing software. The developer benefits, the original vendor benefits, and so does the community. It’s a contribution that actually means something and won’t go unnoticed.

  • vinegar says:

    i find a simple router and flourish (www.flourishlib.com) provides as much power and more flexibility without, as you say, reinventing the wheel.

  • admin says:

    Noone said CI is not great. Not my choise (I use Symfony) but a as you said “a great and lean framework”. We post things here to make them known to the public. That was the case for the Content Management Systems post, the Notepad++ plugins post etc etc. And after all, this is why comments exist :) We like being guided by your feedback. Thanks for pointing this out.

  • Helen Hunt says:

    Thanks for this comparison, I didn’t know most of the frameworks you listed here; but I shall find time to explore them much further.

  • forsooth says:

    Is there an MVC PHP framework that contains no OO components? IOW, all procedural? Just wondering…

  • Ed Finkler says:

    I’m surprised you didn’t mention Limonade

    http://limonade.sofa-design.net/

  • Brian says:

    Try out Madeam. Weighs in at 112KB. Fully featured PHP MVC framework.

    http://www.madeam.com

    It was mentioned in PHP Architect Magazine: http://www.phparch.com/main/news/view/18/Announcing_the_June_2009_issue_of_php_architect

  • I have created MVC framework with 100% AJAX implementation, Its most developer friend, just attach your php class, give the input params, Its will work you want. High level of Security mechanism implemented.
    I will be launching it in the mid of next month.
    I have used Smarty as templete engine, SecurImage for Captcha, with YUI library included. It will be less than 500kb of code. Its Highly customizable with developer friendly. Juist tune it little start using it.
    I will update here after the launch.

  • The Peach says:

    Kohana is going toward version3 where it will be mostly rewritten and its structure rearranged, probably to a more complete, robust and speedy code.
    Since this new version will not be backward compatible, I’m really going to try Yii and I think it deserves a gaze.

    Regards.

  • felix says:

    Hi all, I’m rapyd developer

    - thnks to the @admin for link
    - hi @ED (thnks again for the old podcast on zend)
    - @forsooth caffeinephp (Gavin vickery) of is a good tiny mvc.. php4 compatible, support both oop and prodecural. (no db wrappers, just a router and view funcion in one file) really clever

  • Faltzer says:

    @Anup Bhatkhande: In my experience, most of the sites that “require” Javascript are just being lazy. There’s no reason you should NEED my browser to support JS solely to do some cute animation or load CSS or display static content. Most of the problems could be solved by putting something useful in the original page source and then changing it with JS when necessary, rather than filling in empty space with JS. We managed static sites just fine ten years ago without any Javascript at all; I don’t see why we need it now.

    Granted, if you have some cool doodad that simply cannot work without client-side scripting, then by all means use Javascript all you want. But keep in mind that not everyone has it for one reason or another, and even Google Maps works without it.

  • admin says:

    I think you are refering to the javascripts article.

  • Faltzer says:

    Not quite. I referenced to Anup’s original post in disapproval.

  • Robert says:

    One reason to reinvent the wheel is to learn how the wheel works. I’ve been working on my own framework because I find it is bar none, the best way to expand my programming skills, because most projects don’t really require you to flex the mental muscles too much.

  • admin says:

    I do the same thing. I create things on my own just to improve. Thumbs up!

  • colfi says:

    Hey try DooPHP too, it’s small in size but feature rich and good in performance. A lightweight framework that is easy to use :) http://doophp.com

  • Nette Framework (http://nettephp.com/, http://github.com/dg/nette) from Czech author David Grudl (http://texy.info/) has size of 708 kB (324 kB with minified one-file version) and has everything what web developer needs:

    - MVC support
    - Routing (for nice and SEO-friendly URLs)
    - Django-style template system (extends and block support)
    - Working with forms (validation, file upload, working with submitted forms)
    - Sending e-mails
    - Users authentication/authorization (full ACL support)
    - Caching
    - Sessions, String and other wrapper classes

    Nette includes lots of great and creative ideas and shows a lot of experience behind it. It has currently 4 commiting people.

  • Adam says:

    Nobody have mentioned Recess Framework (http://www.recessframework.org/)? What a shame. Take a look at one-minute tutorials, they’re really awesome.

  • EllisGL says:

    I started one called Wet Cardboard Box. You can get the code here: http://code.google.com/p/wetcardboardbox/
    I didn’t get far and haven’t updated in over a year. Discovered Kohana PHP and other things..

  • dimis283 says:

    I begin with frameworks with CI.It helped me to learn MVC and how to use an mvc framework
    Now I am using Yii and I like it.
    So many php frameworks big or small, how can we choose one?
    Anyway having no problem with Yii till now the next step is to learn zend or symfony and use them at larger projects…

Trackbacks/Pingbacks

  1. popurls.com // popular today…

    story has entered the popular today section on popurls.com…

  2. [...] Go here to read the rest: Damn Small PHP Frameworks. Because size does matter. [...]

  3. [...] Damn Small PHP Frameworks. Because size does matter. (tags: php web programming) Categories: Links Comments (0) Trackbacks (0) Leave a comment Trackback [...]

  4. [...] See the article here: Damn Small PHP Frameworks. Because size does matter. | Jeez Tech [...]

  5. [...] Damn Small PHP Frameworks. Because size does matter. | Jeez Tech  [...]

  6. [...] this recent post to the Jeez Tech blog they take a look at some of the small, lightweight frameworks out [...]

  7. [...] this recent post to the Jeez Tech blog they take a look at some of the small, lightweight frameworks out [...]