Introducing an API-focused WWW PHP micro-framework
I've never felt comfortable working with various huge frameworks out there. I gave Zend a shot for about six months and since then have been mostly using Kohana. But personally I still find myself preferring the approach of 'micro-frameworks' (article here) that do a specific task and for everything else leave the things in developer hands. This means no bloated libraries and no heavy footprint.
As such I've been developing, writing and rewriting and refactoring a small framework that I've mystically named 'WWW Framework' for the better part of last six months.
It is open source (LGPL) and available at SourceForge: WWW Framework.
WWW is a PHP micro-framework that is built loosely on model-view-control architecture and factory method design pattern. It is made for web services, websites and info-systems and is built around a native API architecture, caching and smart resource management. WWW is a compact framework that does not include libraries and bloated features and is developed keeping lightweight speed and optimizations in mind.
Documentation about use
A simple tutorial
Mercurial repository is available for developers who are interested in following the development.
It's still quite new and I intend to frequently post more tutorials and updates for the framework. I am sharing it here since some of you just might be interested if you are a likeminded developer and find this exactly to be what you've been looking for
Those of you who downloaded 1.0.3 version of the framework, it had a bug in the code (and totally my fault!). You should grab 1.0.4 which is the latest now here.
Just wanted to let you know that the system has been improved quite a bit since the original release.
I am still working on a tutorial about how to build a simple website though. There is a tutorial about how to build a simple web service and other detailed documentation, but I hope to finish the website tutorial soon!
There's not a lot to show 'visually', but I did add some interesting features such as dynamically loading images.
Basically any file in environment controlled by WWW Framework is loaded through an image handler which accepts various 'parameters'. So instead of PHP script type of solutions, the result is far more elegant.
For example, if you have this image on the server:
You can adjust this image based on filters set to it through its filename:
Cropped into new resolution
Cropped and fitted into new resolution
Fitted with background
Fitted with background and background color
The same as above, but with 30% quality
Same as above but with worst quality
It's also possible to use image filters for color adjustments:
This uses sepia-toned filtering
This uses grayscaled image with horrible quality
And of course you can change these parameters around as you see fit.
There is only one real file stored in filesystem (/resources/chesspawns.jpg), but every request is cached separately. This can be used to dynamically load avatar pictures and other type of pictures without having to worry about design changes later on and if these design changes 'break' things. Nothing has to be 'regenerated' for that purpose. Server only stores what is needed and is as optimized about it as possible.
List of all newly added features is here:
- New returned data types with additional processing, like ‘ini’ and ‘rss’ files
- New configuration option for resource cache durations, dynamic resource loadings and limiters
- Can now use deflate as an output compression type, together with Gzip
- New Cleaner developer script for cleaning WWW created caches and temporary system files
- Better support for clients that send no request headers
- System now maintains image files as well and this includes support to dynamically resize and crop images per request
- JS and CSS file compressions are now cached, increasing performance
- It is also now possible to use image overrides from resources subfolder
- Limiter now affects all requests, including static file requests
- Logger now is categorized and is also used for tracking static file requests
- New compatibility script for testing server and PHP setup
- Restructured Index gateway and added request-type handlers for each resource type
- Minifier class added and functionality implemented in both Resouce handler as well as for API requests
- File paths and resource loading much improved
- Limiter and Logger have now a more streamlined internal process
- Index gateway now also supports IP based blacklists
- Much better URL Map functionality which allows to set whether unsolved URL’s are allowed or not
- Default View controller now uses unified resources
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread