So symfony team had enough time since they released 1.2 in December to polish this version (not mentioning about 1.2.3 release) and published Jobeet manual. And we’ve finally decided that it’s time to completely switch to using 1.2 branch. We’ve already written about branches comparison and its advantages/disadvantages in our articles:
but now we’d like to send a message to guys who still not sure if it’s worth to switch to 1.2.
Our opinion – it’s quite painless and you really wont have to learn something new if you don’t want to do it.
Let us mention here though about a few things you may need to know.
So the first thing is new command line syntax. This will be a small challenge if you only used 1.0 branch before. And to save your time here is a few commands you’ll have for sure to use.
So instead of old: symfony new project_name you must use now:
symfony generate:project project_name
and the same way you’d have to use generate:app, generate:module etc
Another command you will use often for sure is (old style: symfony propel build-all-load):
symfony propel:build-all-load –no-confirmation
where last –no-confirmation for silent database re-generation. And your favorite command to clean cache “symfony cc” can be used with the same syntax without changes.
Next difference is admin generator. It’s big and small difference though. You have now a lot of awesome features without actual big changes in syntax. In fact, it’s almost the same, here is the sample:
title: My Module List
display: [ name, email, updated_at ]
So as you can see there are some small differences but they are mostly about new functionality. So if you knew how to use admin generator – you can keep using it in the same manner.
We’d like to mention here about non obvious stuff about admin generator. Now when you use admin module generation command (which is symfony propel:generate-admin backend my_module –module=myModule) it will add new route commands to your config/routing.yml file. Also if you use Propel in your symfony project when you create new project it adds symbolic link to propel plugin images/css files in your web folder.
And the last difference we would like to mention here is using of stand-alone php files (either web/index.php or batch files). Symfony 1.2 requires different syntax for loading itself and it looks like this:
require_once(dirname(__FILE__) . '/../config/ProjectConfiguration.class.php');
$configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'dev', true);
$databaseManager = new sfDatabaseManager($configuration);
So we believe with this little help you can switch to 1.2 immediately and wont face any significant problems.