Monthly Archives: October 2012

[SOLVED] Symfony2 Install Problem With Git On Windows XP

I ran across a nasty problem installing Symfony2 on Windows XP SP2. Symfony2 uses git and Composer to create new projects and manage dependencies. This is awesome – when it works. Unfortunately, I setup msysgit incorrectly by selecting the wrong install option.

msysgit install options

See that big nasty warning message in the third option? That scared me enough that I went with option 2. That was a mistake, because when I tried to run Composer’s install command, I ran into this error:

php composer.phar create-project symfony/framework-standard-edition path/ 2.1.2 Failed to clone http://github.com/fabpot/Twig.git, git was not found, check that it is installed and in your PATH env. 

Which is weird because when I run git from the command line, I get a list of options.

The problem is in the Windows PATH variable. Option 2 installs “C:\Program Files\Git\cmd” into the PATH, not “C:\Program Files\Git\bin” like option 3.

Solution: Aside from re-installing msysgit and selecting option 3, just add “C:\Program Files\Git\bin” to the end of your path, close and re-open the command window, and try again.

References:

Capturing Enter KeyPress Event With jQuery

One of my most popular articles at my personal site, http://ne0phyte.com, is an article I wrote a few years back on how to capture the “Enter” key using JavaScript. I was really into the script.aculo.us and Prototype JavaScript libraries back in those days. Since then, I have become quite a fan of jQuery. So I thought I would post an update on how to do the  same with jQuery.

Make sure you include the jQuery library:

<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.min.js"></script>

The HTML:

<input type="text" id="text_field_1" value="" />

The JavaScript:

$('#text_field_1').keypress(function(e) {
if (e.which == 13) {
alert('The enter key was pressed!');
}
});

Yes, it really is that simple. Try it out and let me know if I missed something.