cakephp/cakephp — pull request #3381 by planardothum (2014-04-23 17:03:32+00:00)
Title: Add check to abort if $argv is undefined.

My shell worked great locally when invoked with `path/app/Console/cake shell arg`. When I tried to start it from a cron job on the server, it took the server down by creating an enormous error_log file.

```
PHP Notice: Undefined variable: argv in path/app/Console/cake.php on line 35
PHP Warning: array_search() expects parameter 2 to be array, null given in path/lib/Cake/Console/ShellDispatcher.php on line 327
... (ad inifinitum)
```

This doesn't fix the issue but at least prevents the runaway process and exits with an informative error message. The solution for me was to invoke cake.php directly with `php-cli`.