+ /*
+ * Would be great to only have a few exceptions and rather more identifying
+ * error codes, but zend_replace_error_handling() does not accept any codes.
+ */
+
+ memset(&ce, 0, sizeof(ce));
+ INIT_NS_CLASS_ENTRY(ce, "http\\Exception", "RuntimeException", NULL);
+ cep = zend_register_internal_class_ex(&ce, spl_ce_RuntimeException, NULL TSRMLS_CC);
+ zend_class_implements(cep TSRMLS_CC, 1, php_http_exception_interface_class_entry);
+ php_http_exception_runtime_class_entry = cep;
+
+ memset(&ce, 0, sizeof(ce));
+ INIT_NS_CLASS_ENTRY(ce, "http\\Exception", "UnexpectedValueException", NULL);
+ cep = zend_register_internal_class_ex(&ce, spl_ce_UnexpectedValueException, NULL TSRMLS_CC);
+ zend_class_implements(cep TSRMLS_CC, 1, php_http_exception_interface_class_entry);
+ php_http_exception_unexpected_val_class_entry = cep;
+
+ memset(&ce, 0, sizeof(ce));
+ INIT_NS_CLASS_ENTRY(ce, "http\\Exception", "BadMethodCallException", NULL);
+ cep = zend_register_internal_class_ex(&ce, spl_ce_BadMethodCallException, NULL TSRMLS_CC);
+ zend_class_implements(cep TSRMLS_CC, 1, php_http_exception_interface_class_entry);
+ php_http_exception_bad_method_call_class_entry = cep;
+
+ memset(&ce, 0, sizeof(ce));
+ INIT_NS_CLASS_ENTRY(ce, "http\\Exception", "InvalidArgumentException", NULL);
+ cep = zend_register_internal_class_ex(&ce, spl_ce_InvalidArgumentException, NULL TSRMLS_CC);
+ zend_class_implements(cep TSRMLS_CC, 1, php_http_exception_interface_class_entry);
+ php_http_exception_invalid_arg_class_entry = cep;
+
+ memset(&ce, 0, sizeof(ce));
+ INIT_NS_CLASS_ENTRY(ce, "http\\Exception", "BadHeaderException", NULL);
+ cep = zend_register_internal_class_ex(&ce, spl_ce_DomainException, NULL TSRMLS_CC);
+ zend_class_implements(cep TSRMLS_CC, 1, php_http_exception_interface_class_entry);
+ php_http_exception_bad_header_class_entry = cep;
+
+ memset(&ce, 0, sizeof(ce));
+ INIT_NS_CLASS_ENTRY(ce, "http\\Exception", "BadUrlException", NULL);
+ cep = zend_register_internal_class_ex(&ce, spl_ce_DomainException, NULL TSRMLS_CC);
+ zend_class_implements(cep TSRMLS_CC, 1, php_http_exception_interface_class_entry);
+ php_http_exception_bad_url_class_entry = cep;
+
+ memset(&ce, 0, sizeof(ce));
+ INIT_NS_CLASS_ENTRY(ce, "http\\Exception", "BadMessageException", NULL);
+ cep = zend_register_internal_class_ex(&ce, spl_ce_DomainException, NULL TSRMLS_CC);
+ zend_class_implements(cep TSRMLS_CC, 1, php_http_exception_interface_class_entry);
+ php_http_exception_bad_message_class_entry = cep;
+
+ memset(&ce, 0, sizeof(ce));
+ INIT_NS_CLASS_ENTRY(ce, "http\\Exception", "BadConversionException", NULL);
+ cep = zend_register_internal_class_ex(&ce, spl_ce_DomainException, NULL TSRMLS_CC);
+ zend_class_implements(cep TSRMLS_CC, 1, php_http_exception_interface_class_entry);
+ php_http_exception_bad_conversion_class_entry = cep;
+
+ memset(&ce, 0, sizeof(ce));
+ INIT_NS_CLASS_ENTRY(ce, "http\\Exception", "BadQueryStringException", NULL);
+ cep = zend_register_internal_class_ex(&ce, spl_ce_DomainException, NULL TSRMLS_CC);
+ zend_class_implements(cep TSRMLS_CC, 1, php_http_exception_interface_class_entry);
+ php_http_exception_bad_querystring_class_entry = cep;
+