symfonynerds.com

Nerds who love the symfony-project

Archive for the ‘tools’ Category

In our team, we’ve been using Symfony since version 1.0, and ever since we started we’ve been evolving the way we work. For a little while I’ve been thinking of writing a “best practice” series, not to say this is the way you MUST do things, but to point out some of the things that have worked for us, and more than anything, to spark some conversation about what works for you.

It’s always best to start at the beginning, and for most Symfony (or any) web apps, this is often with designing your schema (ignoring requirements gathering, but who really cares what your users want :D)

Our approach here can be summed up in one word: Workbench. Ok maybe two: MySQL Workbench.

Yes this is only usefull for MySQL databases, but as our 2009 survey showed, this is far an away the most popular DB used with Symfony.

Maybe you really love writing your schema.yml and wouldn’t dream of doing it any other way, but personally, I find working with the visual representation of my schema to be a lot faster and generally delivers a much better result - there’s something about ’seeing’ it that makes it easier to design.

Apart from this (and some people I know genuinely prefer to write their schema file by hand) there are probably three more REALLY good reasons to give this a try:

Consistency
As I talked about here CaMeL cAsE matters. If you try and chop and change between a forward and reverse engineered DB/schema.yml you are almost guaranteed to run into trouble where someone has named something outside of the convention Symfony will use in a reverse engineer of the DB. Starting with and sticking to a process of reverse engineering your schema.yml (then model, forms & filters) from the DB will ensure consistency.

Upgrading
One of the seriously, seriously cool features of Workbench is that it can generate a MySQL ‘upgrade’ script for you. You can give it another Workbench file (eg: an older version of your schema) or a DB to connect to then compare it to your latest version and it will generate the ‘alter’ script for you to upgrade your DB. This is awesome for the real world where you don’t want to have to blow away and reload your database (leading to extra production downtime) if you don’t have to. In the case of an upgrade where only new tables or columns are added this becomes so simple it’s incredible. As some of you will know once your DB gets too big fixtures will no longer help you, in this case this is even more valuable.

Speed & Safety
Since Workbench allows you to connect to a MySQL server and ‘forward engineer’ (or reverse if you want it initially) you quickly realise the fastest as well as safest way to make schema changes to your app is really to do it in Workbench, forward engineer it to your DB, then rebuild your schema, model, forms & filters. The best processes in the world usually fail if they are hard to implement, but so far I’ve found doing things the right way has also been the easiest.

So, how do you go about designing your schema? Do you have a better method, or are you keen to give Workbench a workout?

  • 8 Comments
  • Filed under: tip, tools
  • I agree with this: Netbeans is a good IDE for Symfony development. I think this is especially true if you, like me, also develop with JVM languages. This last year I was doing some Java/Swing and Groovy projects, so I started using NetBeans again. It has a plugin for doing Symfony work - very handy.

    (Off topic, the more I work with Groovy, the more I think this is the perfect language for PHP developers who want to learn a JVM language.)

  • 5 Comments
  • Filed under: tip, tools
  • Symfony & YUI

    This is a bit of a cop out of a post, but tonight I started looking for some info on Symfony & YUI… It’s something I’ve been meaning to look at for a long long time and while I was reading about CSS Frameworks I found out there is one that forms part of YUI, so it spurred me to look some more at it…

    I found this great presentation I thought worth sharing by Dustin Whittle (from Yahoo!) about it here

    For those wanting to starting using it you should check out the main site linked to above and maybe check out the sfYUIPlugin, although it looks a little out of date.

    Have a read. When I start playing around with it myself I’ll post what I learn…

  • 2 Comments
  • Filed under: plugins, tip, tools

  • A few weeks ago Symfony nerds launched the 2009 Symfony developers survey. It’s been great to get the communities feedback and today we are happy to publish the results. We had over 250 Symfony developers fill out the Developer Survey which was real exciting to see!.

    Some interesting highlights:

  • Most developers went straight from Symfony 1.0 to 1.2 and skipped 1.1
  • Propel is the dominant ORM framework, which is interesting in light of the recent announcement that Doctrine will be the default ORM framework in Symfony 1.3 and moving forward.
  • Ubuntu is by far the most popular platfrom Symfony developers choose to run their applications on
  • The question with the most evenly spread results is “How long have you been developing Symfony applications for” (see question 6). Indicating the community has a wide range of experience with lots of people under one year experience and many over two years experience.
  • Most Symfony developers have never developed in another web application framework
  • jQuery is by far the most popular library used with Symfony
  • Eclipse PDT is the most popular IDE for Symfony developers
  • No surprises here: Most Symfony developers are from Europe (which saddens us Aussies - we need more Aussie Symfony developers!)
  • There were no developers that took the survey indicated they run Symfony applications on Oracle and MSSQL. MySQL was the most popular database used by far.

  • 2009 Symfony Developers Survey Results



    1. What version of Symfony to you currently develop with the most?
    What version of Symfony to you currently develop with the most?

    1.0.* 18%
    1.1.* 6%
    1.2.* 76%



    2.What ORM Layer do you use the most?
    What ORM Layer do you use the most?

    Propel 67%
    Doctrine 31%
    Don’t use ORM 0%
    Other 2%



    3. Where do you ask your Symfony questions?
    Where do you ask your Symfony questions?
    People may select more than one checkbox, so percentages may add up to more than 100%.

    Official Symfony Forums 65%
    Symfony Blogs 23%
    Symfony Users Google Group 40%
    Symfony IRC Channel 19%
    External Training / Consultant 2%
    Other 14%



    4. What environment do you run most of your Symfony applications on?
    What environment do you run most of your Symfony applications on?

    Red Hat Linux 6%
    Ubuntu 39%
    Windows Server 8%
    Fedora 3%
    CentOS 8%
    Mac OS 7%
    Other *nix 13%
    Other 15%



    5. How do you install Symfony?
    How do you install Symfony?

    Pear Install 34%
    Source download 21%
    SVN checkout 40%
    SUSE package 0%
    Debian/Ubuntu package 1%
    Other 4%

    Most popular “other” value: SVN:Externals



    6. How long have you been developing Symfony applications for?
    How long have you been developing Symfony applications for?

    < 1 Year 29%
    1 Year 23%
    2 Years 21%
    2+ Years 28%



    7. What database do you use the most for your Symfony applications?
    What database do you use the most for your Symfony applications?

    MySQL 88%
    Oracle 0%
    PostgreSQL 10%
    MSSQL 0%
    DB2 0%
    SQLLite 2%
    Other 0%



    8. Have you (or do you) develop in other PHP Web Application Frameworks?
    Have you (or do you) develop in other PHP Web Application Frameworks?
    People may select more than one checkbox, so percentages may add up to more than 100%.

    CakePHP 15%
    Zend 30%
    Seagull 1%
    CodeIgniter 14%
    eZ Components 3%
    PRADO 2%
    Seagull Project 0%
    I have not developed in other frameworks 44%
    Other 15%

    Most popular “other” Smarty & “My Own”/”Custom Built” famework.



    9. Largest Symfony application you have built is used by…
    Largest Symfony application you have built is used by...

    less than 50 Users 26%
    less than 100 Users 6%
    less than 500 Users 17%
    less than 1,000 Users 8%
    less than 2,000 Users 6%
    greater than 2,000 Users 37%



    10. What types of application do you mostly build with Symfony?
    What types of application do you mostly build with Symfony?
    People may select more than one checkbox, so percentages may add up to more than 100%.

    CRUD Applications 76%
    SOA Based Apps (REST, SOAP…) 22%
    Integrated applications (mashups with existing systems) 32%
    Batch Processing Apps (Heaving focus on Tasks/Batch) 18%
    Workflow applications 38%
    eCommerce 29%
    Other 10%

    Popular responses for “other”: Online form-email, Intranets



    11. What other popular libraries do you use with Symfony?
    What other popular libraries do you use with Symfony?
    People may select more than one checkbox, so percentages may add up to more than 100%.

    Prototype 41%
    script.aculo.us 35%
    jQuery 77%
    jQuery UI 49%
    YUI (Yahoo! UI) 12%
    Adobe Flex 7%
    Other 8%

    Popular responses for “other”: ExtJS, MooTools & OpenLayers



    12. How do you contribute to the Symfony project?
    How do you contribute to the Symfony project?
    People may select more than one checkbox, so percentages may add up to more than 100%.

    I use Symfony 94%
    I am a Symfony Core Developer 3%
    I report bugs 39%
    I contribute to the symfony-developers group 12%
    I answer Symfony questions (IRC, Groups, Forums…) 43%
    I blog about Symfony 25%
    I am a plugin developer 23%
    I contribute to the Symfony Wiki 11%
    I contribute to the Symfony code Snippets 8%
    Other 5%

    Popular responses for “other”: Word of mouth / Sharing experiences with others.



    13. What IDE do you use when developing in Symfony?
    What IDE do you use when developing in Symfony?

    Eclipse + PDT 34%
    Eclipse 3%
    NetBeans 18%
    Komodo 2%
    PHP Designer 0%
    NuSphere PHPEd 2%
    Zend Studio 10%
    PHPEdit 0%
    My favourite text editor (Vi, Notepad, EditPlus…) 16%
    Other 15%

    Popular responses for “other”: Aptana, Coda, Dreamweaver



    14. Where do you develop Symfony projects from?
    Where do you develop Symfony projects from?

    Asia 7%
    Africa 2%
    North America 14%
    South America 6%
    Europe 71%
    Australia 2%
    Antarctica 0%



    15. If you had to choose one reason why you use Symfony, what would it be?
    If you had to choose one reason why you use Symfony, what would it be?

    Rapid Application Development (Admin Generator…) 27%
    Ease of use for front-end development (Ajax, Forms etc..) 9%
    Scalable Framework 16%
    Standards-based framework 24%
    Project Documentation 16%
    Quick to get started 4%
    Online Community 4%
    Training and Enterprise Support 0%
    Backed by an organisation 1%



    16. If you had to pick one area to improve the Symfony framework - what would it be?
    If you had to pick one area to improve the Symfony framework - what would it be?

    Simplify the Framework 14%
    Improve documentation 24%
    Additional features to the framework 8%
    Further work on the Admin Generator 13%
    Interoperability with other frameworks 3%
    Improved plugins 16%
    Focus on scalability 15%
    Other 6%

    Popular responses for “other”:
    - Lots of responses to stream line the Forms API (multiple ways of doing things), leading to confusion.
    - Focus on performance


    There you have it! Did anything surprise you? If you have any suggestions for next years survey, let us know! For those that missed out on filling out the survey, the survey is still open.

    For a while now Symfony developers have been looking for a good IDE to use when developing in the Symfony framework. Some use Eclipse with PDT (PHP Development Toolkit), some use NetBeans 6.5 with it’s recent support of the PHP stack, some have tried creating Symfony-specific Eclipse plugins, without much sucess and many often prefer to use their favorite text editor.

    Whatever you choose, it’s great news to see that Sun is going to back Symfony specific things in its upcoming release of NetBeans 7.0 - the framework is maturing and so are its tools.

    For a while now, NetBeans have been evaulating the support of a PHP framework within it’s stack. A call out went to Symfony developers, to vote if you want it!. NetBeans thenĀ  began evalutating the big response it got from Symfony developers.

    Not sure if it missed most peoples radar (it missed ours!) - but late last year, Sun announced Symfony will be supported as part of NetBeans 7.0:

    “The news is that the Symfony support will be part of NetBeans 7.0. We are going to start work on it very soon. I hope that it will be a part of continual build this year and community can comment the support and work with us to finish it in the best possible quality and usability”

    From what we can tell from here and the product Roadmap, NetBeans 7.0 release could be ready somewhere between April and June this year.

    Do you use an IDE when developing in Symfony? What do you use? Do you think you will use NetBeans 7.0? Let us know… interested to hear your thoughts…