Jason Leveille’s Blog

Beauty’s where you find it

Archive for the ‘CakePHP’ Category

I recently finished my first CakePHP application.  Not only was the application the largest I have ever written, but I had never worked with CakePHP before.  So, needless to say, not only did I have to overcome a learning curve, but I had to deal with all that comes with writing a large application.  Today I was contacted by the project manager regarding a bug which had surfaced in the application.  In my quest to squash the bug I discovered a script which was causing a section of the administrator to act very sluggish.  In examining exactly what was going on, I realized that there were 200+ calls being made to the database.  Ok.  That’s bad.  I’d like to clarify that I was the one who wrote the original offending code.  In about 2 minutes of work I was able to bring the query count down to 2, and reduce the page response time considerably. (more…)

  • 0 Comments
  • Filed under: CakePHP
  • What’s up with CakePHP?

    I’ve had my focus in a lot of other areas for a few weeks, and in that time is seems like quite a bit has happened on the CakePHP front. It seems that there has been a subtle shift in how the framework will evolve from here forward. gwoo puts it much better than I can in his recent bakery article, “After 3 years, looking back and moving ahead“. In the grand scheme of things there are much more interesting things between the lines of what gwoo has written, however the thing that got me most excited was located at the very end:

    Stay tuned for more new developments and expect the next 1.2 release in the coming weeks.

  • 0 Comments
  • Filed under: CakePHP, PHP
  • Permanent Redirects and CakePHP

    I recently had the need to set up some permanent redirects for an application built on CakePHP. My first thought was to use a simple .htaccess Redirect at the top of my www .htaccess file, like such:

    Redirect 301 /foo /bar

    However, the result of the redirect was actually the following url:

    http://foobar.com/bar?url=foo

    This has to do with the QSA flag in the last RewriteRule of the root htaccess file. The QSA flag indicates that a query string should be appended to the url. In our case, foo is recognized as the query string and it ultimately is appended at the end of the bar redirect. Not what I wanted, as the appending of foo to bar results in a 404 error. (more…)

  • 0 Comments
  • Filed under: CakePHP, htaccess