[{"data":1,"prerenderedAt":416},["ShallowReactive",2],{"project-3728360":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":27,"sentiment":28,"stance_mix":29,"scored_comments":33,"aspects":34,"strip":43,"post_text":45,"what":46,"said":90,"maker_in_thread":190,"shape":202,"grid":206,"attempts":378,"same_week":379,"maker_shows":44,"maker_hidden":408,"reader_version":409,"card":410},"3728360","Ham","A fast PHP router\u002Fmicroframework I hacked up last night","title","Show HN: Ham, a fast PHP router\u002Fmicroframework I hacked up last night","https:\u002F\u002Fgithub.com\u002Fradiosilence\u002FHam","github.com","antihero",1332234010,2012,87,63,260,1677,16,"notable","dev_tools","php microframework","library",[24,21,25,26],"php router","php routing","front controller","curious",-0.105,{"positive":30,"neutral":31,"mixed":30,"critical":32},2,11,5,20,{"execution":35,"design":38,"idea":39,"docs":41,"performance":42},{"positive":36,"critical":37},0,4,{"positive":36,"critical":36},{"positive":30,"critical":40},1,{"positive":36,"critical":36},{"positive":36,"critical":36},[36,36,36,40,36,44,40,36,44,36,36,36,36,32,36,36,44,44,44,44,32,44,44,36,36,44,40,40,36,44,36,36,36,36,44,36,40,44,44,36],3,null,{"problem":47,"audience":56,"pricing":45,"motivation":64,"time_to_build":74,"stack":78,"openness":87,"stage":88,"team_size":89},{"value":48,"source":49,"evidence":50},"Lightweight URL routing and application structure for PHP apps","inferred",[51,53],{"id":52},"post",{"id":54,"by":11,"text":55},"3728459","Two things I do differently: The most important one is that everything is done within an $app context. This means that theoretically you could build two apps, and I later will be…",{"value":57,"source":49,"evidence":58},"PHP developers wanting a lightweight framework",[59,60],{"id":54,"by":11,"text":55},{"id":61,"by":62,"text":63},"3728980","jwblackwell","Looks nice, keep it simple though. There are already a lot of feature full frameworks about that to be honest you can't compete with. I've never used a really lightweight…",{"value":65,"source":66,"evidence":67},"Built personally, hacked up in an evening, inspired by Flask","maker",[68,71],{"id":69,"by":11,"text":70},"3730035","Heheh, the project was born out of enjoying flask development so much, then coming back to PHP and being like...whaaaat.",{"id":72,"by":11,"text":73},"3730460","Yep, that's cool, I mainly made it for personal use so I'm not too bothered if others don't use it! I need to start writing tests and docs really, but as I said, it was something…",{"value":75,"source":66,"evidence":76},"About one evening",[77],{"id":72,"by":11,"text":73},[79],{"value":80,"source":81,"evidence":82},"PHP","commenter",[83],{"id":84,"by":85,"text":86},"3728532","conradfr","I tried the example but ran with some issues. Maybe you could specify the requirements ? 1\u002F It needs PHP >= 5.3 I guess (anonymous functions ?). 2\u002F It needs APC (use of…","open_source","prototype","solo",{"praise":91,"objections":107,"requests":138,"questions":158,"alternatives":173},[92,100],{"value":93,"source":81,"evidence":94},"Simple and lightweight, easier to use than Fat Free",[95,99],{"id":96,"by":97,"text":98},"3728429","ittan","Seems much easier to use than Fat free http:\u002F\u002Ffatfree.sourceforge.net\u002F You should evolve this into a solid\u002Fflexible micro framework.",{"id":61,"by":62,"text":63},{"value":101,"source":81,"evidence":102},"Good start for a microframework",[103],{"id":104,"by":105,"text":106},"3728558","dutchbrit","Looking very good! Definitely a nice start. Made me think of this MVC project: http:\u002F\u002Fwww.phpro.org\u002Ftutorials\u002FModel-View-Controller-MVC.html",[108,119,127],{"value":109,"source":81,"evidence":110},"Regex routing is slow and O(n)",[111,115],{"id":112,"by":113,"text":114},"3728581","johnx123-up","``` Routes are converted to regex and cached so this process does not need to happen every request. ``` But, regex will again degrade performance.",{"id":116,"by":117,"text":118},"3730033","orlandu63","I wouldn't call that computationally efficient. It is possible to make routing an O(log n) operation; your routing solution, like all routers that use regexes directly, is O(n).",{"value":120,"source":81,"evidence":121},"Closure caching not supported without XCache; error handling incomplete",[122,123],{"id":84,"by":85,"text":86},{"id":124,"by":125,"text":126},"3728771","hendrik-xdest","Great work. Hope to see this evolve into a great little toolset. I have gone through your code a bit and think that you should consider error handling first. Some methods return…",{"value":128,"source":81,"evidence":129},"Too close to Silex and Slim",[130,134],{"id":131,"by":132,"text":133},"3729641","Jebus","You basically ripped off Silex http:\u002F\u002Fsilex.sensiolabs.org\u002F",{"id":135,"by":136,"text":137},"3728541","nerdfiles","Following the feature set of http:\u002F\u002Fwww.slimframework.com\u002F at all?",[139,146,153],{"value":140,"source":81,"evidence":141},"Named regex captures in routes",[142],{"id":143,"by":144,"text":145},"3728921","yaix","Looks good. I'd use named regex matches for the routes (like in Django) to make routes more flexible, ie. !\u002Fpath\u002F(?P\u003Cid>[0-9]{1,5}_(?P\u003Ckw>[a-z0-9_]{5,20})! etc.",{"value":147,"source":81,"evidence":148},"Add a license",[149],{"id":150,"by":151,"text":152},"3728486","narad","Can you tell us about the License for use? I do not see the license info.",{"value":154,"source":81,"evidence":155},"Better error handling and tests\u002Fdocs",[156,157],{"id":124,"by":125,"text":126},{"id":72,"by":11,"text":73},[159,166],{"value":160,"source":81,"evidence":161},"How does it compare to Klein.php",[162],{"id":163,"by":164,"text":165},"3728432","damncabbage","I hate to be That Guy, but how does this compare to klein.php [1]? [1] https:\u002F\u002Fgithub.com\u002Fchriso\u002Fklein.php",{"value":167,"source":81,"evidence":168},"Is the route cache stale when routes change",[169],{"id":170,"by":171,"text":172},"3729055","lonnyk","Am I reading this correctly that currently the route results will stay cached for the caches TTL? So if you change a route to have a different callback in your main program it…",[174,182,186],{"value":175,"source":81,"evidence":176},"Slim Framework",[177,181],{"id":178,"by":179,"text":180},"3728546","buchin","I'd prefer Slim Framework ( http:\u002F\u002Fwww.slimframework.com\u002F ) combined with RedBean ORM and H2O Template.",{"id":135,"by":136,"text":137},{"value":183,"source":81,"evidence":184},"Fat Free",[185],{"id":96,"by":97,"text":98},{"value":187,"source":81,"evidence":188},"Klein.php",[189],{"id":163,"by":164,"text":165},{"comments":18,"answered":191,"key":192},8,[193,196,199],{"id":194,"text":195},"3729042","Thanks, and I agree. I usually use exceptions but for some things (like cache misses) it seems unwieldy. For the example of the cache calls, I check when I've done a cache call…",{"id":197,"text":198},"3729651","That's a cool idea, but I wouldn't want to lose the scope as you would with a closure. I will look into seeing if it's possible, though.",{"id":200,"text":201},"3730031","I suppose I could use $var === False, to prevent it pick up empty results.",{"commenters":203,"max_depth":32,"maker_replies":18,"first_comment_mins":204,"lifespan_hours":205},40,28,55,[207,211,213,217,220,222,224,226,230,232,234,236,237,241,245,247,250,253,255,259,263,267,270,273,276,278,280,283,285,290,292,295,297,298,301,304,306,307,311,314,317,319,322,324,327,329,331,333,336,338,340,343,346,349,351,353,357,360,362,366,369,372,375],[208,36,36,209,210,36],"3729176","commenter\u002Fneutral\u002Fdesign","troels",[116,36,36,212,117,36],"commenter\u002Fcritical\u002Fperformance",[214,36,36,215,216,36],"3732878","commenter\u002Fneutral\u002Fperformance","tabbyjabby",[218,36,36,215,219,36],"3732938","k4st",[221,36,36,215,210,36],"3740156",[124,40,40,223,125,36],"project\u002Fcritical\u002Fexecution",[194,40,36,225,11,40],"maker\u002Fneutral\u002Fexecution",[227,40,44,228,229,36],"3729481","project\u002Fneutral\u002Fdesign","shepik",[197,40,36,231,11,40],"maker\u002Fneutral\u002Fdesign",[233,40,36,209,229,36],"3730829",[235,40,40,223,125,36],"3729827",[200,40,36,225,11,40],[238,40,36,239,240,36],"3730056","commenter\u002Fneutral\u002Fexecution","Gigablah",[242,30,44,243,244,36],"3728487","project\u002Fneutral\u002Fidea","cilice",[178,44,36,246,179,36],"commenter\u002Fneutral\u002Fidea",[248,44,36,249,11,40],"3728706","commenter\u002Fneutral\u002Fnone",[251,44,36,249,252,36],"3728728","mise",[72,44,36,254,11,40],"maker\u002Fneutral\u002Fdocs",[256,44,36,257,258,36],"3728986","other\u002Fneutral\u002Fnone","jstsch",[260,37,36,261,262,36],"3728528","other\u002Fneutral\u002Fidea","dools",[264,37,36,265,266,36],"3728561","other\u002Fneutral\u002Fdesign","websirnik",[268,37,32,269,262,36],"3728586","project\u002Fpositive\u002Fidea",[271,37,36,265,272,36],"3728620","kaolinite",[274,37,36,265,275,36],"3728574","Tharkun",[277,37,36,228,11,40],"3728608",[279,37,44,231,262,36],"3728968",[281,37,36,282,11,40],"3729057","project\u002Fpositive\u002Fdesign",[61,32,44,284,62,36],"project\u002Fmixed\u002Fidea",[286,287,44,288,289,36],"3729700",6,"project\u002Fneutral\u002Fnone","whalesalad",[69,287,36,291,11,40],"maker\u002Fneutral\u002Fidea",[150,293,44,294,151,36],7,"project\u002Fneutral\u002Fdocs",[296,293,36,254,11,40],"3728723",[96,191,32,269,97,36],[299,191,44,284,300,36],"3728530","sidchilling",[302,191,36,261,303,36],"3729832","moozeek",[163,305,44,243,164,36],9,[54,305,36,291,11,40],[308,309,36,257,310,36],"3730832",10,"soulclap",[312,31,36,313,11,40],"3728423","maker\u002Fneutral\u002Fnone",[170,315,44,316,171,36],12,"project\u002Fneutral\u002Fperformance",[84,318,40,223,85,36],13,[320,318,36,321,11,40],"3728615","maker\u002Fneutral\u002Fperformance",[323,318,40,223,240,36],"3728953",[104,325,36,326,105,36],14,"other\u002Fpositive\u002Fnone",[328,325,36,257,11,40],"3728610",[143,330,44,228,144,36],15,[332,330,36,231,11,40],"3729031",[334,18,36,257,335,36],"3728902","lignuist",[112,337,36,212,113,36],17,[339,337,36,321,11,40],"3728602",[341,337,36,215,342,36],"3728603","masklinn",[344,337,36,215,345,36],"3728850","1880",[347,337,36,212,348,36],"3728627","Loic",[135,350,44,243,136,36],18,[352,350,36,291,11,40],"3728618",[354,355,36,326,356,36],"3729160",19,"wseymour",[358,355,36,359,310,36],"3730852","other\u002Fneutral\u002Fdocs",[131,33,40,361,132,36],"project\u002Fcritical\u002Fidea",[363,364,44,243,365,36],"3728775",21,"gaius",[367,364,44,294,368,36],"3728785","jlaurend",[370,364,36,371,365,36],"3728795","commenter\u002Fcritical\u002Fidea",[373,364,36,246,374,36],"3728857","jasonlotito",[376,364,36,246,377,36],"3728861","xyzzyz",[],[380,385,390,395,399,404],{"id":381,"name":382,"points":383,"category":384},"3724796","Pinwords",146,"creative",{"id":386,"name":387,"points":388,"category":389},"3732677","WireOver",120,"productivity",{"id":391,"name":392,"points":393,"category":394},"3714509","TheReelBox",81,"consumer_social",{"id":396,"name":397,"points":398,"category":394},"3720178","Rabblr",72,{"id":400,"name":401,"points":402,"category":403},"3734416","similarityapi.appspot.com",54,"data",{"id":405,"name":406,"points":407,"category":389},"3720205","My weekend project",52,false,"v2",{"id":411,"name":5,"line":6,"ai":408,"cat":20,"year":13,"points":14,"comments":15,"rec":27,"s":412,"top":18,"kw":413,"maker":11,"domain":10,"tier":19,"attempts":36,"strip":414,"url":9,"mix":415,"praise":93,"objection":109,"sub":21},3728360,-0.1,[24,21,25,26],"0001031030000500333353300311030000301330",[30,31,30,32],1793990879695]