[PHP-CVS] svn: /php/php-src/trunk/Zend/ zend_API.h zend_compile.c zend_iterators.c zend_opcode.c

2010-08-05 Thread Dmitry Stogov
dmitry   Thu, 05 Aug 2010 13:10:15 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=301876

Log:
Use interned strings for class names

Changed paths:
U   php/php-src/trunk/Zend/zend_API.h
U   php/php-src/trunk/Zend/zend_compile.c
U   php/php-src/trunk/Zend/zend_iterators.c
U   php/php-src/trunk/Zend/zend_opcode.c

Modified: php/php-src/trunk/Zend/zend_API.h
===
--- php/php-src/trunk/Zend/zend_API.h   2010-08-05 12:29:40 UTC (rev 301875)
+++ php/php-src/trunk/Zend/zend_API.h   2010-08-05 13:10:15 UTC (rev 301876)
@@ -167,7 +167,10 @@
 #define INIT_OVERLOADED_CLASS_ENTRY_EX(class_container, class_name, 
class_name_len, functions, handle_fcall, handle_propget, handle_propset, 
handle_propunset, handle_propisset) \
{   
\
int _len = class_name_len;  
\
-   class_container.name = zend_strndup(class_name, _len);  \
+   class_container.name = zend_new_interned_string(class_name, 
_len+1, 0); \
+   if (class_container.name == class_name) {   
\
+   class_container.name = zend_strndup(class_name, _len);  
\
+   }   
\
class_container.name_length = _len; 
\
class_container.builtin_functions = functions;  
\
class_container.constructor = NULL; 
\

Modified: php/php-src/trunk/Zend/zend_compile.c
===
--- php/php-src/trunk/Zend/zend_compile.c   2010-08-05 12:29:40 UTC (rev 
301875)
+++ php/php-src/trunk/Zend/zend_compile.c   2010-08-05 13:10:15 UTC (rev 
301876)
@@ -4486,8 +4486,8 @@

new_class_entry = emalloc(sizeof(zend_class_entry));
new_class_entry-type = ZEND_USER_CLASS;
-   new_class_entry-name = class_name-u.constant.value.str.val;
-   new_class_entry-name_length = class_name-u.constant.value.str.len;
+   new_class_entry-name = 
zend_new_interned_string(Z_STRVAL(class_name-u.constant), 
Z_STRLEN(class_name-u.constant) + 1, 1 TSRMLS_CC);
+   new_class_entry-name_length = Z_STRLEN(class_name-u.constant);

zend_initialize_class_data(new_class_entry, 1 TSRMLS_CC);
new_class_entry-filename = zend_get_compiled_filename(TSRMLS_C);

Modified: php/php-src/trunk/Zend/zend_iterators.c
===
--- php/php-src/trunk/Zend/zend_iterators.c 2010-08-05 12:29:40 UTC (rev 
301875)
+++ php/php-src/trunk/Zend/zend_iterators.c 2010-08-05 13:10:15 UTC (rev 
301876)
@@ -51,8 +51,6 @@
 ZEND_API void zend_register_iterator_wrapper(TSRMLS_D)
 {
INIT_CLASS_ENTRY(zend_iterator_class_entry, __iterator_wrapper, NULL);
-   free(zend_iterator_class_entry.name);
-   zend_iterator_class_entry.name = __iterator_wrapper;
 }

 static void iter_wrapper_dtor(void *object, zend_object_handle handle 
TSRMLS_DC)

Modified: php/php-src/trunk/Zend/zend_opcode.c
===
--- php/php-src/trunk/Zend/zend_opcode.c2010-08-05 12:29:40 UTC (rev 
301875)
+++ php/php-src/trunk/Zend/zend_opcode.c2010-08-05 13:10:15 UTC (rev 
301876)
@@ -301,7 +301,9 @@
efree(ce-default_static_members_table);
}
zend_hash_destroy(ce-properties_info);
-   efree(ce-name);
+   if (!IS_INTERNED(ce-name)) {
+   efree(ce-name);
+   }
zend_hash_destroy(ce-function_table);
zend_hash_destroy(ce-constants_table);
if (ce-num_interfaces  0  ce-interfaces) {
@@ -335,7 +337,9 @@
free(ce-default_static_members_table);
}
zend_hash_destroy(ce-properties_info);
-   free(ce-name);
+   if (!IS_INTERNED(ce-name)) {
+   free(ce-name);
+   }
zend_hash_destroy(ce-function_table);
zend_hash_destroy(ce-constants_table);
if (ce-num_interfaces  0) {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/trunk/ NEWS ext/pdo_mysql/config.m4 ext/pdo_mysql/mysql_driver.c ext/pdo_mysql/mysql_statement.c ext/pdo_mysql/php_pdo_mysql_int.h

2010-08-05 Thread Johannes Schlüter
johannes Thu, 05 Aug 2010 13:29:44 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=301877

Log:
- Drop (broken) support for libmysql 3.23 and 4.0 from pdo_mysql, see bug #51259

Bug: http://bugs.php.net/51259 (Assigned) PHP 5.3.2 + PDO MySQL not compatible 
with MySQL 4.0
  
Changed paths:
U   php/php-src/trunk/NEWS
U   php/php-src/trunk/ext/pdo_mysql/config.m4
U   php/php-src/trunk/ext/pdo_mysql/mysql_driver.c
U   php/php-src/trunk/ext/pdo_mysql/mysql_statement.c
U   php/php-src/trunk/ext/pdo_mysql/php_pdo_mysql_int.h

Modified: php/php-src/trunk/NEWS
===
--- php/php-src/trunk/NEWS	2010-08-05 13:10:15 UTC (rev 301876)
+++ php/php-src/trunk/NEWS	2010-08-05 13:29:44 UTC (rev 301877)
@@ -86,6 +86,9 @@
 functions. (Kalle)
   . y2k_compliance ini option. (Kalle)

+- Removed support for linking against MySQL client libraries older 4.1 from
+  PDO_mysql. (Johannes)
+
 - Implemented FR #51295 (SQLite3::busyTimeout not existing). (Mark)
 - Implemented FR #48632 (OpenSSL AES support). (yonas dot y
at gmail dot com, Pierre)

