Shell(s) in CakePHP

Shell is the word which can give you nightmare in the sleeps in our programming world, where we are very fond of using GUI. But let me tell you one thing it is not true in the CakePHP world. CakePHP gives you very healthy support in terms of Shell for creating new CakePHP project.

We can build new CakePHP application using Command line Interface (CLI), which makes interfacing with our application easier, faster and smoother. In this article I will cover four main sections of shell scripting in the CakePHP.

Setting Environment variable for application.

Creating an application using shell scripts.

Styling Output in console.

Creating Tasks within shell scripts.

1. Setting up environment variable

Before starting with the below mentioned steps to setup environment variable, please make sure that your tmp directory in app is writable.

1

sudo gedit/etc/environment.

1) When you write above command in the console it will open a file with the content similar to below for CakePHP bake environment settings.