-
Notifications
You must be signed in to change notification settings - Fork 337
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
1,164 additions
and
142 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/** | ||
* FatalError.h | ||
* | ||
* | ||
* Normally, fatal errors are reported with a call to zend_error(). | ||
* | ||
* However, this will trigger a longjmp(), which will cause objects | ||
* constructed in the extension not to be destructed. We use therefore | ||
* this FatalError class, which is a normally exception that _does_ | ||
* cause objects to be destructed. | ||
* | ||
* When it is caught, right before control is handed back to the Zend | ||
* engine, it will turn the exception into a zend_error() call and | ||
* thus a longjmp. | ||
* | ||
* @author Emiel Bruijntjes <[email protected]> | ||
* @copyright 2014 Copernica BV | ||
*/ | ||
|
||
/** | ||
* Set up namespace | ||
*/ | ||
namespace Php { | ||
|
||
/** | ||
* Class definition | ||
*/ | ||
class FatalError : public Exception | ||
{ | ||
public: | ||
/** | ||
* Constructor | ||
* @param message | ||
*/ | ||
FatalError(const std::string &message) : Exception(message) {} | ||
|
||
/** | ||
* Destructor | ||
*/ | ||
virtual ~FatalError() throw() | ||
{ | ||
} | ||
|
||
/** | ||
* Is this a native exception (one that was thrown from C++ code) | ||
* @return bool | ||
*/ | ||
virtual bool native() const | ||
{ | ||
// although it is native, we return 0 because it should not persist | ||
// as exception, but it should live on as zend_error() in stead | ||
return false; | ||
} | ||
|
||
/** | ||
* Report this error as a fatal error | ||
* @return bool | ||
*/ | ||
virtual bool report() const override; | ||
}; | ||
|
||
/** | ||
* End of namespace | ||
*/ | ||
} | ||
|
Oops, something went wrong.