This repository has been archived by the owner on Jan 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[Soap/Server] add debug mode #5792
Merged
weierophinney
merged 4 commits into
zendframework:develop
from
lilobase:SoapServerDebugMode
Mar 4, 2014
Merged
[Soap/Server] add debug mode #5792
weierophinney
merged 4 commits into
zendframework:develop
from
lilobase:SoapServerDebugMode
Mar 4, 2014
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -926,6 +932,15 @@ protected function _initializeSoapErrorContext() | |||
} | |||
|
|||
/** | |||
* Set the debug mode. | |||
* In debug mode, all exceptions are send to the client. | |||
* @param boolean $debug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use bool
instead of boolean
for consistency
All right, fixed ! |
👍 |
@@ -961,6 +976,8 @@ public function registerFaultException($class) | |||
*/ | |||
public function isRegisteredAsFaultException($fault) | |||
{ | |||
if ($this->debug) return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one more thing, add open {
after if ($this->debug)
, so it should be :
if ($this->debug) {
return true;
}
done :) |
public function setDebugMode($debug = true) | ||
{ | ||
$this->debug = $debug; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setters in this class follows fluent interface so please, follow the same pattern,
Changes are committed, UT are updated |
weierophinney
added a commit
that referenced
this pull request
Mar 4, 2014
[Soap/Server] add debug mode
weierophinney
added a commit
that referenced
this pull request
Mar 4, 2014
weierophinney
added a commit
to zendframework/zend-soap
that referenced
this pull request
May 15, 2015
…pServerDebugMode [Soap/Server] add debug mode
weierophinney
added a commit
to zendframework/zend-soap
that referenced
this pull request
May 15, 2015
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When an exception is raised the \Zend\Soap\Server catch it and check if this is an authorized exception.
If not, and for security reason, it send an "Unknow error" message.
And if in production its a sane behaviour, its really annoying during development & tests process.
So I propose to add a setDebugMode method, when activated, send all exceptions to the client.
The code is unit-tested.