Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Fix calling View\Helper\BasePath from CLI results in fatal error. #5161

Closed

Conversation

Thinkscape
Copy link
Member

Using

echo $this->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).

@Thinkscape
Copy link
Member Author

bump

Merge or discuss it please.

@weierophinney
Copy link
Member

bump

Merge or discuss it please.

There is no reason for comments like this; there is nothing that makes any individual PR more important than the others in the queue.

weierophinney added a commit that referenced this pull request Oct 23, 2013
Fix calling View\Helper\BasePath from CLI results in fatal error.
weierophinney added a commit that referenced this pull request Oct 23, 2013
- we do not typically declare member variables inside test cases
- restored space for operator alignment
weierophinney added a commit that referenced this pull request Oct 23, 2013
@ghost ghost assigned weierophinney Oct 23, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants