O'Reilly logo

CakePHP 2 Application Cookbook by Jorge González, James Watts

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Console API

CakePHP provides a rich console API to let you create and reuse specific project tasks that are more suited to being executed in a console environment. Keep in mind that when running commands from shell, you're not restricted by the same limitations the web server typically puts on server resources such as memory use and execution time. You can also have a less restrictive PHP configuration for your CLI environment, allow additional PHP extensions, and do more.

In this recipe, we'll create a new console shell and task to explore some of the features of the console shell API. Note that we'll be using a shell named PdfShell as an example, but no real PDF generation will happen.

How to do it...

Perform the following steps:

  1. First, update

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required