Kevin DeCapite | Quality Website Construction Since 1998

CakePHP Image Version Component Update

I found a great image component and helper in the bakery here (Tom Maiaroto (tom_m) is the original author):

http://bakery.cakephp.org/articles/view/image-version-component

However, I noticed that it didn’t work on my Windows development server (running WAMP). I went through the component code and made a few minor changes. I also documented everything as best I could. Basically, there were some issues due to how Windows specifies file system paths vs. Unix/Linus (using the whack ‘\’ instead of the slash ‘/’). This component now accounts for this and can be deployed on either operating system without a problem. I’m only including the component file in this post since I didn’t touch the helper file at all. Please reference the original post in the Bakery article linked to above.

Link opens in a new window. Save as image_version.php and place in /app/controllers/components directory.

image_version.txt

2 Responses to “ CakePHP Image Version Component Update ”

  1. Tom says:

    Thank you for updating this! I didn’t realize that I forgot about the IIS users. Oops.

  2. Kevin says:

    Np. Actually I’m running Apache (via WAMP), but since it’s a Windows box the whack vs. slash issue was still there. Thanks for the component!

Leave a Reply