I'm only a junior developer but my job forces me to work with really terrible PHP code (think about the worst PHP code you've seen; then think about code twice as bad). I usually try to fix bugs and fight with the codebase to add new features. Sometimes I'm ordered to get things working ASAP which more often than not involves dirty hacks.

The product was previously open source and I am concerned that it might go open-source in the future. I would be ashamed if someone (especially potential employers) could find my name next some of the changesets. What can I do to protect my good name? 

I am not sure if this is relevant but I'll add that neither my boss nor my colleagues want to admit that the code is bad, but I'm not sure I can blame them for that -- for many of them this is their first job.

Rome wasn't built in a day, but you can be a good 'Boy Scout'.  Every time you touch the code, leave it better than it was before.  It doesn't take an extraordinary amount of time to use sensible function names, good coding standards and put decent comments in when you work.

I think the danger is thinking it's all or nothing.  Just because you can't spend the time you want to write elegant code, doesn't mean you have to totally give up and write garbage.
