Live data from Hacker News

Show HN: Rails-Inspired PHP Framework

github.com

41–46 of 46 posts

Re: Show HN: Rails-Inspired PHP Framework

#41
post #11

ONE YEAR since the last commit, seriously? Where are the tests? Composer? Next.

Your point is accurate but your tone is deplorable. To you this is just another post about just another Github report, but to the author this is something they spent several months on.[0] [0] https://github.com/mgauthier/php_diamond/contributors

Sorry about that, dude. I don't mean him no disrespect. It's just inconceivable to publish his work in these conditions, at least imho.

Re: Show HN: Rails-Inspired PHP Framework

#42
post #29

Earlier quoted context omitted.

Well since I am technically running my site with it (which i'm also not posting since it's just some bootstrap pages right now) I should probably get around to it sooner or later... I guess people will need another excuse to post Veekun's manifesto. It's not 'rails inspired' though since I don't know Ruby/Rails.

There's a rule of thumb in PHP: Everyone should write their own framework, no one should release it. The reason is that by rolling your own framework, you learn the ins and outs of a number of things. It's even better if it's a framework you've derived from a functional app. I've rolled a number of my own frameworks including one for mobile (WAP) and the one underlying my open source project. The first was never shar…

what makes it better than x

probably nothing. Ill be adding links to the frameworks you'd probably rather be using in the readme anyway. it's entirely meant to scratch my personal itch.

What were your priorities in the architecture? What did you de-prioritize?

Easy static page generation and header control, and reasonable security out of the box. I like to think of it as a static site framework since its primary purpose is doing the MVC process but resulting in static pages. I don't know how well it does this to scale with complex taxonomies yet but it'll run Bootstrap.

I de-prioritized elegance and abstraction to a degree. If anyone ever sees it, they'll probably think it's kind of ugly.

What features did you consider absolutely mandatory? What did you decide to leave out? Twig as the template engine and htmlpurifier. Every view is run through twig, then markdown (so even though the views are twig files they can be entirely markdown and still work fine), then htmlpurifier with a whitelist before being either saved statically or sent. So certain things like adding forms to a page and script tags and such are made purposely more difficult because htmlpurfier will just strip them out.

I left out complex asset handling (you specify .js and .css dependencies in the routes if you want them.. which is probably breaking best practice but oh my god is it convenient) and routes in closures because at the time I wanted to tie every route to a controller and method. There are no html helper classes because I wanted nothing but data going into the templates, so nothing that generates html. A lot of things are 'left out' just because I haven't gotten to them yet.

What made you take the approach you did? I couldn't stop messing around with Laravel and I realized I didn't really understand what was going on like I wanted to. I just wanted a lightweight framework that would generate a site statically and not load a bunch of libraries and whatnot if they weren't needed. Because I'm on a cheap shared server and there don't seem to be a lot of solutions that don't assume I'd be running on Heroku with unlimited bandwidth or something.

Re: Show HN: Rails-Inspired PHP Framework

#43
post #36

Earlier quoted context omitted.

Oh my... https://github.com/oguzbilgic/hivli/blob/master/lib/Loader.p...

I have written this code 5-6 years ago, there is definitely room for improvement :)

you should probably get rid of the evals as soon as possible. there are other ways to test for a class and method (is_readable(), class_exists(), method_exists() or the reflection api which I don't remember the syntax of offhand)

Re: Show HN: Rails-Inspired PHP Framework

#44
post #13
post #4

Also, FuelPHP is a Rails inspired PHP Framework.

Judging by the commit history[1] it seems FuelPHP isn't being actively developed anymore. https://github.com/fuel/fuel/commits/1.5/master Although this is the 1.5 branch, the other branches are also similarly inactive (it appears to have ended about a month ago).

And so? Fork it and start developing! FuelPHP have good core for start.

Re: Show HN: Rails-Inspired PHP Framework

#46
post #42

Earlier quoted context omitted.

There's a rule of thumb in PHP: Everyone should write their own framework, no one should release it. The reason is that by rolling your own framework, you learn the ins and outs of a number of things. It's even better if it's a framework you've derived from a functional app. I've rolled a number of my own frameworks including one for mobile (WAP) and the one underlying my open source project. The first was never shar…

what makes it better than x probably nothing. Ill be adding links to the frameworks you'd probably rather be using in the readme anyway. it's entirely meant to scratch my personal itch. What were your priorities in the architecture? What did you de-prioritize? Easy static page generation and header control, and reasonable security out of the box. I like to think of it as a static site framework since its primary purp…

Thanks for the exhaustive answer.
Post reply on HN