MyBB Community Forums

Full Version: Yii framework
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 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
It sure is. The beta stage is usually the best time to start investigating how to build plugins and stuff so you can have releases ready for the first proper release.
-Edited out-
The problem is there will constantly be new great frameworks coming out. And, well if they don't stick to their guns development will never start/finish.
I really don't agree on laravel. I like it as a framework for personal applications, but it isn;t suitable for a project like MyBB. Taylor's already announced that version 4 will have major changes and it seems the same happened between 2 and 3. That's just too much work to maintain for large projects. You need a more stable codebase.
(2012-07-17, 01:42 PM)Alex Smith Wrote: [ -> ]The problem is there will constantly be new great frameworks coming out. And, well if they don't stick to their guns development will never start/finish.

Indeed. That's the only problem really.
(2012-07-17, 02:02 PM)Fábio Maia Wrote: [ -> ]
(2012-07-17, 01:42 PM)Alex Smith Wrote: [ -> ]The problem is there will constantly be new great frameworks coming out. And, well if they don't stick to their guns development will never start/finish.

Indeed. That's the only problem really.
Yeah. Unfortunately.
As long as the framework chosen is fast, simple, lightweight and most of all Mature, then my vote will be there.
(2012-05-03, 02:46 PM)Tomm M Wrote: [ -> ]Consider the following query builders:

// MyBB 1.6
// Requires escape_string
$query = $db->simple_select('users', 'uid, username, email', "username LIKE '%Tomm%' OR username LIKE '%labrocca%'");

// Code Igniter
$this->db->select('uid', 'username', 'email');
$this->db->like('username', 'Tomm');
$this->db->or_like('username', 'labrocca');

$query = $this->db->get('users');

// Laravel
// Not sure if wildcards require escaping
$query = DB::table('users')
	->where('username', 'LIKE', array('%Tomm%', '%labrocca%'))
	->get('uid', 'username', 'email');

// Yii
// Requires wildcard characters to be escaped before use
$query = Yii::app()->db->createCommand()
	->select('uid', 'username', 'email')
	->from('users')
	->where(array('like', 'username', array('%Tomm%', '%labrocca%')))
	->queryAll();

// Doctrine/Symfony
// $qb; createQueryBuilder instance
$query = $qb->select(new Expr\Select(array('u.uid', 'u.username', 'u.email')))
	->add('from', new Expr\From('Users', 'u'))
	->add('where', $qb->expr()->orX(
		$qb->expr()->like('u.username', '?1'),
		$qb->expr()->like('u.username', '?2')
	))
	->setParameters(array(1 => 'Tomm', 2 => 'labrocca'))
	->getQuery();

// ... all produce
$query = "SELECT uid, username, email FROM mybb_users WHERE username LIKE '%Tomm%' OR username LIKE '%labrocca%'";

As you can see, all 4 examples use a different method of querying the database with their own query builders. It's not that any of it is hard, alien or complex - it's just 100% different to what you're used to doing (perhaps, because this is the first framework experience?).

Why is building sql statement with Framework Objects better, faster, more readable or more efficient than building query with strings?

You can create complex sql queries with strings, variables, arrays, string functions, filter, manipulate string with regex, etc and deal with security before. And use PHP's PDO to make the code portable on different databases...

http://www.yiiframework.com/doc/api/1.1/...%29-detail
The lack of example in their documentation doesn't help:
"an array representing multiple SQL statements to be unioned together."
(2012-08-27, 04:14 AM)Pluton Wrote: [ -> ]Why is building sql statement with Framework Objects better, faster, more readable or more efficient than building query with strings?
The main advantage is that it works with every supported DBMS.
have you guys ever looked at, laravel?
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23