This recipe shows how to parse comma-separated values (CSV) files using a datasource, showing a clean approach to CSV processing.
We start by installing CakePHP's datasources plugin. Download the latest release from http://github.com/mariano/datasources/downloads and uncompress the downloaded file into your
app/plugins folder. You should now have a directory named
The datasources plugin, located at http://github.com/cakephp/datasources, is an official CakePHP plugin that offers several community-provided datasources, such as XML-RPC and SOAP. This and other recipes use a customized version of the plugin, modified for the purpose of this book.
We need some sample data ...