MyBB Community Forums

Full Version: Still using twig?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6
Ah okay, so phpbb is also moving ahead. Wink

Well I guess we'd have to adjust the things than.
IPB use their own framework and I think xenForo use Zend. The benefits far outweigh the current system we have. You could almost call it 'standard practice' to use some sort of framework for a major PHP project.
I'm pretty sure SMF uses their own as well.
(2011-12-22, 01:47 AM)TheGarfield Wrote: [ -> ]Seriously, I wish MyBB team makes an official announcement and decides not to use any frameworks, is it that hard to code in basic PHP??

Basic PHP can only get you so far. The point of a framework is to have nice, well laid out, reusable code. Thus reducing code repetition, and allowing you to fix a bug that will fix the software as a whole, rather than having to patch every location the code is used in.

This example is nice, easy to use, type, and can be used (for example) with multiple database types. It's also re-usable, thus reducing the overhead of fixing a potential issue with the way you would select and store a single row in an array while also automatically applying any security precautions that I need to ensure a request does not contain malicious code. Ideally the API methods in use would also be in a Registry but that's neither here nor there.

$row = $rdbms->selectAndFetch ( 'table', '*', "id = '" . $input->getRequest ( 'id' ) . "'" );

Whereas, in basic PHP, that code becomes (in it's very basic form, most frameworks have a lot more going on than this):

$query = mysqli_query ( $dblink, "SELECT * FROM table WHERE id = '" . intval ( $_REQUEST['id'] ) . "'" );
$row = mysqli_fetch_assoc ( $query );

I'd need to write out the full query every time... doesn't support multiple database solutions... I have to manually apply security precautions to the input request... and then I have to manually fetch the result and store it in an array. Not to mention if I wanted to support PgSQL and SQLite, I'd have to repeat that code in a switch() or if() statement for each one of those with the correct query / functions for that database system.



On the topic of which BBS' use their own framework... the current list (by memory):

Own Framework: IPB, vBulletin, MyBB 1.6, SMF, phpBB 3, AEF, UBB.

3rd Party Framework: XenForo (Zend), MyBB 2.0 (Yii), phpBB 4 (Symfony).
I really think MyBB should do your own. But if it isn't what they want, they won't. IMO guys, if you are against it, wait till 2.0 is released, and change the framework yourself. Fork it.
(2011-12-24, 03:36 AM)Aristotle Wrote: [ -> ]I really think MyBB should do your own.

Why? Is there any real reason why you are against building MyBB on top of third-party solution? Smile

For every programmer gains from using ready framework are obvious: I get tested, stable and continuously upgraded solutions for common problems. I dont need to waste time yet again writing input handler, database drivers/abstraction, I18n, etc ect. All this stuff comes in package, I just cherrypick what I need.

What are downsides? If I pick wrong framework for the job I may end with too big performance overhead, compatibility problems or large package size... but I believe MyBB guys compared their options carefully before picking Yii.
There's also the downside that you're relying on the code of others and should development cease for whatever reason, then you may be up a creek without a paddle.
(2011-12-31, 07:10 PM)euantor Wrote: [ -> ]There's also the downside that you're relying on the code of others and should development cease for whatever reason, then you may be up a creek without a paddle.

Kind of what I am thinking too. But, I suppose they'll make it work to one degree or another.
(2011-12-31, 07:10 PM)euantor Wrote: [ -> ]There's also the downside that you're relying on the code of others and should development cease for whatever reason, then you may be up a creek without a paddle.

Not the case with popular frameworks. Projects like Zend, RoR or Django are not something that exists in void. There are entire ecosystems build around those solutions, with real money behind to ensure development and improvement is ongoing process.
(2011-12-31, 06:41 PM)Rafio Wrote: [ -> ]
(2011-12-24, 03:36 AM)Aristotle Wrote: [ -> ]I really think MyBB should do your own.

Why? Is there any real reason why you are against building MyBB on top of third-party solution? Smile

Third party has a bug, MyBB does, third party shuts down, MyBB has problems. I love the idea of a framework, just not in a practical world. Murphy's law will happen. You can control how many variables you have, but that's about it.
Pages: 1 2 3 4 5 6