Archive for June 2009


Snippet: symfony simple frecuently used commands

June 29th, 2009 — 2:33pm

Syntaxis for some simple but frecuently used symfony commands

Database

Configure symfony to use especific mysql database

$ symfony configure:database "mysql:host=localhost;dbname=my_database" user_name password

Rebuild all. This command rebuild models, form, and tables, so destroy all data in database.

$ symfony propel:build-all

Rebuild all and load test data. This command rebuild models, form, and tables, so destroy all data in database and reload it from fixture files.

$ symfony propel:build-all-load

Frontend and Backend

Frontend Aplication. Generate frontend application

$ symfony generate:app --escaping-strategy=on --csrf-secret=FrontendSecret frontend

Frontend Module. Generate a module called module_name in frontend application. The module will have a show action in addition to the new, edit and delete ones.

$ symfony propel:generate-module --with-show --non-verbose-templates frontend module_name ModelObject

BackEnd Aplication. Generate backend application

$ symfony generate:app --escaping-strategy=on --csrf-secret=BackendSecret backend

BackEnd Module. Generate a fully functional module called ‘module_name’ in the backend, based on the model object named ‘ModuleObject’.

$ symfony propel:generate-admin backend ModuleObject --module=module_name

Comment » | Symfony

Install .kext files for Mac Beginners

June 22nd, 2009 — 12:00am

One of the first thing I have had to learn, once installed Mac Os X 10.5.5 leopard on my pc ;-) is how to install the drivers for my specific hardware.

In Mac World, most drivers come in the form of .kext files and it is relatively easy to find them in internet, but how to install them?

There are several utilities you can use, one of the simplest one is kext helper, but just in case, I have always prefer to know what happens behind the scenes, so here is the long way:

  1. Supposing xxxxx.kext is the file you want to install, with the finder, copy it to /System/Library/Extensions
  2. Open Terminal from Applications/Utilities
  3. In the Terminal windows type the following:
    $ chmod -r 755 /System/Library/Extensions/xxxxx.kext
    $ chown -r root:wheel /System/Library/Extensions/xxxxx.kext
  4. Remove the cache files:
    $ rm /system/Library/Extensions.kext
  5. If you have kextcache (few people have):
    $ rm /System/Library/Extensions.kextcache
    $ rm Extensions.mcache
    $ sudo kextcache -k /System/Library/Extension
    
  6. And finally, reboot

Instead of removing cache files (step 4 and 5) you can specify the -f -v options at boot time. The -v option is the verbose option, which allow you to see what is happening while loading the os, and the -f option tells the os to reload all .kext files.

Comment » | mac os x

TODO: Change some windows habits

June 17th, 2009 — 12:00am

I have been studing symfony for the last two months and I have discovered a new world in web developing.

Armed with all my new skills, I am now migrating the web site www.ajedrezenmadrid.com from msaccess/asp to mysql/php.

As a senior windows developer I feel comfortable with my windows system, so I installed wampserver package as an easy way to get apache, mysql and php running in my windows xp system.

After the normal newbie counter-times, that I will explain in fore coming articles, and several weeks of hard work, I had a beta version of the backend running in my computer. It was time to deploy my work.

I used the straight-forward method of uploading all my project by hand via ftp, and every seemed to go well… except for one page. The web server was reporting an “unable to find the file …” exception, so I checked that the file existed, but, what to do next?

The problem was not so obvious for a long time windows developer. I had changed the case of a letter of one filename in an include php instruction. That was all, but it took me half an hour to find the problem, so today’s article is just a reminder for those of us that have always developed under Microsoft Windows systems:

Beware of the case-sensitive filenames!

Nowadays, most web servers are linux systems, which are case-sensitive, so remember to be very careful when writing filenames or you will encounter yourself following a “ghost-bug” for a while.

Comment » | tips

Back to top