Modified: php/php-src/trunk/ext/pdo_mysql/config.m4
===
--- php/php-src/trunk/ext/pdo_mysql/config.m4	2010-08-05 13:10:15 UTC (rev 301876)
+++ php/php-src/trunk/ext/pdo_mysql/config.m4	2010-08-05 13:29:44 UTC (rev 301877)
@@ -100,15 +100,15 @@
   AC_MSG_ERROR([Unable to find your mysql installation])
 fi

-PHP_CHECK_LIBRARY($PDO_MYSQL_LIBNAME, mysql_query,
+PHP_CHECK_LIBRARY($PDO_MYSQL_LIBNAME, mysql_commit,
 [
   PHP_EVAL_INCLINE($PDO_MYSQL_INCLUDE)
   PHP_EVAL_LIBLINE($PDO_MYSQL_LIBS, PDO_MYSQL_SHARED_LIBADD)
 ],[
   if test $PHP_ZLIB_DIR != no; then
 PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR, PDO_MYSQL_SHARED_LIBADD)
-PHP_CHECK_LIBRARY($PDO_MYSQL_LIBNAME, mysql_query, [], [
-  AC_MSG_ERROR([PDO_MYSQL configure failed. Please check config.log for more information.])
+PHP_CHECK_LIBRARY($PDO_MYSQL_LIBNAME, mysql_commit, [], [
+  AC_MSG_ERROR([PDO_MYSQL configure failed, MySQL 4.1 needed. Please check config.log for more information.])
 ], [
   -L$PHP_ZLIB_DIR/$PHP_LIBDIR -L$PDO_MYSQL_LIB_DIR
 ])
@@ -128,11 +128,6 @@
 ],[
   $PDO_MYSQL_LIBS
 ])
-
-_SAVE_LIBS=$LIBS
-LIBS=$LIBS $PDO_MYSQL_LIBS
-AC_CHECK_FUNCS([mysql_commit mysql_stmt_prepare mysql_next_result mysql_sqlstate])
-LIBS=$_SAVE_LIBS
   fi

   ifdef([PHP_CHECK_PDO_INCLUDES],

Modified: php/php-src/trunk/ext/pdo_mysql/mysql_driver.c
===
--- php/php-src/trunk/ext/pdo_mysql/mysql_driver.c	2010-08-05 13:10:15 UTC (rev 301876)
+++ php/php-src/trunk/ext/pdo_mysql/mysql_driver.c	2010-08-05 13:29:44 UTC (rev 301877)
@@ -42,17 +42,6 @@
 #	define pdo_mysql_init(persistent) mysql_init(NULL)
 #endif

-#if !HAVE_MYSQL_SQLSTATE  !PDO_USE_MYSQLND
-static const char *pdo_mysql_get_sqlstate(unsigned int my_errno) { /* {{{ */
-	switch (my_errno) {
-		/* import auto-generated case: code */
-#include php_pdo_mysql_sqlstate.h
-	default: return HY000;
-	}
-}
-/* }}} */
-#endif
-
 /* {{{ _pdo_mysql_error */
 int _pdo_mysql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line TSRMLS_DC) /* {{{ */
 {
@@ -72,13 +61,9 @@
 		einfo   = H-einfo;
 	}

-#if HAVE_MYSQL_STMT_PREPARE || PDO_USE_MYSQLND
 	if (S  S-stmt) {
 		einfo-errcode = mysql_stmt_errno(S-stmt);
-	}
-	else
-#endif
-	{
+	} else {
 		einfo-errcode = mysql_errno(H-server);
 	}

@@ -112,18 +97,11 @@
 		PDO_DBG_RETURN(0);
 	}

-#if HAVE_MYSQL_SQLSTATE || PDO_USE_MYSQLND
-# if HAVE_MYSQL_STMT_PREPARE || PDO_USE_MYSQLND
 	if (S  S-stmt) {
 		strcpy(*pdo_err, mysql_stmt_sqlstate(S-stmt));
-	} else
-# endif
-	{
+	} else {
 		strcpy(*pdo_err, mysql_sqlstate(H-server));
 	}
-#else
-	strcpy(*pdo_err, pdo_mysql_get_sqlstate(einfo-errcode));
-#endif

 	if (!dbh-methods) {
 		PDO_DBG_INF(Throwing exception);
@@ -187,12 +165,10 @@
 {
 	pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh-driver_data;
 	pdo_mysql_stmt *S = ecalloc(1, sizeof(pdo_mysql_stmt));
-#if HAVE_MYSQL_STMT_PREPARE || PDO_USE_MYSQLND
 	char *nsql = NULL;
 	int nsql_len = 0;
 	int ret;
 	int server_version;
-#endif

 	PDO_DBG_ENTER(mysql_handle_preparer);
 	PDO_DBG_INF_FMT(dbh=%p, dbh);
@@ -206,7 +182,6 @@
 		goto end;
 	}

-#if HAVE_MYSQL_STMT_PREPARE || PDO_USE_MYSQLND
 	server_version = mysql_get_server_version(H-server);
 	if (server_version  40100) {
 		goto fallback;
@@ -270,7 +245,6 @@
 	PDO_DBG_RETURN(1);

 fallback:
-#endif
 end:
 	stmt-supports_placeholders = PDO_PLACEHOLDER_NONE;

@@ -296,7 +270,6 @@
 			PDO_DBG_RETURN(H-einfo.errcode ? -1 : 0);
 		} else {

-#if HAVE_MYSQL_NEXT_RESULT || PDO_USE_MYSQLND
 			/* MULTI_QUERY support - eat up all unfetched result sets */
 			MYSQL_RES* result;
 			while (mysql_more_results(H-server)) 

[PHP-CVS] svn: /SVNROOT/ pear_avail

2010-08-05 Thread Christian Weiske
cweiske  Thu, 05 Aug 2010 14:16:40 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=301881

Log:
give james wade access to PHP_DocBlockGenerator

Changed paths:
U   SVNROOT/pear_avail

Modified: SVNROOT/pear_avail
===
--- SVNROOT/pear_avail  2010-08-05 14:15:48 UTC (rev 301880)
+++ SVNROOT/pear_avail  2010-08-05 14:16:40 UTC (rev 301881)
@@ -174,7 +174,7 @@
 avail|kei|pear/packages/Net_UserAgent_Mobile_GPS
 avail|blindman|pear/packages/Text_Highlighter
 avail|shimooka|pear/packages/Date_Holidays
-avail|hm2k|pear/packages/PHP_Compat
+avail|hm2k|pear/packages/PHP_Compat,pear/packages/PHP_DocBlockGenerator
 avail|lucor|pear/packages/Services_Atlassian_Crowd
 avail|kvz|pear/packages/System_Daemon,pear/peardoc
 avail|saltybeagle|pear/installphars

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/trunk/Zend/ zend_API.h

2010-08-05 Thread Felipe Pena
felipe   Thu, 05 Aug 2010 17:09:08 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=301906

Log:
- Fixed ZTS build (Kalle)

Changed paths:
U   php/php-src/trunk/Zend/zend_API.h

Modified: php/php-src/trunk/Zend/zend_API.h
===
--- php/php-src/trunk/Zend/zend_API.h   2010-08-05 17:01:49 UTC (rev 301905)
+++ php/php-src/trunk/Zend/zend_API.h   2010-08-05 17:09:08 UTC (rev 301906)
@@ -167,7 +167,7 @@
 #define INIT_OVERLOADED_CLASS_ENTRY_EX(class_container, class_name, 
class_name_len, functions, handle_fcall, handle_propget, handle_propset, 
handle_propunset, handle_propisset) \
{   
\
int _len = class_name_len;  
\
-   class_container.name = zend_new_interned_string(class_name, 
_len+1, 0); \
+   class_container.name = zend_new_interned_string(class_name, 
_len+1, 0 TSRMLS_CC);   \
if (class_container.name == class_name) {   
\
class_container.name = zend_strndup(class_name, _len);  
\
}   
\

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php