12

Here are the requirements:

  • Must be compatible with PHP 5.2.14
  • Lose coupeling for maximum performance

    For comparison: Code Igniter needs 1500 ms for the "hello world" application on the target system. (measured in the browser over 100 mbit LAN)

  • Useful for implementing a RESTful API

  • Features:

    • Object oriented approach
    • MVC would be nice but I'm open minded
    • URL routing
    • Classes for common things like validation, authentication, response crafting
  • 3
    What features should it have? – Nick Wilde Mar 5 '14 at 0:16
  • 4
    Have you considered PHP? I saw this talk youtube.com/watch?v=ryld1J1ngCE . Basically PHP is a webframework. – Lyndon White Mar 5 '14 at 3:35
  • Yes I have considered pure PHP but I don't want to reinvent the weel since there are many common things to do like url routing, validation, authentication etc. I could use some classes I can find on the internet but I would like to have the advantages of a framework. I will add the required features to my post. – Noir Mar 5 '14 at 8:20
  • 2
    Do you really mean PHP 5.2? It has been EOL for over 3 years. – arjan Mar 17 '14 at 10:49
  • It's a project for a small ARM based system and there are neither people nor time to port another version of PHP... – Noir Mar 17 '14 at 12:53
1

Laravel offers a service to automaticaly publish some RestFul contollers. Then you just need to assign a route to this ressource and your Rest component is working.

About your other features Laravel:

  • Is object oriented.
  • Offers a validation tool with most commons validation rules already implemented. Of course you can add your own rules.
  • Provides routing functionnalities with filters for security needs (authentication, CRSF, ...).
  • Offers the possibility to work with MVC philosophy, or not, or partially.
  • Is 5.4 PHP based.

I never measure an HelloWorld response so I don't know if this framework is as lightweight as you expect.

Other features:

  • Excelent documentation and support
  • Active project, regulary upgraded
  • Open sources and gratis
  • Laravel's installation and dependenties through Composer
  • The problem is that I'm tied to PHP 5.2.14. I'm about to write an own micro framework for my needs. Anyway, thanks for your answer – Noir Mar 17 '14 at 12:45
  • Laravel requires PHP 5.4+ – niutech Dec 30 '14 at 2:36
  • Laravel is heavy; as much as I like it I'm voting this answer down as Laravel is as much (if not more) resource-hungry than CodeIgniter. – user111 Feb 2 '15 at 7:42
1

Check out Phalcon, it's a framework delivered as a C extension so it's really fast (basically no overhead over pure frameworkless app on any decent machine).

It's loosely coupled as each module is separate and doesn't rely on others, so while in the quick start guide they configure the dependency injector with "factory defaults" which preloads most likely to be used features, you can also start with a blank canvas and only load what you want; check out their documentation for more info.

I'm not sure they have builds for that particular version of PHP, and even less for ARM platforms, but the code is open source so you can always compile it yourself.

0

Choose Slim Framework. It is fast and lightweight, even though it provides: HTTP routing with parameters, redirects, middleware; templating with support for Twig, Mustache, Smarty; flash messaging; encrypted cookies; HTTP caching; logging; error handling and debugging. Version 1.* runs on PHP 5.2+. Version 2.* requires PHP 5.3+.

This is the hello world:

<?php
require 'Slim/Slim.php';
$app = new Slim();
$app->get('/hello/:name', 'hello');
function hello($name) {
    echo "Hello, $name!";
}
$app->run();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.