Clear background Blurry background
  • dev / 

    FinallyPHP, finally!

    When I launched this blog, I was saying something about a framework on which it was built. Well, after a while of improving and tweaking (but mostly sleeping and drinking), it's official!

    FinallyPHP is an open-source project, so if you're into PHP browse it up and feel free to contribute if you like what you see and share the same philosophy. Most of the files are commented Javadoc-like and thanks to PHPDoctor there's an API Documentation generated from it.

    The framework works on PHP 5.3 or higher. If I started a PHP framework I at least wanted to benefit from the new late static bindings, namespaces here and there, and why not, actual closures (finally!). I understand that some programmers might not have control over the client's server setup, but my target here is not exactly a corporate one. Browser compatibility is one thing, but I find it foolish to compromise the entire project base for something that is on your side.

    Why PHP?

    Contrary to the current trend, PHP is still the most popular language in web development, simply because it's very accessible. Now I know that's not necessarily a good thing, but in the end... it actually kind of is. I'm not a big fan or anything, I'm just saying there's a reason why it still has the largest demand even though more and more developers state that they would rather use something else. It's easy so eventually useful, and people obviously like that. And yes, the name conventions are not that flawless and it does lack some OOP features, but it's not all that bad. Most of the time cluttered PHP code is the product of inexperienced coders, not the language itself. That is bound to happen when something is so widespread and so easy to start with, you can't really blame PHP for that.

    The switch that I was talking about that PHP developers tend to make is mostly towards Ruby, mainly on Rails. And there's nothing to comment here, Ruby is a beautiful language and Rails is a great tool. But the reason I started this PHP framework is pretty simple: I still use PHP most of the times when it comes to web-related back-end work, usually due to client request. And if I were to code in Ruby, starting a new framework would indeed be pretty bizarre, since Ruby and Rails come hand in hand so well that outsiders don't even know which is which.

    Why Finally?

    But why a framework in the first place, then. Well, there are a bunch of solid PHP frameworks out there, and even though none as successful as Rails is for Ruby, some are pretty good and deserve respect for their efforts. I however find them too bloated for my taste. The way I see it, I want a framework to build on, not a framework to build under.

    Let me give you an example from how FinallyPHP works: The BaseModel (base class for all models—Active Record, if you may) does not have SQL functionality, it's merely an abstract class that deals with core model logic. There's different subclass of it called SQLModel for that and all SQL-driven models must extend it. This way if you want a model to work with say .txt files instead of a database, you can easily create a custom BaseModel subclass named TXTModel (or however you want) and then extend your models from that. This way the model superclass is not a bloated class with every type of data functionality stuffed inside it and follows a more modular design pattern.

    All in all, starting this framework was not a sudden decision, I happened over time and it's been more than a year now. It started with a simple structure for basic sites, then I kept adding, rewriting, consulting with friends, sometimes even seeing how they do it but at the same time keeping it light so I don't become the man, myself—it was a blast and I learned a bunch. I'm not saying it's better than that or that, I'm just very proud of the current result and hope to be prouder in the future. And if it helps the crap out of me, it might help others as well.

  • Interesting will have a look :) only framework i know now 5.3 is lithium which is pretty slick

    +Reply

    Posted September 2010, by Chris

What do you think?

And you are?

...