I’m always surprised when I open my Feed reader and over and over again I stumble upon another report saying that some website store users passwords in plain text and that those passwords got exposed.
Now, why do you need to store those passwords in plain text?
Just hash them in the database and when some user tries to login into your site, hash the password that he gave you and try to match it with the one that is stored in database.
Now if someone cracks your database security the users will not be harmed because they don’t get access to theirs passwords (at least in plain text)!
If you want to add an extra protection, append a “salt” string to the users password and hash the new string all together. (This is how it’s done in symfony sfGuardPlugin http://trac.symfony-project.org/browser/plugins/sfGuardPlugin/lib/model/sfGuardUser.php?rev=3980#L31)
Since I’ve made a Fresh Ubuntu install in my laptop, now I’ve to setup the environment so I can do some working in the laptop
The company that I’m working now only uses PHP, so the production IDE that I use is Eclipse PDT. The great thing about Eclipse, is it’s huge plugin repository, and the one that’ll be talking here is the Subclipse.
Subeclipse is on 1.4.7 version and it’s a great SVN plugin (the only one I know ;)).
This installation instructions are based on Download and Install with the difference that here I’ll be showing Subclipse installation process for Eclipse 3.4 (Ganymede) and screens were captured in Eclipse 3.4.0 running on Ubuntu 8.10.
Begin the installation from the Eclipse Help menu item.
This screen will vary depending on the features you have installed already. You want to click on the New Remote Site button. If you are behind a proxy and the Eclipse install mechanism does not work, then you can download a zipped version of the update site and then click the New Local Site button instead.
This screen is showing the Add Site dialog, filled in with the correct information to install Subclipse 1.4.7 (url: http://subclipse.tigris.org/update_1.4.x)
When you first come back to this screen, the site you added will NOT be selected. Be sure to select it before clicking Next.
This next screen shows all of the features that are available to install.
Click the button to accept the license agreement.
Eclipse needs to be restarted after installing Subclipse.
Finally, after restarting Eclipse, you can do Import and checkout a Project from SVN
I’m working in a project that uses a lot of symfony tasks to migrate an ancient database to a new one.
Due to some PHP garbage collection issues, we had to do some tricks so the script would run completely . This was done, using a bash script that was responsible to call symfony tasks one at a time, avoiding memory leaking from PHP.
for TASK in “$@”
Here I’ve put the project path location (variable “path”), the php location (variable “php”) and the symfony script location path (variable symfony). I’ve also created an function that is responsible to run a symfony task called “runtask()”.
Now If I wanted to run the symfony task’s “migratePhotos” and “migrateComments” I would create an script like this: