I’ve been using cakephp for a local information management project.
I’ve decided to use version 3 for my little e-commerce project but i have several questions regarding deployment to our hosting platform.
In version 2, it was easy to develop in local and deploy to live server.
Right now with version 3 it’s a little complicated with composer activities and so on.
What is the recommended way of working on cakephp for local development and deployment to live server ?
I’ve read several articles about it, but i am interested in the security perspective and don’t do’s.
Is it safe to upload my local development copy to a live server ?
I am continuously updating my dependacy libraries/plugins via composer, is it safe to upload composer modifications ?
You may try with capcake using capistrano
What I do with simple pages (e.g. < 10 controllers/tables) is set up a clone repo in the server, and install with composer using composer install --no-dev -o configure the app.php (set debug to false) and done!
Actually composer helps you in safe deploying. My strategy is the following.
I have my development enviroment where I regularly run composer update to get the latest versions of cake and libraries.
I use github for version control. So when I am working on a bugfix or on a new feature I push my changes there.
I added /vendor, /tmp, /logs to my .gitignore file as I do not want them in version control.
When I want to deploy I just pull my code from github and use the composer --nodev install command to get my code and all the used libraries to the production server.
Now, there is a problem. CakePHP will throw error as it won’t generate cache and logs folder. These folders are generated when request hits Cake app with debug level != 0.
How do I solve that? I don’t want to change debug level to non-zero on my production machine.