1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/eduosi-buession

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
exception.c 24 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
yong.teng Отправлено 16.11.2013 18:33 6cd4eea
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2011 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| License: http://www.buession.com.cn/license |
| Author: Teng Yong <webmaster@buession.com> |
+----------------------------------------------------------------------+
*/
/* $Id: exception.c 310447 2012-04-10 21:32:51Z Teng Yong $ */
/* include php file */
#include "Zend/zend.h"
#include "Zend/zend_API.h"
#include "Zend/zend_builtin_functions.h"
#include "Zend/zend_exceptions.h"
#include "main/php.h"
#include "main/php_main.h"
#include "ext/spl/spl_exceptions.h"
/* include buession file */
#include "buession.h"
#include "exception.h"
zend_class_entry *exception_ce;
zend_class_entry *parseexception_ce;
zend_class_entry *invalidexception_ce;
zend_class_entry *illegalexception_ce;
zend_class_entry *indexoutofboundsexception_ce;
zend_class_entry *nullpointerexception_ce;
zend_class_entry *runtimeexception_ce;
zend_class_entry *outofmemoryexception_ce;
zend_class_entry *ioexception_ce;
zend_class_entry *unsupportedoperationexception_ce;
zend_class_entry *classnotfoundexception_ce;
zend_class_entry *clonenotsupportedexception_ce;
zend_class_entry *invalidpropertyexception_ce;
zend_class_entry *illegalargumentexception_ce;
zend_class_entry *nosuchmethodexception_ce;
/* {{{ arginfo */
ZEND_BEGIN_ARG_INFO_EX(exception___construct_arguments, FALSE, FALSE, 0)
ZEND_ARG_INFO(FALSE, message)
ZEND_ARG_INFO(FALSE, code)
ZEND_ARG_OBJ_INFO(FALSE, previous, Exception, TRUE)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(parseexception___construct_arguments, FALSE, FALSE, 0)
ZEND_ARG_INFO(FALSE, message)
ZEND_ARG_INFO(FALSE, code)
ZEND_ARG_OBJ_INFO(FALSE, previous, Exception, TRUE)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(invalidexception___construct_arguments, FALSE, FALSE, 0)
ZEND_ARG_INFO(FALSE, message)
ZEND_ARG_INFO(FALSE, code)
ZEND_ARG_OBJ_INFO(FALSE, previous, Exception, TRUE)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(illegalexception___construct_arguments, FALSE, FALSE, 0)
ZEND_ARG_INFO(FALSE, message)
ZEND_ARG_INFO(FALSE, code)
ZEND_ARG_OBJ_INFO(FALSE, previous, Exception, TRUE)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(indexoutofboundsexception__construct_arguments, FALSE, FALSE, 0)
ZEND_ARG_INFO(FALSE, message)
ZEND_ARG_INFO(FALSE, code)
ZEND_ARG_OBJ_INFO(FALSE, previous, Exception, TRUE)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(nullpointerexception___construct_arguments, FALSE, FALSE, 0)
ZEND_ARG_INFO(FALSE, message)
ZEND_ARG_INFO(FALSE, code)
ZEND_ARG_OBJ_INFO(FALSE, previous, Exception, TRUE)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(runtimeexception___construct_arguments, FALSE, FALSE, 0)
ZEND_ARG_INFO(FALSE, message)
ZEND_ARG_INFO(FALSE, code)
ZEND_ARG_OBJ_INFO(0, previous, Exception, TRUE)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(outofmemoryexception___construct_arguments, FALSE, FALSE, 0)
ZEND_ARG_INFO(FALSE, message)
ZEND_ARG_INFO(FALSE, code)
ZEND_ARG_OBJ_INFO(0, previous, Exception, TRUE)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(ioexception___construct_arguments, FALSE, FALSE, 0)
ZEND_ARG_INFO(FALSE, message)
ZEND_ARG_INFO(FALSE, code)
ZEND_ARG_OBJ_INFO(FALSE, previous, Exception, TRUE)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(unsupportedoperationexception___construct_arguments, FALSE, FALSE, 0)
ZEND_ARG_INFO(FALSE, message)
ZEND_ARG_INFO(FALSE, code)
ZEND_ARG_OBJ_INFO(FALSE, previous, Exception, TRUE)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(classnotfoundexception___construct_arguments, FALSE, FALSE, 0)
ZEND_ARG_INFO(FALSE, message)
ZEND_ARG_INFO(FALSE, code)
ZEND_ARG_OBJ_INFO(FALSE, previous, Exception, TRUE)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(clonenotsupportedexception___construct_arguments, FALSE, FALSE, 0)
ZEND_ARG_INFO(FALSE, message)
ZEND_ARG_INFO(FALSE, code)
ZEND_ARG_OBJ_INFO(FALSE, previous, Exception, TRUE)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(invalidpropertyexception___construct_arguments, FALSE, FALSE, 0)
ZEND_ARG_INFO(FALSE, message)
ZEND_ARG_INFO(FALSE, code)
ZEND_ARG_OBJ_INFO(FALSE, previous, Exception, TRUE)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(illegalargumentexception___construct_arguments, FALSE, FALSE, 0)
ZEND_ARG_INFO(FALSE, message)
ZEND_ARG_INFO(FALSE, code)
ZEND_ARG_OBJ_INFO(FALSE, previous, Exception, TRUE)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(nosuchmethodexception___construct_arguments, FALSE, FALSE, 0)
ZEND_ARG_INFO(FALSE, message)
ZEND_ARG_INFO(FALSE, code)
ZEND_ARG_OBJ_INFO(FALSE, previous, Exception, TRUE)
ZEND_END_ARG_INFO()
/* }}} */
BUESSION_API zval *buession_throw_exception(zend_class_entry *exception_ce, int severity, char *message, uint message_length, long code){
zval *exception = NULL;
TSRMLS_FETCH();
if(instanceof_function(exception_ce, zend_exception_get_default(TSRMLS_C) TSRMLS_CC) == FALSE){
zval *pexception = buession_throw_exception_error(illegalexception_ce, E_ERROR, ZEND_STRL("Exceptions must be derived from the Exception base class."), 0);
zval_ptr_dtor(&pexception);
}
exception_throw_object_init(exception_ce, instance, severit, code, message, message_length);
zend_throw_exception_object(exception TSRMLS_CC);
return exception;
}
BUESSION_API zval *buession_throw_exception_ex(zend_class_entry *exception_ce, int severity, char *format, long code, ...){
va_list arg;
smart_str message = {0};
zval *exception = NULL;
TSRMLS_FETCH();
if(format != NULL){
char *_message = NULL;
uint _message_length = 0;
va_start(arg, code);
_message_length = vspprintf(&_message, 0, format, arg);
smart_str_appendl(&message, _message, _message_length);
buession_free(_message);
va_end(arg);
}
smart_str_0(&message);
exception = buession_throw_exception(exception_ce, severity, message.c, message.len, code);
smart_str_free(&message);
return exception;
}
BUESSION_API zval *buession_throw_exception_error(zend_class_entry *exception_ce, int severity, char *message, uint message_length, long code){
zval *exception = NULL;
TSRMLS_FETCH();
if(instanceof_function(exception_ce, zend_exception_get_default(TSRMLS_C) TSRMLS_CC) == FALSE){
zval *pexception = buession_throw_exception_error(illegalexception_ce, E_ERROR, ZEND_STRL("Exceptions must be derived from the Exception base class."), 0);
zval_ptr_dtor(&pexception);
}
exception_throw_object_init(exception_ce, instance, severit, code, message, message_length);
zend_exception_error(exception, severity TSRMLS_CC);
return exception;
}
BUESSION_API zval *buession_throw_exception_error_ex(zend_class_entry *exception_ce, int severity, char *format, long code, ...){
va_list arg;
smart_str message = {0};
zval *exception = NULL;
TSRMLS_FETCH();
if(format != NULL){
char *_message = NULL;
uint _message_length = 0;
va_start(arg, code);
_message_length = vspprintf(&_message, 0, format, arg);
smart_str_appendl(&message, _message, _message_length);
buession_free(_message);
va_end(arg);
}
smart_str_0(&message);
exception = buession_throw_exception_error(exception_ce, severity, message.c, message.len, code);
smart_str_free(&message);
return exception;
}
/* {{{ public void Exception::__construct([string $message = ""[, int $code = 0[, Exception $previous = NULL]]]) */
static BUESSION_METHOD(exception, __construct){
exception__construct(exception_ce, NULL, 0, 0);
}
/* }}} */
/* {{{ public void Exception::__destruct() */
static BUESSION_METHOD(exception, __destruct){
}
/* }}} */
/* {{{ public void ParseException::__construct([string $message = ""[, int $code = 0[, Exception $previous = NULL]]]) */
static BUESSION_METHOD(parseexception, __construct){
exception__construct(parseexception_ce, NULL, 0, 0);
}
/* }}} */
/* {{{ public void ParseException::__destruct() */
static BUESSION_METHOD(parseexception, __destruct){
}
/* }}} */
/* {{{ public void InvalidException::__construct([string $message = ""[, int $code = 0[, Exception $previous = NULL]]]) */
static BUESSION_METHOD(invalidexception, __construct){
exception__construct(invalidexception_ce, NULL, 0, 0);
}
/* }}} */
/* {{{ public void InvalidException::__destruct() */
static BUESSION_METHOD(invalidexception, __destruct){
}
/* }}} */
/* {{{ public void IllegalException::__construct([string $message = ""[, int $code = 0[, Exception $previous = NULL]]]) */
static BUESSION_METHOD(illegalexception, __construct){
exception__construct(illegalexception_ce, NULL, 0, 0);
}
/* }}} */
/* {{{ public void IllegalException::__destruct() */
static BUESSION_METHOD(illegalexception, __destruct){
}
/* }}} */
/* {{{ public void IndexOutOfBoundsException::__construct([string $message = ""[, int $code = 0[, Exception $previous = NULL]]]) */
static BUESSION_METHOD(indexoutofboundsexception, __construct){
exception__construct(indexoutofboundsexception_ce, NULL, 0, 0);
}
/* }}} */
/* {{{ public void IndexOutOfBoundsException::__destruct() */
static BUESSION_METHOD(indexoutofboundsexception, __destruct){
}
/* }}} */
/* {{{ public void NullPointerException::__construct([string $message = ""[, int $code = 0[, Exception $previous = NULL]]]) */
static BUESSION_METHOD(nullpointerexception, __construct){
exception__construct(nullpointerexception_ce, NULL, 0, 0);
}
/* }}} */
/* {{{ public void NullPointerException::__destruct() */
static BUESSION_METHOD(nullpointerexception, __destruct){
}
/* }}} */
/* {{{ public void RuntimeException::__construct([string $message = ""[, int $code = 0[, Exception $previous = NULL]]]) */
static BUESSION_METHOD(runtimeexception, __construct){
exception__construct(runtimeexception_ce, NULL, 0, 0);
}
/* }}} */
/* {{{ public void RuntimeException::__destruct() */
static BUESSION_METHOD(runtimeexception, __destruct){
}
/* }}} */
/* {{{ public void OutOfMemoryException::__construct([string $message = ""[, int $code = 0[, Exception $previous = NULL]]]) */
static BUESSION_METHOD(outofmemoryexception, __construct){
exception__construct(outofmemoryexception_ce, "out of memory", 13, 500);
}
/* }}} */
/* {{{ public void OutOfMemoryException::__destruct() */
static BUESSION_METHOD(outofmemoryexception, __destruct){
}
/* }}} */
/* {{{ public void IOException::__construct([string $message = ""[, int $code = 0[, Exception $previous = NULL]]]) */
static BUESSION_METHOD(ioexception, __construct){
exception__construct(ioexception_ce, NULL, 0, 500);
}
/* }}} */
/* {{{ public void IOException::__destruct() */
static BUESSION_METHOD(ioexception, __destruct){
}
/* }}} */
/* {{{ public void UnsupportedOperationException::__construct([string $message = ""[, int $code = 0[, Exception $previous = NULL]]]) */
static BUESSION_METHOD(unsupportedoperationexception, __construct){
exception__construct(unsupportedoperationexception_ce, NULL, 0, 500);
}
/* }}} */
/* {{{ public void UnsupportedOperationException::__destruct() */
static BUESSION_METHOD(unsupportedoperationexception, __destruct){
}
/* }}} */
/* {{{ public void ClassNotFoundException::__construct([string $message = ""[, int $code = 0[, Exception $previous = NULL]]]) */
static BUESSION_METHOD(classnotfoundexception, __construct){
char *message = NULL;
uint message_length = 0;
int code = 0;
zval *previous = NULL;
zend_class_entry *exception_ce = zend_exception_get_default(TSRMLS_C);
if(zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "|slO!", &message, &message_length, &code, &previous, exception_ce) == FAILURE){
exception__construct_argument_exception(classnotfoundexception_ce);
}
if(message == NULL){
zval traces;
zend_fetch_debug_backtrace(&traces, 1, 0 TSRMLS_CC);
if(Z_TYPE(traces) == IS_ARRAY){
zval **last_trace;
zval **classname = NULL;
if(zend_hash_index_find(Z_ARRVAL(traces), zend_hash_num_elements(Z_ARRVAL(traces)) - 1, (void **) &last_trace) == SUCCESS){
zend_hash_find(Z_ARRVAL_PP(last_trace), "class", 6, (void **) &classname);
}
if(classname == NULL){
goto default_message;
}else{
char *_message = NULL;
uint _message_length = spprintf(&_message, 0, "class '%s' no found", classname == NULL ? "" : Z_STRVAL_PP(classname));
if(_message){
exception_update_memsage_property(classnotfoundexception_ce, _message, _message_length);
buession_free(_message);
}
}
}else{
default_message:
exception_update_memsage_property(classnotfoundexception_ce, "class no found", sizeof("class no found") - 1);
}
}else{
if(message){
exception_update_memsage_property(classnotfoundexception_ce, message, message_length);
}
}
if(code){
zend_update_property_long(classnotfoundexception_ce, getThis(), ZEND_STRL(EXCEPTION_PROPERTY_CODE), code TSRMLS_CC);
}
if(previous){
zend_update_property(classnotfoundexception_ce, getThis(), ZEND_STRL(EXCEPTION_PROPERTY_PREVIOUS), previous TSRMLS_CC);
}
}
/* }}} */
/* {{{ public void ClassNotFoundException::__destruct() */
static BUESSION_METHOD(classnotfoundexception, __destruct){
}
/* }}} */
/* {{{ public void CloneNotSupportedException::__construct([string $message = ""[, int $code = 0[, Exception $previous = NULL]]]) */
static BUESSION_METHOD(clonenotsupportedexception, __construct){
exception__construct(clonenotsupportedexception_ce, NULL, 0, 0);
}
/* }}} */
/* {{{ public void CloneNotSupportedException::__destruct() */
static BUESSION_METHOD(clonenotsupportedexception, __destruct){
}
/* }}} */
/* {{{ public void InvalidPropertyException::__construct([string $message = ""[, int $code = 0[, Exception $previous = NULL]]]) */
static BUESSION_METHOD(invalidpropertyexception, __construct){
exception__construct(invalidpropertyexception_ce, NULL, 0, 0);
}
/* }}} */
/* {{{ public void InvalidPropertyException::__destruct() */
static BUESSION_METHOD(invalidpropertyexception, __destruct){
}
/* }}} */
/* {{{ public void IllegalArgumentException::__construct([string $message = ""[, int $code = 0[, Exception $previous = NULL]]]) */
static BUESSION_METHOD(illegalargumentexception, __construct){
exception__construct(illegalargumentexception_ce, NULL, 0, 0);
}
/* }}} */
/* {{{ public void IllegalArgumentException::__destruct() */
static BUESSION_METHOD(illegalargumentexception, __destruct){
}
/* }}} */
/* {{{ public void NoSuchMethodException::__construct([string $message = ""[, int $code = 0[, Exception $previous = NULL]]]) */
static BUESSION_METHOD(nosuchmethodexception, __construct){
char *message = NULL;
uint message_length = 0;
int code = 0;
zval *previous = NULL;
zend_class_entry *exception_ce = zend_exception_get_default(TSRMLS_C);
if(zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "|slO!", &message, &message_length, &code, &previous, exception_ce) == FAILURE){
exception__construct_argument_exception(nosuchmethodexception_ce);
}
if(message == NULL){
zval traces;
zend_fetch_debug_backtrace(&traces, 1, 0 TSRMLS_CC);
if(Z_TYPE(traces) == IS_ARRAY){
zval **last_trace;
zval **classname = NULL;
zval **method = NULL;
if(zend_hash_index_find(Z_ARRVAL(traces), zend_hash_num_elements(Z_ARRVAL(traces)) - 1, (void **) &last_trace) == SUCCESS){
zend_hash_find(Z_ARRVAL_PP(last_trace), "class", 6, (void **) &classname);
zend_hash_find(Z_ARRVAL_PP(last_trace), "function", 9, (void **) &method);
}
if(classname == NULL||method == NULL){
goto default_message;
}else{
char *_message = NULL;
uint _message_length = spprintf(&_message, 0, "class %s method %s no found", classname == NULL ? "" : Z_STRVAL_PP(classname), method == NULL ? "" : Z_STRVAL_PP(method));
if(_message){
exception_update_memsage_property(nosuchmethodexception_ce, _message, _message_length);
buession_free(_message);
}
}
}else{
default_message:
exception_update_memsage_property(nosuchmethodexception_ce, "class's method no found", sizeof("class's method no found") - 1);
}
}else{
if(message){
exception_update_memsage_property(nosuchmethodexception_ce, message, message_length);
}
}
if(code){
zend_update_property_long(nosuchmethodexception_ce, getThis(), ZEND_STRL(EXCEPTION_PROPERTY_CODE), code TSRMLS_CC);
}
if(previous){
zend_update_property(nosuchmethodexception_ce, getThis(), ZEND_STRL(EXCEPTION_PROPERTY_PREVIOUS), previous TSRMLS_CC);
}
}
/* }}} */
/* {{{ public void NoSuchMethodException::__destruct() */
static BUESSION_METHOD(nosuchmethodexception, __destruct){
}
/* }}} */
static zend_function_entry exception_methods[] = {
BUESSION_EXCEPTION_ME(__construct, exception___construct_arguments, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
BUESSION_EXCEPTION_ME(__destruct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_DTOR)
ZEND_FE_END
};
static zend_function_entry parseexception_methods[] = {
BUESSION_PARSREXCEPTION_ME(__construct, parseexception___construct_arguments, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
BUESSION_PARSREXCEPTION_ME(__destruct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_DTOR)
ZEND_FE_END
};
static zend_function_entry invalidexception_methods[] = {
BUESSION_INVALIDEXCEPTION_ME(__construct, invalidexception___construct_arguments, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
BUESSION_INVALIDEXCEPTION_ME(__destruct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_DTOR)
ZEND_FE_END
};
static zend_function_entry illegalexception_methods[] = {
BUESSION_ILLEGALEXCEPTION_ME(__construct, illegalexception___construct_arguments, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
BUESSION_ILLEGALEXCEPTION_ME(__destruct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_DTOR)
ZEND_FE_END
};
static zend_function_entry indexoutofboundsexception_methods[] = {
BUESSION_INDEXOUTOFBOUNDSEXCEPTION_ME(__construct, indexoutofboundsexception__construct_arguments, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
BUESSION_INDEXOUTOFBOUNDSEXCEPTION_ME(__destruct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_DTOR)
ZEND_FE_END
};
static zend_function_entry nullpointerexception_methods[] = {
BUESSION_NULLPOINTEREXCEPTION_ME(__construct, nullpointerexception___construct_arguments, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
BUESSION_NULLPOINTEREXCEPTION_ME(__destruct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_DTOR)
ZEND_FE_END
};
static zend_function_entry runtimeexception_methods[] = {
BUESSION_RUNTIMEEXCEPTION_ME(__construct, runtimeexception___construct_arguments, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
BUESSION_RUNTIMEEXCEPTION_ME(__destruct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_DTOR)
ZEND_FE_END
};
static zend_function_entry outofmemoryexception_methods[] = {
BUESSION_OUTOFMEMORYEXCEPTION_ME(__construct, outofmemoryexception___construct_arguments, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
BUESSION_OUTOFMEMORYEXCEPTION_ME(__destruct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_DTOR)
ZEND_FE_END
};
static zend_function_entry ioexception_methods[] = {
BUESSION_IOEXCEPTION_ME(__construct, ioexception___construct_arguments, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
BUESSION_IOEXCEPTION_ME(__destruct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_DTOR)
ZEND_FE_END
};
static zend_function_entry unsupportedoperationexception_methods[] = {
BUESSION_UNSUPPORTEDOPERATIONEXCEPTION_ME(__construct, unsupportedoperationexception___construct_arguments, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
BUESSION_UNSUPPORTEDOPERATIONEXCEPTION_ME(__destruct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_DTOR)
ZEND_FE_END
};
static zend_function_entry classnotfoundexception_methods[] = {
BUESSION_CLASSFOUNDEXCEPTION_ME(__construct, classnotfoundexception___construct_arguments, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
BUESSION_CLASSFOUNDEXCEPTION_ME(__destruct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_DTOR)
ZEND_FE_END
};
static zend_function_entry clonenotsupportedexception_methods[] = {
BUESSION_CLONENOTSUPPORTEDEXCEPTION_ME(__construct, clonenotsupportedexception___construct_arguments, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
BUESSION_CLONENOTSUPPORTEDEXCEPTION_ME(__destruct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_DTOR)
ZEND_FE_END
};
static zend_function_entry invalidpropertyexception_methods[] = {
BUESSION_INVALIDPROPERTYEXCEPTION_ME(__construct, invalidpropertyexception___construct_arguments, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
BUESSION_INVALIDPROPERTYEXCEPTION_ME(__destruct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_DTOR)
ZEND_FE_END
};
static zend_function_entry illegalargumentexception_methods[] = {
BUESSION_ILLEGALARGUMENTEXCEPTION_ME(__construct, illegalargumentexception___construct_arguments, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
BUESSION_ILLEGALARGUMENTEXCEPTION_ME(__destruct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_DTOR)
ZEND_FE_END
};
static zend_function_entry nosuchmethodexception_methods[] = {
BUESSION_NOSUCHMETHODEXCEPTION_ME(__construct, nosuchmethodexception___construct_arguments, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
BUESSION_NOSUCHMETHODEXCEPTION_ME(__destruct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_DTOR)
ZEND_FE_END
};
/** {{{ BUESSION_STARTUP_FUNCTION */
BUESSION_STARTUP_FUNCTION(exception){
zend_class_entry ce;
BUESSION_INIT_CLASS_ENTRY(ce, "Exception", exception_methods);
exception_ce = zend_register_internal_class_ex(&ce, zend_exception_get_default(TSRMLS_C), NULL TSRMLS_CC);
BUESSION_INIT_CLASS_ENTRY(ce, "ParseException", parseexception_methods);
parseexception_ce = zend_register_internal_class_ex(&ce, exception_ce, NULL TSRMLS_CC);
BUESSION_INIT_CLASS_ENTRY(ce, "InvalidException", invalidexception_methods);
invalidexception_ce = zend_register_internal_class_ex(&ce, exception_ce, NULL TSRMLS_CC);
BUESSION_INIT_CLASS_ENTRY(ce, "IllegalException", illegalexception_methods);
illegalexception_ce = zend_register_internal_class_ex(&ce, exception_ce, NULL TSRMLS_CC);
BUESSION_INIT_CLASS_ENTRY(ce, "IndexOutOfBoundsException", indexoutofboundsexception_methods);
indexoutofboundsexception_ce = zend_register_internal_class_ex(&ce, spl_ce_OutOfBoundsException, NULL TSRMLS_CC);
BUESSION_INIT_CLASS_ENTRY(ce, "NullPointerException", nullpointerexception_methods);
nullpointerexception_ce = zend_register_internal_class_ex(&ce, illegalexception_ce, NULL TSRMLS_CC);
BUESSION_INIT_CLASS_ENTRY(ce, "RuntimeException", runtimeexception_methods);
runtimeexception_ce = zend_register_internal_class_ex(&ce, spl_ce_RuntimeException, NULL TSRMLS_CC);
BUESSION_INIT_CLASS_ENTRY(ce, "OutOfMemoryException", outofmemoryexception_methods);
outofmemoryexception_ce = zend_register_internal_class_ex(&ce, exception_ce, NULL TSRMLS_CC);
BUESSION_INIT_CLASS_ENTRY(ce, "IOException", ioexception_methods);
ioexception_ce = zend_register_internal_class_ex(&ce, exception_ce, NULL TSRMLS_CC);
BUESSION_INIT_CLASS_ENTRY(ce, "UnsupportedOperationException", unsupportedoperationexception_methods);
unsupportedoperationexception_ce = zend_register_internal_class_ex(&ce, exception_ce, NULL TSRMLS_CC);
BUESSION_INIT_CLASS_ENTRY(ce, "ClassNotFoundException", classnotfoundexception_methods);
classnotfoundexception_ce = zend_register_internal_class_ex(&ce, exception_ce, NULL TSRMLS_CC);
BUESSION_INIT_CLASS_ENTRY(ce, "CloneNotSupportedException", clonenotsupportedexception_methods);
clonenotsupportedexception_ce = zend_register_internal_class_ex(&ce, illegalexception_ce, NULL TSRMLS_CC);
BUESSION_INIT_CLASS_ENTRY(ce, "InvalidPropertyException", invalidpropertyexception_methods);
invalidpropertyexception_ce = zend_register_internal_class_ex(&ce, spl_ce_UnexpectedValueException, NULL TSRMLS_CC);
BUESSION_INIT_CLASS_ENTRY(ce, "IllegalArgumentException", illegalargumentexception_methods);
illegalargumentexception_ce = zend_register_internal_class_ex(&ce, spl_ce_InvalidArgumentException, NULL TSRMLS_CC);
BUESSION_INIT_CLASS_ENTRY(ce, "NoSuchMethodException", nosuchmethodexception_methods);
nosuchmethodexception_ce = zend_register_internal_class_ex(&ce, spl_ce_BadMethodCallException, NULL TSRMLS_CC);
return SUCCESS;
}
/* }}} */
/** {{{ BUESSION_RINIT_FUNCTION */
BUESSION_RINIT_FUNCTION(exception){
return SUCCESS;
}
/* }}} */
/** {{{ BUESSION_RSHUTDOWN_FUNCTION */
BUESSION_RSHUTDOWN_FUNCTION(exception){
return SUCCESS;
}
/* }}} */
/** {{{ BUESSION_SHUTDOWN_FUNCTION */
BUESSION_SHUTDOWN_FUNCTION(exception){
return SUCCESS;
}
/* }}} */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
*/

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/eduosi-buession.git
git@api.gitlife.ru:oschina-mirror/eduosi-buession.git
oschina-mirror
eduosi-buession
eduosi-buession
master