White Screen on CakePHP

One day I’ve worked on a project on my desktop for hours, but I wasn’t able to finish a important part. I saved the changes and uploaded to git, to work and finish the task later on my notebook… When I got to my destiny and opened the project, I was only seeing a white screen on Chrome. Looking at logs, no error was registered, and the white screen was there.

Continue reading “White Screen on CakePHP”

Security on CakePHP

One issue that involves security on CakePHP 2 is the configuration of those keys that they call salt and cipherSeed… The code below can be used to generate those keys:

This code can be executed on terminal.

Source: https://gist.github.com/930914

File Upload on CakePHP

I have a file manager written on PHP and I’m transfering all it’s logic to CakePHP 2.1, making it object oriented…

Yesterday I was working with the file upload section, that gets the file from the client and saves on the server, including saving some details of the file on the database. The difficult part was doing that using the CakePHP resources, because I didn’t knew them yet.

Example 1: I usually develop on Linux, that uses / for paths, but yesterday I was on Windows, that uses \. How to treat that??

Example 2: I was using PHP functions to create the directories (mkdir), remove directories (rmdir) and do the upload (move_uploaded_file). How to do that on CakePHP??

Continue reading “File Upload on CakePHP”