Using Yeoman with PHP
This is a simple workaround to use yeoman with PHP projects. For this I assume that you have a basic knowledge of yeoman and already setup yeoman, grunt, node, bower and php.For this tutorial I usedYeoman 1.0.0-beta.3Ubuntu 11.04php-cgi 5.3.5-1Initiate yeoman webappFor this tutorial I started with initialize a new project with yeoman webapp generator, which is shipped along with yeoman.To start with a fresh project, create a directory named yeoman-php and cd into it. Now boilerplate the webapp with yeoman. After that install the npm packages and bower components. You can check whether everything works fine by running grunt.mkdir yeoman-php & cd yeoman-phpyo webappnpm installbower installgrunt serverOk! Now we need to customize the project in order to execute php file.Installing PHP-CGIIn order to work this, You need to install php-cgi in your machine. If you are using ubuntu you can use the following commandsudo apt-get install php5-cgiExecute CGI scripts To execute the php scripts we use gateway package as the connect middleware. Thanks to fgnass for creating the package. You need to install this node package and add the same to your package.json file.npm install gateway --save-dev The above command will install the package and add the same into package.json (devDependencies).Using custom middlewareIn order to use the custom middleware we need to update the Gruntfile. Add the below code to top of your Gruntfile.js.var gateway = require(
blog.revathskumar.com