Jump to content

Favourite PHP Framework?


Kieran

Recommended Posts

  • Administrators

Well phpVMS is written on Codon, I used to have that in active development for an old job. It's based on CakePHP (well, not initially, but I've modified it). It's really lightweight. But now, vaCentral is written using CakePHP. I use a custom "framework" for the API server (it's a MVC format in 3 files), super lightweight.

I am a big fan of Cake, there's alot of Ruby-isms. I'm looking out for symfony2, and the next version of Cake. CodeIgniter is ok to start with, but there's no ORM. I like recess too. But Cake is my "goto" framework, it's great all around. It's benchmarked to be slower, but with some caching, it runs just fine. In my benchmarks, all the frameworks ran about the same, since it's server-limited before you even hit code maximums IMO.

Link to comment
Share on other sites

  • Administrators

Yeah, I'm waiting for 2.0 (http://symfony-reloaded.org/). I haven't played with 1.0 much, but it has a sweet admin generator. I might use it for vaCentral when I do the rewrite I have to get started with soon.

Benefits... well I like the MVC model - templates, logic and database all separated. Clean code means less bugs. Means more productive time.

Link to comment
Share on other sites

Well it does reall make you life easier! Think about it like this...

Would you rather use this...


<?php
$handle = mysql_connect('localhost', 'blah', 'tt');
mysql_select_db('dbaaa');

$check  = mysql_query("SELECT * FROM users WHERE login = '".mysql_real_escape_string($_POST['callsign'])."'", $handle);
$total = mysql_num_rows($check);
if ($total == 0) {
mysql_query("INSERT INTO users (id, login, pass) VALUES (NULL, '".mysql_real_escape_string($_POST['callsign'])."', MD5(".mysql_real_escape_string($_POST['pass']).") )");
}

?>

or this...

<?php
include "includes/bootstrap.php";
Pilot::Add($_POST['callsign'], $_POST['pass']);
?>

:D

Link to comment
Share on other sites

  • Administrators

Yeah, I'm a bit weary of ORM, though I use it extensively, albeit with alot of caching with APC or memcache. In phpVMS I've done that a bit with the findPilots() and findSchedules() functions, I love the flexibility. But I've seen some frameworks do odd joins and whatnot with ORM (I remember with Doctrine a few times I saw some funky joins which were fixed)

I like with cake it's:

$user = array(
'User' => array(
	'username' => 'something',
	'password' => 'something',
	// other fields
),
);


$this->User->save($user);

I kinda brought the same concept over to phpVMS for updating alot of things all over (pireps, etc. So I think you'll like working with phpVMS - controller formats follow cake, models are a bit different but same concept with the 'find*' functions (I couldn't really implement ORM this late in the process but I've standardized things quite a bit)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...