From cfd868651a321fbfd84ed98e33669c5f94a7098a Mon Sep 17 00:00:00 2001 From: Andrey Hristov Date: Mon, 12 Oct 2015 14:57:48 +0200 Subject: MDNR: - removed init() method from mysqlnd_conn_data and moved the initialization to the object factory->get_connection(). Now it is unified as with the prepared statement which doesn't have any init() method - the protocol decoder factory now takes connection as parameter at creation and thus there is no need to pass the connection as parameter when calling the read or the write method of a packet. - saved the protocol payload decoder factory as pointer in every packet (read/write) so the connection doesn't need to be passed on every call of read/write (dependency has been already injected at creation). This will alow to move protocol specific code from MYSQLND_NET (send_ex()) to make MYSQLND_NET leaner and free from protocol stuff. --- ext/mysqlnd/mysqlnd_ext_plugin.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'ext/mysqlnd/mysqlnd_ext_plugin.c') diff --git a/ext/mysqlnd/mysqlnd_ext_plugin.c b/ext/mysqlnd/mysqlnd_ext_plugin.c index 44ded51cf7..1ba0b85f48 100644 --- a/ext/mysqlnd/mysqlnd_ext_plugin.c +++ b/ext/mysqlnd/mysqlnd_ext_plugin.c @@ -148,6 +148,21 @@ PHPAPI void ** _mysqlnd_plugin_get_plugin_net_data(const MYSQLND_NET * net, unsi /* }}} */ +/* {{{ mysqlnd_conn_get_methods */ +PHPAPI struct st_mysqlnd_object_factory_methods * +mysqlnd_object_factory_get_methods() +{ + return &MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_object_factory); +} +/* }}} */ + +/* {{{ mysqlnd_conn_set_methods */ +PHPAPI void mysqlnd_object_factory_set_methods(struct st_mysqlnd_object_factory_methods *methods) +{ + MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_object_factory) = *methods; +} +/* }}} */ + /* {{{ mysqlnd_conn_get_methods */ PHPAPI struct st_mysqlnd_conn_methods * -- cgit v1.2.1