]> git.pld-linux.org Git - packages/php.git/blob - php-pdo_mysql-charsetphpini.patch
- uid http for fpm (@PHP_5_2)
[packages/php.git] / php-pdo_mysql-charsetphpini.patch
1 This is damn ugly patch if you need to update it, see PHP_5_2 branch version to
2 understand what this patch is supposed to do as in 5.3 the ini section is
3 enabled only if mysqlnd driver is enabled which makes the contexts really
4 small.
5
6 --- php-5.3.1/ext/pdo_mysql/mysql_driver.c~     2010-02-20 01:08:04.000000000 +0200
7 +++ php-5.3.1/ext/pdo_mysql/mysql_driver.c      2010-02-20 01:08:52.982186037 +0200
8 @@ -436,6 +436,7 @@
9         pdo_mysql_db_handle *H;
10         int i, ret = 0;
11         char *host = NULL, *unix_socket = NULL;
12 +       char *connect_charset = NULL;
13         unsigned int port = 3306;
14         char *dbname;
15         struct pdo_data_src_parser vars[] = {
16 @@ -731,6 +731,12 @@
17                 password_len = strlen(dbh->password);
18         }
19  
20 +       connect_charset = PDO_MYSQL_G(connect_charset);
21 +
22 +       if (connect_charset != NULL) {
23 +               mysql_options(H->server, MYSQL_SET_CHARSET_NAME, connect_charset);
24 +       }
25 +
26         if (mysqlnd_connect(H->server, host, dbh->username, dbh->password, password_len, dbname, dbname_len,
27                                                 port, unix_socket, connect_opts, PDO_MYSQL_G(mysqlnd_thd_zval_cache) TSRMLS_CC) == NULL) {
28  #else
29 --- php-5.3.2RC3/ext/pdo_mysql/pdo_mysql.c~     2010-02-04 11:37:38.000000000 +0200
30 +++ php-5.3.2RC3/ext/pdo_mysql/pdo_mysql.c      2010-02-26 19:09:36.784902389 +0200
31 @@ -56,6 +56,7 @@
32  #if PDO_DBG_ENABLED
33         STD_PHP_INI_ENTRY("pdo_mysql.debug",    NULL, PHP_INI_SYSTEM, OnUpdateString, debug, zend_pdo_mysql_globals, pdo_mysql_globals)
34  #endif
35 +       STD_PHP_INI_ENTRY("pdo_mysql.connect_charset",  NULL,   PHP_INI_ALL,    OnUpdateString, connect_charset,        zend_pdo_mysql_globals, pdo_mysql_globals)
36  PHP_INI_END()
37  /* }}} */
38  
39 @@ -89,9 +90,7 @@
40  static PHP_MSHUTDOWN_FUNCTION(pdo_mysql)
41  {
42         php_pdo_unregister_driver(&pdo_mysql_driver);
43 -#if PDO_USE_MYSQLND
44         UNREGISTER_INI_ENTRIES();
45 -#endif
46  
47         return SUCCESS;
48  }
49 @@ -108,9 +107,7 @@
50  
51         php_info_print_table_end();
52  
53 -#ifdef PDO_USE_MYSQLND
54         DISPLAY_INI_ENTRIES();
55 -#endif
56  }
57  /* }}} */
58  
59 @@ -154,10 +151,13 @@
60  /* }}} */
61  
62  
63 +#endif /* PDO_USE_MYSQLND */
64 +
65  /* {{{ PHP_GINIT_FUNCTION
66   */
67  static PHP_GINIT_FUNCTION(pdo_mysql)
68  {
69 +#ifdef PDO_USE_MYSQLND
70  #ifndef PHP_WIN32
71         pdo_mysql_globals->default_socket = NULL;
72  #endif
73 @@ -165,10 +165,10 @@
74         pdo_mysql_globals->debug = NULL;        /* The actual string */
75         pdo_mysql_globals->dbg = NULL;  /* The DBG object*/
76  #endif
77 +#endif /* PDO_USE_MYSQLND */
78 +       pdo_mysql_globals->connect_charset = NULL;
79  }
80  /* }}} */
81 -#endif
82 -
83  
84  /* {{{ pdo_mysql_functions[] */
85  const zend_function_entry pdo_mysql_functions[] = {
86 @@ -205,15 +205,11 @@
87  #endif
88         PHP_MINFO(pdo_mysql),
89         "1.0.2",
90 -#if PDO_USE_MYSQLND
91         PHP_MODULE_GLOBALS(pdo_mysql),
92         PHP_GINIT(pdo_mysql),
93         NULL,
94         NULL,
95         STANDARD_MODULE_PROPERTIES_EX
96 -#else
97 -       STANDARD_MODULE_PROPERTIES
98 -#endif
99  };
100  /* }}} */
101  
102 --- php-5.3.2RC3/ext/pdo_mysql/php_pdo_mysql_int.h~     2010-02-04 11:37:38.000000000 +0200
103 +++ php-5.3.2RC3/ext/pdo_mysql/php_pdo_mysql_int.h      2010-02-26 19:11:47.484055898 +0200
104 @@ -69,6 +69,7 @@
105         char          *debug; /* The actual string */
106         MYSQLND_DEBUG *dbg;     /* The DBG object */
107  #endif
108 +       char          *connect_charset;
109  #if defined(PHP_WIN32) && !PDO_DBG_ENABLED
110         /* dummy member so we get at least one member in the struct
111          * and avoids build errors.
This page took 0.07965 seconds and 3 git commands to generate.