Skip to content

Restructure JErrorPage to support PHP 7 exceptions#7065

Merged
wilsonge merged 1 commit intojoomla:3.5-devfrom
mbabker:PHP7ErrorPage
May 30, 2015
Merged

Restructure JErrorPage to support PHP 7 exceptions#7065
wilsonge merged 1 commit intojoomla:3.5-devfrom
mbabker:PHP7ErrorPage

Conversation

@mbabker
Copy link
Copy Markdown
Contributor

@mbabker mbabker commented May 30, 2015

This PR restructures JErrorPage, the class that is used as our global Exception handler, to support PHP 7. Specific changes:

  • Remove the typehinting for the render method
  • Test internal to the method for an Exception (PHP 5) or BaseException (PHP 7)
  • Add support to JDocumentError for the same
  • Wrap jexit in a function_exists check so that it can be mocked in our PHPUnit suite
  • Add unit tests to verify the PHP 7 behavior and the method's functionality when a non-Exception object is passed in

//cc @wilsonge

@dgrammatiko
Copy link
Copy Markdown
Contributor

@test OK

forced error on /Users/dimitris/Documents/github_projects/joomla1/administrator/components/com_content/views/article/view.html.php
with code:
JError::raiseError(500, implode("\n", array('1' => 'some error'))); return false;
result:
screenshot 2015-05-30 17 24 00

@wilsonge
Copy link
Copy Markdown
Contributor

@test works fine. Merged. Thanks!

wilsonge added a commit that referenced this pull request May 30, 2015
Restructure JErrorPage to support PHP 7 exceptions
@wilsonge wilsonge merged commit 1017801 into joomla:3.5-dev May 30, 2015
@wilsonge wilsonge added this to the Joomla! 3.5.0 milestone May 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants