Exemplo n.º 1
0
static zend_always_inline void php_psr_register_PsrContainerNotFoundExceptionInterface(INIT_FUNC_ARGS)
{
    zend_class_entry ce;
    INIT_CLASS_ENTRY(ce, "Psr\\Container\\NotFoundExceptionInterface", NULL);
    PsrContainerNotFoundExceptionInterface_ce_ptr = zend_register_internal_interface(&ce TSRMLS_CC);
    zend_class_implements(PsrContainerNotFoundExceptionInterface_ce_ptr TSRMLS_CC, 1, PsrContainerContainerExceptionInterface_ce_ptr);
}
Exemplo n.º 2
0
void register_stack()
{
    zend_class_entry ce;

    zend_function_entry methods[] = {
        COLLECTION_ME(Stack, __construct)
        COLLECTION_ME(Stack, allocate)
        COLLECTION_ME(Stack, capacity)
        COLLECTION_ME(Stack, peek)
        COLLECTION_ME(Stack, pop)
        COLLECTION_ME(Stack, push)
        COLLECTION_ME(Stack, pushAll)

        COLLECTION_ME_LIST(Stack)
        PHP_FE_END
    };

    INIT_CLASS_ENTRY(ce, DS_NS(Stack), methods);

    stack_ce = zend_register_internal_class(&ce);
    stack_ce->ce_flags      |= ZEND_ACC_FINAL;
    stack_ce->create_object  = stack_create_object;
    stack_ce->get_iterator   = stack_get_iterator;
    stack_ce->serialize      = stack_serialize;
    stack_ce->unserialize    = stack_unserialize;

    zend_class_implements(stack_ce, 1, collection_ce);
    register_stack_handlers();
}
Exemplo n.º 3
0
/* {{{ resourcebundle_register_class
 * Initialize 'ResourceBundle' class
 */
void resourcebundle_register_class( void )
{
	zend_class_entry ce;

	INIT_CLASS_ENTRY( ce, "ResourceBundle", ResourceBundle_class_functions );

	ce.create_object = ResourceBundle_object_create;
	ce.get_iterator = resourcebundle_get_iterator;

	ResourceBundle_ce_ptr = zend_register_internal_class( &ce );

	if( !ResourceBundle_ce_ptr )
	{
		zend_error(E_ERROR, "Failed to register ResourceBundle class");
		return;
	}

	ResourceBundle_object_handlers = std_object_handlers;
	ResourceBundle_object_handlers.offset = XtOffsetOf(ResourceBundle_object, zend);
	ResourceBundle_object_handlers.clone_obj	  = NULL; /* ICU ResourceBundle has no clone implementation */
	ResourceBundle_object_handlers.dtor_obj = ResourceBundle_object_destroy;
	ResourceBundle_object_handlers.read_dimension = resourcebundle_array_get;
	ResourceBundle_object_handlers.count_elements = resourcebundle_array_count;

	zend_class_implements(ResourceBundle_ce_ptr, 1, zend_ce_traversable);
}
Exemplo n.º 4
0
void init_interface_MacInterface(TSRMLS_D) {
    zend_class_entry ce;
    INIT_NS_CLASS_ENTRY(ce, "Cryptopp", "MacInterface", cryptopp_methods_MacInterface);
    cryptopp_ce_MacInterface = zend_register_internal_interface(&ce TSRMLS_CC);

    zend_class_implements(cryptopp_ce_MacInterface TSRMLS_CC, 1, cryptopp_ce_HashTransformationInterface);
}
Exemplo n.º 5
0
void init_class_PaddingNoPadding(TSRMLS_D) {
    zend_class_entry ce;
    INIT_NS_CLASS_ENTRY(ce, "Cryptopp", "PaddingNoPadding", cryptopp_methods_PaddingNoPadding);
    cryptopp_ce_PaddingNoPadding = zend_register_internal_class(&ce TSRMLS_CC);

    zend_class_implements(cryptopp_ce_PaddingNoPadding TSRMLS_CC, 1, cryptopp_ce_PaddingInterface);
}
Exemplo n.º 6
0
void php_ds_register_queue()
{
    zend_class_entry ce;

    zend_function_entry methods[] = {
        PHP_DS_ME(Queue, __construct)
        PHP_DS_ME(Queue, allocate)
        PHP_DS_ME(Queue, capacity)
        PHP_DS_ME(Queue, peek)
        PHP_DS_ME(Queue, pop)
        PHP_DS_ME(Queue, push)
        PHP_DS_ME(Queue, pushAll)

        PHP_DS_ME_LIST(Queue)
        PHP_FE_END
    };

    INIT_CLASS_ENTRY(ce, PHP_DS_NS(Queue), methods);

    php_ds_queue_ce = zend_register_internal_class(&ce);
    php_ds_queue_ce->ce_flags      |= ZEND_ACC_FINAL;
    php_ds_queue_ce->create_object  = php_ds_queue_create_object;
    php_ds_queue_ce->get_iterator   = php_ds_queue_get_iterator;
    php_ds_queue_ce->serialize      = php_ds_queue_serialize;
    php_ds_queue_ce->unserialize    = php_ds_queue_unserialize;

    zend_declare_class_constant_long(php_ds_queue_ce, STR_AND_LEN("MIN_CAPACITY"), DS_DEQUE_MIN_CAPACITY);
    zend_class_implements(php_ds_queue_ce, 1, collection_ce);

    php_ds_register_queue_handlers();
}
Exemplo n.º 7
0
void php_phongo_serializable_init_ce(INIT_FUNC_ARGS) /* {{{ */
{
	zend_class_entry ce;

	INIT_NS_CLASS_ENTRY(ce, "MongoDB\\BSON", "Serializable", php_phongo_serializable_me);
	php_phongo_serializable_ce = zend_register_internal_interface(&ce TSRMLS_CC);
	zend_class_implements(php_phongo_serializable_ce TSRMLS_CC, 1, php_phongo_type_ce);
} /* }}} */
Exemplo n.º 8
0
void php_driver_define_RangeException(TSRMLS_D)
{
  zend_class_entry ce;

  INIT_CLASS_ENTRY(ce, PHP_DRIVER_NAMESPACE "\\Exception\\RangeException", RangeException_methods);
  php_driver_range_exception_ce = php5to7_zend_register_internal_class_ex(&ce, spl_ce_RangeException);
  zend_class_implements(php_driver_range_exception_ce TSRMLS_CC, 1, php_driver_exception_ce);
}
void cassandra_define_InvalidArgumentException(TSRMLS_D)
{
  zend_class_entry ce;

  INIT_CLASS_ENTRY(ce, "Cassandra\\Exception\\InvalidArgumentException", InvalidArgumentException_methods);
  cassandra_invalid_argument_exception_ce = php5to7_zend_register_internal_class_ex(&ce, spl_ce_InvalidArgumentException);
  zend_class_implements(cassandra_invalid_argument_exception_ce TSRMLS_CC, 1, cassandra_exception_ce);
}
Exemplo n.º 10
0
void cassandra_define_RangeException(TSRMLS_D)
{
  zend_class_entry ce;

  INIT_CLASS_ENTRY(ce, "Cassandra\\Exception\\RangeException", RangeException_methods);
  cassandra_range_exception_ce = zend_register_internal_class_ex(&ce, spl_ce_RangeException, NULL TSRMLS_CC);
  zend_class_implements(cassandra_range_exception_ce TSRMLS_CC, 1, cassandra_exception_ce);
}
void cassandra_define_DivideByZeroException(TSRMLS_D)
{
  zend_class_entry ce;

  INIT_CLASS_ENTRY(ce, "Cassandra\\Exception\\DivideByZeroException", DivideByZeroException_methods);
  cassandra_divide_by_zero_exception_ce = php5to7_zend_register_internal_class_ex(&ce, cassandra_range_exception_ce);
  zend_class_implements(cassandra_divide_by_zero_exception_ce TSRMLS_CC, 1, cassandra_exception_ce);
}
Exemplo n.º 12
0
void cassandra_define_LogicException(TSRMLS_D)
{
  zend_class_entry ce;

  INIT_CLASS_ENTRY(ce, "Cassandra\\Exception\\LogicException", LogicException_methods);
  cassandra_logic_exception_ce = php5to7_zend_register_internal_class_ex(&ce, spl_ce_LogicException);
  zend_class_implements(cassandra_logic_exception_ce TSRMLS_CC, 1, cassandra_exception_ce);
}
Exemplo n.º 13
0
void
php_driver_define_Custom(TSRMLS_D)
{
  zend_class_entry ce;

  INIT_CLASS_ENTRY(ce, PHP_DRIVER_NAMESPACE "\\Custom", php_driver_custom_methods);
  php_driver_custom_ce = zend_register_internal_class(&ce TSRMLS_CC);
  zend_class_implements(php_driver_custom_ce TSRMLS_CC, 1, php_driver_value_ce);
  php_driver_custom_ce->ce_flags |= ZEND_ACC_ABSTRACT;
}
Exemplo n.º 14
0
void php_protocolbuffers_enum_class(TSRMLS_D)
{
	zend_class_entry ce;

	INIT_CLASS_ENTRY(ce, "ProtocolBuffersEnum", protocolbuffers_enum_methods);
	php_protocol_buffers_enum_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
	PHP_PROTOCOLBUFFERS_REGISTER_NS_CLASS_ALIAS(PHP_PROTOCOLBUFFERS_NAMESPACE, "Enum", php_protocol_buffers_enum_class_entry);
	zend_class_implements(php_protocol_buffers_enum_class_entry TSRMLS_CC, 1, php_protocol_buffers_enum_describable_class_entry);

	php_protocol_buffers_enum_class_entry->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS;

}
Exemplo n.º 15
0
void php_phongo_logicexception_init_ce(INIT_FUNC_ARGS) /* {{{ */
{
	zend_class_entry ce;

	INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver\\Exception", "LogicException", php_phongo_logicexception_me);
#if PHP_VERSION_ID >= 70000
	php_phongo_logicexception_ce = zend_register_internal_class_ex(&ce, spl_ce_LogicException);
#else
	php_phongo_logicexception_ce = zend_register_internal_class_ex(&ce, spl_ce_LogicException, NULL TSRMLS_CC);
#endif
	zend_class_implements(php_phongo_logicexception_ce TSRMLS_CC, 1, php_phongo_exception_ce);
} /* }}} */
Exemplo n.º 16
0
void php_phongo_commandsubscriber_init_ce(INIT_FUNC_ARGS) /* {{{ */
{
	zend_class_entry ce;
	(void) type;
	(void) module_number;

	INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver\\Monitoring", "CommandSubscriber", php_phongo_commandsubscriber_me);
	php_phongo_commandsubscriber_ce = zend_register_internal_interface(&ce TSRMLS_CC);
	zend_class_implements(php_phongo_commandsubscriber_ce TSRMLS_CC, 1, php_phongo_subscriber_ce);

	return;
} /* }}} */
Exemplo n.º 17
0
void swoole_coroutine_util_init(int module_number TSRMLS_DC)
{
    SWOOLE_INIT_CLASS_ENTRY(swoole_coroutine_util_ce, "swoole_coroutine", "Swoole\\Coroutine", swoole_coroutine_util_methods);
    swoole_coroutine_util_class_entry_ptr = zend_register_internal_class(&swoole_coroutine_util_ce TSRMLS_CC);

    INIT_CLASS_ENTRY(swoole_coroutine_iterator_ce, "Swoole\\Coroutine\\Iterator", iterator_methods);
    swoole_coroutine_iterator_class_entry_ptr = zend_register_internal_class(&swoole_coroutine_iterator_ce TSRMLS_CC);
    zend_class_implements(swoole_coroutine_iterator_class_entry_ptr TSRMLS_CC, 1, zend_ce_iterator);
#ifdef SW_HAVE_COUNTABLE
    zend_class_implements(swoole_coroutine_iterator_class_entry_ptr TSRMLS_CC, 1, zend_ce_countable);
#endif

    if (SWOOLE_G(use_namespace))
    {
        sw_zend_register_class_alias("swoole_coroutine", swoole_coroutine_util_class_entry_ptr);
    }
    else
    {
        sw_zend_register_class_alias("Swoole\\Coroutine", swoole_coroutine_util_class_entry_ptr);
    }

    if (SWOOLE_G(use_shortname))
    {
        sw_zend_register_class_alias("Co", swoole_coroutine_util_class_entry_ptr);
    }
    defer_coros = swHashMap_new(SW_HASHMAP_INIT_BUCKET_N, NULL);

    //prohibit exit in coroutine
    INIT_CLASS_ENTRY(swoole_exit_exception_ce, "Swoole\\ExitException", swoole_exit_exception_methods);
    swoole_exit_exception_class_entry_ptr = zend_register_internal_class_ex(&swoole_exit_exception_ce, zend_exception_get_default());
    SWOOLE_DEFINE(EXIT_IN_COROUTINE);
    SWOOLE_DEFINE(EXIT_IN_SERVER);

    if (SWOOLE_G(cli))
    {
        ori_exit_handler = zend_get_user_opcode_handler(ZEND_EXIT);
        zend_set_user_opcode_handler(ZEND_EXIT, coro_exit_handler);
    }
}
Exemplo n.º 18
0
void swoole_table_init(int module_number TSRMLS_DC)
{
    INIT_CLASS_ENTRY(swoole_table_ce, "swoole_table", swoole_table_methods);
    swoole_table_class_entry_ptr = zend_register_internal_class(&swoole_table_ce TSRMLS_CC);

#ifdef HAVE_PCRE
    zend_class_implements(swoole_table_class_entry_ptr TSRMLS_CC, 2, spl_ce_Iterator, spl_ce_Countable);
#endif

    zend_declare_class_constant_long(swoole_table_class_entry_ptr, SW_STRL("TYPE_INT")-1, SW_TABLE_INT TSRMLS_CC);
    zend_declare_class_constant_long(swoole_table_class_entry_ptr, SW_STRL("TYPE_STRING")-1, SW_TABLE_STRING TSRMLS_CC);
    zend_declare_class_constant_long(swoole_table_class_entry_ptr, SW_STRL("TYPE_FLOAT")-1, SW_TABLE_FLOAT TSRMLS_CC);
}
Exemplo n.º 19
0
void register_collection()
{
    zend_class_entry ce;

    zend_function_entry methods[] = {
        COLLECTION_ABSTRACT_ME(clear)
        COLLECTION_ABSTRACT_ME(copy)
        COLLECTION_ABSTRACT_ME(isEmpty)
        COLLECTION_ABSTRACT_ME(toArray)
        PHP_FE_END
    };

    INIT_CLASS_ENTRY(ce, COLLECTION_NS(Collection), methods);
    collection_ce = zend_register_internal_interface(&ce);
    zend_class_implements(collection_ce, 3, zend_ce_traversable, spl_ce_Countable, php_json_serializable_ce);
}
Exemplo n.º 20
0
void yee_base_exceptions_do_register_ce() {
	zend_class_entry ce_exception;
	INIT_CLASS_ENTRY(ce_exception, "yii\\base\\Exception", exception_methods);
	yee_ce_Exception = zend_register_internal_class_ex(&ce_exception, zend_exception_get_default(TSRMLS_CC), "Exception");
	zend_class_implements(yee_ce_Exception TSRMLS_CC, 1, yee_ce_Arrayable);
	
	zend_class_entry ce_invalid_call;
	INIT_CLASS_ENTRY(ce_invalid_call, "yii\\base\\InvalidCallException", invalid_call_exception_methods);
	yee_ce_InvalidCallException = zend_register_internal_class_ex(&ce_invalid_call, yee_ce_Exception, "yii\\base\\Exception");
	
	zend_class_entry ce_invalid_config;
	INIT_CLASS_ENTRY(ce_invalid_config, "yii\\base\\InvalidConfigException", invalid_config_exception_methods);
	yee_ce_InvalidConfigException = zend_register_internal_class_ex(&ce_invalid_config, yee_ce_Exception, "yii\\base\\Exception");
	
	zend_class_entry ce_invalid_param;
	INIT_CLASS_ENTRY(ce_invalid_param, "yii\\base\\InvalidParamException", invalid_param_exception_methods);
	yee_ce_InvalidParamException = zend_register_internal_class_ex(&ce_invalid_param, yee_ce_Exception, "yii\\base\\Exception");
	
	zend_class_entry ce_invalid_route;
	INIT_CLASS_ENTRY(ce_invalid_route, "yii\\base\\InvalidRouteException", invalid_route_exception_methods);
	yee_ce_InvalidRouteException = zend_register_internal_class_ex(&ce_invalid_route, yee_ce_Exception, "yii\\base\\Exception");
		
	zend_class_entry ce_not_supported;
	INIT_CLASS_ENTRY(ce_not_supported, "yii\\base\\NotSupportedException", not_supported_exception_methods);
	yee_ce_NotSupportedException = zend_register_internal_class_ex(&ce_not_supported, yee_ce_Exception, "yii\\base\\Exception");
	
	zend_class_entry ce_unknown_class;
	INIT_CLASS_ENTRY(ce_unknown_class, "yii\\base\\UnknowClassException", unknown_class_exception_methods);
	yee_ce_UnknownClassException = zend_register_internal_class_ex(&ce_unknown_class, yee_ce_Exception, "yii\\base\\Exception");
	
	zend_class_entry ce_unknown_method;
	INIT_CLASS_ENTRY(ce_unknown_method, "yii\\base\\UnknowMethodException", unknown_method_exception_methods);
	yee_ce_UnknownMethodException = zend_register_internal_class_ex(&ce_unknown_method, yee_ce_Exception, "yii\\base\\Exception");
			
	zend_class_entry ce_unknown_property;
	INIT_CLASS_ENTRY(ce_unknown_property, "yii\\base\\UnknowPropertyException", unknown_property_exception_methods);
	yee_ce_UnknownPropertyException = zend_register_internal_class_ex(&ce_unknown_property, yee_ce_Exception, "yii\\base\\Exception");
	
	zend_class_entry ce_user_excepton;
	INIT_CLASS_ENTRY(ce_user_excepton, "yii\\base\\UserException", NULL);
	yee_ce_UserException = zend_register_internal_class_ex(&ce_user_excepton, yee_ce_Exception, "yii\\base\\Exception");
}
Exemplo n.º 21
0
void php_ds_register_pair()
{
    zend_class_entry ce;

    zend_function_entry methods[] = {
        PHP_DS_ME(Pair, __construct)
        PHP_DS_ME(Pair, copy)
        PHP_DS_ME(Pair, jsonSerialize)
        PHP_DS_ME(Pair, toArray)
        PHP_FE_END
    };

    INIT_CLASS_ENTRY(ce, PHP_DS_NS(Pair), methods);
    php_ds_pair_ce = zend_register_internal_class(&ce);

    php_ds_pair_ce->ce_flags         |= ZEND_ACC_FINAL;
    php_ds_pair_ce->create_object     = php_ds_pair_create_object;
    php_ds_pair_ce->serialize         = php_ds_pair_serialize;
    php_ds_pair_ce->unserialize       = php_ds_pair_unserialize;

    zend_class_implements(php_ds_pair_ce, 1, php_json_serializable_ce);
    php_ds_register_pair_handlers();
}
Exemplo n.º 22
0
void register_vector()
{
    zend_class_entry ce;

    zend_function_entry methods[] = {
        SEQUENCE_ME_LIST(Vector)
        COLLECTION_ME_LIST(Vector)
        PHP_FE_END
    };

    INIT_CLASS_ENTRY(ce, DS_NS(Vector), methods);

    vector_ce = zend_register_internal_class(&ce);
    vector_ce->ce_flags      |= ZEND_ACC_FINAL;
    vector_ce->create_object  = vector_create_object;
    vector_ce->get_iterator   = vector_get_iterator;
    vector_ce->serialize      = vector_serialize;
    vector_ce->unserialize    = vector_unserialize;

    zend_declare_class_constant_long(vector_ce, STR_AND_LEN("MIN_CAPACITY"), VECTOR_MIN_CAPACITY);

    zend_class_implements(vector_ce, 1, sequence_ce);
    register_vector_handlers();
}