List:Commits« Previous MessageNext Message »
From:grichter Date:March 21 2007 1:00pm
Subject:PHP mysqlnd svn commit: r233 - trunk/ext/mysqli/mysqlnd
View as plain text  
Author: grichter
Date: 2007-03-21 14:00:55 +0100 (Wed, 21 Mar 2007)
New Revision: 233

Modified:
   trunk/ext/mysqli/mysqlnd/mysqlnd_palloc.c
Log:
added unicode support for cache stats


Modified: trunk/ext/mysqli/mysqlnd/mysqlnd_palloc.c
===================================================================
--- trunk/ext/mysqli/mysqlnd/mysqlnd_palloc.c	2007-03-21 13:00:33 UTC (rev 232)
+++ trunk/ext/mysqli/mysqlnd/mysqlnd_palloc.c	2007-03-21 13:00:55 UTC (rev 233)
@@ -428,13 +428,40 @@
 	if (cache) {
 		LOCK_PCACHE(cache);
 		array_init(return_value);
-		add_assoc_long_ex(return_value, "put_hits",		sizeof("put_hits"), 	cache->put_hits);
-		add_assoc_long_ex(return_value,
"put_misses",	sizeof("put_misses"),	cache->put_misses);
-		add_assoc_long_ex(return_value, "get_hits", 	sizeof("get_hits"), 	cache->get_hits);
-		add_assoc_long_ex(return_value, "get_misses",	sizeof("get_misses"),
	cache->get_misses);
-		add_assoc_long_ex(return_value, "size", 		sizeof("size"), 		cache->max_items);
-		add_assoc_long_ex(return_value,
"free_items",	sizeof("free_items"),	cache->free_items);
-		add_assoc_long_ex(return_value,
"references",	sizeof("references"),	cache->references);
+		if (UG(unicode)) {
+			UChar *ustr;
+			int ulen;
+
+			zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen, "put_hits",
sizeof("put_hits") TSRMLS_CC);
+			add_u_assoc_long_ex(return_value, IS_UNICODE, ZSTR(ustr), ulen + 1,
cache->put_hits);
+			efree(ustr);			
+			zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen, "put_misses",
sizeof("put_misses") TSRMLS_CC);
+			add_u_assoc_long_ex(return_value, IS_UNICODE, ZSTR(ustr), ulen + 1,
cache->put_hits);
+			efree(ustr);			
+			zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen, "get_hits",
sizeof("get_hits") TSRMLS_CC);
+			add_u_assoc_long_ex(return_value, IS_UNICODE, ZSTR(ustr), ulen + 1,
cache->put_hits);
+			efree(ustr);			
+			zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen, "get_misses",
sizeof("get_misses") TSRMLS_CC);
+			add_u_assoc_long_ex(return_value, IS_UNICODE, ZSTR(ustr), ulen + 1,
cache->put_hits);
+			efree(ustr);			
+			zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen, "size", sizeof("size")
TSRMLS_CC);
+			add_u_assoc_long_ex(return_value, IS_UNICODE, ZSTR(ustr), ulen + 1,
cache->put_hits);
+			efree(ustr);			
+			zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen, "free_items",
sizeof("free_items") TSRMLS_CC);
+			add_u_assoc_long_ex(return_value, IS_UNICODE, ZSTR(ustr), ulen + 1,
cache->put_hits);
+			efree(ustr);			
+			zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen, "references",
sizeof("references") TSRMLS_CC);
+			add_u_assoc_long_ex(return_value, IS_UNICODE, ZSTR(ustr), ulen + 1,
cache->put_hits);
+			efree(ustr);			
+		} else {
+			add_assoc_long_ex(return_value, "put_hits",		sizeof("put_hits"), 	cache->put_hits);
+			add_assoc_long_ex(return_value,
"put_misses",	sizeof("put_misses"),	cache->put_misses);
+			add_assoc_long_ex(return_value, "get_hits", 	sizeof("get_hits"), 	cache->get_hits);
+			add_assoc_long_ex(return_value, "get_misses",	sizeof("get_misses"),
	cache->get_misses);
+			add_assoc_long_ex(return_value, "size", 		sizeof("size"), 		cache->max_items);
+			add_assoc_long_ex(return_value,
"free_items",	sizeof("free_items"),	cache->free_items);
+			add_assoc_long_ex(return_value,
"references",	sizeof("references"),	cache->references);
+		}
 		UNLOCK_PCACHE(cache);
 	} else {
 		ZVAL_NULL(return_value);

Thread
PHP mysqlnd svn commit: r233 - trunk/ext/mysqli/mysqlndgrichter21 Mar