zendframework/zf2 — pull request #5161 by Thinkscape (2013-09-23 10:29:57+00:00)
Title: Fix calling View\Helper\BasePath from CLI results in fatal error.

Using
````basePath();
````

in view script when compiling views in CLI (with `Console\Request`) results in a fatal error:
> Fatal error: Call to undefined method Zend\Console\Request::getBasePath() in project/vendor/zendframework/zendframework/library/Zend/Mvc/Service/ViewHelperManagerFactory.php on line 86

I've fixed it so it'll construct the helper correctly, but using basePath() it in CLI will still throw a (catchable) exception. At least it's something that can be handled in userland, as opposed to PHP fatal error, though I welcome any suggestions on what else could we do with missing basePaths in such case.

Personally, I'm using view scripts to generate email bodies (in cli worker for example).