00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "onphp.h"
00013
00014 #include "zend_exceptions.h"
00015
00016 #include "core/Exceptions.h"
00017
00018 #if (PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION < 2)
00019 #define onphp_ce_Exception zend_exception_get_default()
00020 #else
00021 #define onphp_ce_Exception zend_exception_get_default(TSRMLS_C)
00022 #endif
00023
00024 PHP_MINIT_FUNCTION(Exceptions)
00025 {
00026 REGISTER_ONPHP_CUSTOM_SUB_CLASS_EX(BusinessLogicException, Exception, NULL, NULL);
00027 REGISTER_ONPHP_CUSTOM_SUB_CLASS_EX(UnimplementedFeatureException, Exception, NULL, NULL);
00028 REGISTER_ONPHP_CUSTOM_SUB_CLASS_EX(BaseException, Exception, NULL, NULL);
00029
00030 REGISTER_ONPHP_CUSTOM_SUB_CLASS_EX(ClassNotFoundException, BaseException, NULL, NULL);
00031 onphp_ce_ClassNotFoundException->ce_flags |= ZEND_ACC_FINAL_CLASS;
00032
00033 REGISTER_ONPHP_CUSTOM_SUB_CLASS_EX(FileNotFoundException, BaseException, NULL, NULL);
00034 REGISTER_ONPHP_CUSTOM_SUB_CLASS_EX(IOException, BaseException, NULL, NULL);
00035 REGISTER_ONPHP_CUSTOM_SUB_CLASS_EX(MissingElementException, BaseException, NULL, NULL);
00036 REGISTER_ONPHP_CUSTOM_SUB_CLASS_EX(NetworkException, BaseException, NULL, NULL);
00037 REGISTER_ONPHP_CUSTOM_SUB_CLASS_EX(UnsupportedMethodException, BaseException, NULL, NULL);
00038 REGISTER_ONPHP_CUSTOM_SUB_CLASS_EX(WrongArgumentException, BaseException, NULL, NULL);
00039 REGISTER_ONPHP_CUSTOM_SUB_CLASS_EX(WrongStateException, BaseException, NULL, NULL);
00040 REGISTER_ONPHP_CUSTOM_SUB_CLASS_EX(DatabaseException, BaseException, NULL, NULL);
00041
00042 REGISTER_ONPHP_CUSTOM_SUB_CLASS_EX(DuplicateObjectException, DatabaseException, NULL, NULL);
00043 REGISTER_ONPHP_CUSTOM_SUB_CLASS_EX(ObjectNotFoundException, DatabaseException, NULL, NULL);
00044 REGISTER_ONPHP_CUSTOM_SUB_CLASS_EX(TooManyRowsException, DatabaseException, NULL, NULL);
00045
00046 REGISTER_ONPHP_CUSTOM_SUB_CLASS_EX(NetworkException, IOException, NULL, NULL);
00047 REGISTER_ONPHP_CUSTOM_SUB_CLASS_EX(IOTimedOutException, IOException, NULL, NULL);
00048
00049 return SUCCESS;
00050 }