/    Sign up×
Community /Pin to ProfileBookmark

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 [URL=”http://funkatron.com/posts/the-microphp-manifesto.html”]here[/URL]) 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: [URL=”https://sourceforge.net/projects/www-php/”]WWW Framework[/URL].

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.

WWW comes by default with a view controller and a gateway intended for website functionality with clean URLs and it also incorporates a front-end JavaScript controller.

[URL=”https://sourceforge.net/p/www-php/wiki/Home/”]Documentation about use[/URL]
[URL=”https://sourceforge.net/p/www-php/wiki/How%20to%20set%20up%20a%20simple%20web%20service%20with%20WWW%20Framework/”]A simple tutorial[/URL]

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 ?

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@kristovaherauthorFeb 12.2012 — 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 [url=https://sourceforge.net/projects/www-php/]here[/url].
Copy linkTweet thisAlerts:
@kristovaherauthorMar 16.2012 — 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.

[B]For example, if you have this image on the server:[/B]

http://waher.net/w/resources/chesspawns.jpg

[B]You can adjust this image based on filters set to it through its filename:[/B]

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

[B]It's also possible to use image filters for color adjustments:[/B]

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.

[B]List of all newly added features is here:[/B]

[LIST]
  • [*]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

  • [*]It is now possible to dynamically unify CSS and Javascript files

  • [*]Simple minification can be used for CSS, Javascript, HTML and XML files

  • [*]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

  • [/LIST]
    ×

    Success!

    Help @kristovaher spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.18,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...