But did it bring the organization more revenue? In the past I've done some things in PHP that were horrible hacks but did help the whole company forward. Doing them right in the existing code base would mean rewriting a lot. Especially one of those hacks has gotten it's revenge on me when making it more flexible later, but in the meantime it did bring us substantial rewards.
To this day i'm still not sure what would be better: telling my boss "sorry, but if we want feature y, it will take 2 months (but it will we done right)" or "yes we can do that in 2 days but don't expect the code to be pretty"