my love affair with rsync

rsync –progress -r –exclude-from=./rsync_exclude.txt –delete -e ssh -p ./ user@host:path

- r= recursive

-exclude-from = exclude files txt file

–delete = deletes files that aren’t on target

-e = specify shell to use , ssh in this case

-p = preserve the permissions

a really easy way to deploy code to your web servers.  my rsync_exclude.txt usually includes my eclipse settings files and .svn

a really easy shell script would be to have this loop through your production servers to do an update.

try it out tell me what you think

Thoughts on switching from symfony to codeigniter

So i’ve been a long time fan of symfony, and have used it quite regularly on large projects.  It’s been pretty good and has helped me developed sites rather quickly.  However, i’ve felt that the framework has been getting too large and effecting performance, and recently they’ve also decided to switch to the Doctrine ORM, which i’ve found very unreliable for large data sets. For these reasons i’ve decided to switch to the codeigniter framework on my latest project and i’ve been quite happy with the results.

First, the code igniter framework is a lot less code than symfony (and much easier to install).   The result it seems, is a faster snappier website.  Additionally, digging through the code igniter framework to see what’s going on, is 10x easier than going through the symfony framework base code.  I know some ppl will argue that the caching on symfony should make it just as fast, but honestly, I dont see it.  I’ve tried many different caching strategies that they outline online and in the forums, but code igniter’s simple view template strategy seems much faster.

Code igniter currently doesn’t come with a default ORM.  Because of the lack of an ORM, pulling data from the database is much faster compared to Doctrine’s access.  I was running a 4million record database that linked to a 2 million record database.  Doctrine pretty much puked on this.  I haven’t seen an issue yet with this with the Code igniter database class.  I think the many abstraction layers that Doctrine has results in unnecessary classes which leads to slower results access and increases the chances of memory leaks.  Say what you may, but these are the results that i’ve found for my website.

handling checkboxes in symfony forms 1.2

Checkboxes aren’t really covered in the tutorial for forms in 1.2.  However, it’s covered pretty well on the blog over here:

http://www.symfony-project.org/blog/2008/10/14/new-in-symfony-1-2-make-your-choice

One thing to note:  if you need a multiple checkboxes for one value (in php it’s handled like so: varname[]), you would use the sfWidgetFormChoice with the multiple=>true and expanded=>true.

Also, if it’s an array of values, use sfValidatorChoiceMany instead of sfValidatorChoice.

-d

escaping output in symfony – wtf is going on????

Ok, I was a little confused as to what the hell was happening when I escaped my output in symfony.  It looks like the 1.2 framework takes all your values and objectifies them, putting them into classes.  For your arrays, they go into sfOutputEscaperArrayDecorator.

What this means is that now when you are trying to use the array in a view, you need to call the getRaw function that sfOutputEscaperArrayDecorator has.  SO:

in your action:

$my_array = array(1,2,3,4);

in your view print_r($my_array) will throw in error.  what you need to do instead is:

print_r($my_array->getRawValue());

I haven’t tested the rest of the objects out, but im assuming you can get the actual object by calling getRaw() on the variable name.

-d