SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Zealot
    Join Date
    Apr 2009
    Location
    Wenatchee, WA
    Posts
    101
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    micro frameworks

    I'm probably getting the cart way out ahead of the horse here, given my current level of php-fu but I am curious... over in Python-land I regularly see mention of various 'micro' frameworks such as flask, bottle, web.py, etc. on up to nearly anything 'lighter' than Django. Here, in the PHP forum... I don't see much mention of 'micro' frameworks, at least not judging by the names that get returned when I Google for 'PHP micro frameworks'... Any thoughts on what would constitute a 'micro' framework in PHP, and when they might be appropriate - or not?

    TIA,

    Monte

  2. #2
    I solve practical problems. bronze trophy
    Michael Morris's Avatar
    Join Date
    Jan 2008
    Location
    Knoxville TN
    Posts
    2,053
    Mentioned
    66 Post(s)
    Tagged
    0 Thread(s)
    I'm working on what might be considered a 'micro' framework, but it's overdue, 6 months behind schedule, and probably going to get it's teeth knocked out for PHP 5.4 inclusion. It's also focused not so much on being 'small' as being a 'teaching' framework - though those two goals are congruent.

  3. #3
    SitePoint Wizard bronze trophy Jeff Mott's Avatar
    Join Date
    Jul 2009
    Posts
    1,314
    Mentioned
    19 Post(s)
    Tagged
    1 Thread(s)
    I think you're right that micro frameworks haven't permeated into the PHP community very much. I don't personally see their point, for a couple reasons:

    First, the major PHP frameworks are autoloaded. So no matter how many classes or files are included in a framework, only the parts you actually use are loaded.

    And second, if you're building a large-scale app, then you'll want all the features and structure that a framework provides. And if you're building a small-scale app, then a few extra milliseconds won't matter anyway.

  4. #4
    SitePoint Enthusiast
    Join Date
    Aug 2011
    Posts
    67
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I am writing a micro-framework to implement frontcontroller, command pattern, mvc etc. I am a bit stuck on using activerecord pattern or not. I got some bad performance on my latest implementation of activerecord.

    No idea why there are no popular micro-frameworks for php. It might be because a lot of php developers choke when you mention mvc, command pattern, oberserver pattern etc in one sentence. Or they respond: I use Zend Framework.

    I hope my framework will become popular once it's finished

  5. #5
    Team SitePoint fredwu's Avatar
    Join Date
    Jan 2005
    Location
    Melbourne, Australia
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There are a number of 'micro-frameworks' inspired by Sinatra. Like Slim and Flight.

    Micro-frameworks tend to be best at solving application routing. They are useful for creating RESTful API services for example.
    Development Manager @ SitePoint

    Blog | Code | @fredwu | LinkedIn

  6. #6
    SitePoint Guru
    Join Date
    Nov 2003
    Location
    Huntsville AL
    Posts
    701
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)
    Silex is the new kid on the block. http://silex.sensiolabs.org/
    PHP Code:
    require_once __DIR__.'/silex.phar'

    $app = new Silex\Application(); 

    $app->get('/hello/{name}', function($name) use($app) { 
        return 
    'Hello '.$app->escape($name); 
    }); 

    $app->run(); 
    Silex has the distinction of sharing some of the same components as the full featured Symfony2 framework thus offering a reasonable upgrade path.

  7. #7
    SitePoint Zealot
    Join Date
    Apr 2009
    Location
    Wenatchee, WA
    Posts
    101
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by fredwu View Post
    Micro-frameworks tend to be best at solving application routing. They are useful for creating RESTful API services for example.
    Okay... for the un-enlightened (me) could you give some examples of the above? I've seen the buzz words tossed around in forums but I'm not really sure what they mean...

    TIA,

    Monte


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •