Archive

Posts Tagged ‘Symfony Resources’

Speed up Symfony by installing APC on Ubuntu

January 29th, 2010

APC (Alternative PHP Cache) is an open source code PHP code cache and optimizer (or code accelerator). It is a necessary companion to any Symfony project. Read more…

Linux, PHP, Symfony Framework , , , ,

Symfony 1.2 sfForm formatter to add stars on required fields

August 31st, 2009

The following is a form formatter class I developed to automatically add stars * on required fields. Feel free to use it and let me know if it can be improved.

You might ask, why not just use setLabels?

Firstly, if you already set required fields to true/false in setValidators, why do you have to add the stars manually again in setLabels? It just doesn’t make sense!

Secondly, using setLabels to add stars is interfering with language translation.

Thirdly, this is I believe a proper (or proper-ish?) way to do this kind of things with sfForm.

Read more…

Symfony Framework , ,

Implementing email login with sfGuardPlugin

April 29th, 2009

(* Update: This article is for Symfony 1.0, for Symfony 1.2 implementation go to Symfony 1.2, Propel, and sfGuardPlugin: email login)

Most of us use sfGuardPlugin with Symfony Framework for user management (login stuffs). It is a great, popular, and de facto plugin for doing user management in Symfony.

Here’s the thing, by default, sfGuardPlugin does login using usernames, not emails. But for many projects, it is preferable and more suitable to use email for login.

In this article I would like to discuss a way to implement email login using Symfony. I’ve only tried this in Symfony 1.0, but this might/should work on 1.1 and 1.2. And I would be very interested to know your experience if you try this method on Symfony 1.1 or Symfony 1.2 Read more…

Symfony Framework , ,

How to do SUM with Propel

February 6th, 2009

http://www.digitalbase.eu/blog/simplifying-queries-using-sum-count-etc-in-propel/

$c->addSelectColumn(’sum(‘.dbTimeBlockPeer::TOTAL.’) as total’);
$rs = dbTimeBlockPeer::doSelectRS($c);
while ($rs->next()) { $total = $rs->getInt(1); }

Read more…

Symfony Framework ,

Multiple Symfony versions in the same environment

February 2nd, 2009

I’ve been using this trick from symfonynerds to run multiple Symfony versions in the same environments. I can now work on projects built on Symfony 1.0, 1.1, and 1.2 simultaneously in the same environment (Ubuntu 8.10).

So now, when I want to create a Symfony 1.0 project, I would just execute “$ symfony10 init-project myproject”. And then in the project I would use “$ ./symfony cc” instead of “$ symfony cc”.

It worths mentioning that I think this trick is good for development environment but “svn:externals” trick or Symfony freeze are better for production/deployment as each project will have their own copy of Symfony Framework.

Symfony Framework , ,

Popular websites built using Symfony Framework

December 6th, 2008

Symfony website has a long list of websites built using Symfony Framework, but this is my own list of favorites/highlights. So here we go:

  • Yahoo! Bookmarks, what more to say, it’s that giant company.
  • del.icio.us, the popular web 2.0 social bookmarking website.
  • travelbug.co.nz, one of Trademe’s websites.
  • w3counter.com, providing detailed web stats to nearly 5,000 websites. That’s over 300 database queries per second, over a billion page views being analyzed, over 28 real-time reports for each site, AJAX, RSS feeds, and lots more running on this framework. All on a single server.

To be continued … I’ll keep adding to this list of websites built using Symfony Framework

Websites using Symfony

How to handle dot in Symfony URL

December 4th, 2008

This problem with dot in Symfony URL is a common issue faced by developers. I’ve seen people asking about it few times in the symfony-users mailing list, and in fact I have asked about it once. Here’s one recent thread about it in the mailing list. Read more…

Symfony Framework ,

Why I like Symfony Framework

December 4th, 2008

I have been doing Java programming for quite a few years. Java is where I got my OOP lessons from and it just makes sense to me, from the multi-threading model, interfaces, abstract classes, encapsulation, to the bean.

I became known as Java man, because 1) I was born in Java island, 2) I program Java, 3) I can speak Javanese, and 4) even though unrelated, I also do Javascript. Read more…

Symfony Framework ,