Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

PHP mysqlnd svn commit: r505 - in trunk/php5/ext: mysql mysqli

From: <ahristov(at)mysql.com>
Date: Tue Jun 26 2007 - 15:45:25 EDT


Author: ahristov
Date: 2007-06-26 21:45:25 +0200 (Tue, 26 Jun 2007) New Revision: 505

Modified:

   trunk/php5/ext/mysql/config.m4
   trunk/php5/ext/mysql/mysql_mysqlnd.h
   trunk/php5/ext/mysql/php_mysql.c
   trunk/php5/ext/mysqli/config9.m4
   trunk/php5/ext/mysqli/php_mysqli.h

Log:
patches by Jani Taskinen to change building and make ext/mysql build together with ext/mysqli . NEW SYNTAX :
--with-mysql=mysqlnd|/path/to/mysql
--with-mysqli=mysqlnd|/pato/to/mysql_config

So one can build only one of the extensions with libmysql, if he wishes. Now we say truth in one of our slides.

Modified: trunk/php5/ext/mysql/config.m4


  • trunk/php5/ext/mysql/config.m4 2007-06-26 13:36:34 UTC (rev 504) +++ trunk/php5/ext/mysql/config.m4 2007-06-26 19:45:25 UTC (rev 505)
    @@ -40,42 +40,22 @@

 PHP_ARG_WITH(mysql, for MySQL support,

-[  --with-mysql[=DIR]      Include MySQL support. DIR is the MySQL base directory])
+[  --with-mysql[=DIR]        Include MySQL support. DIR is the MySQL base directory.
+                            If mysqlnd is passed as DIR, the MySQL native driver will be used])
 

 PHP_ARG_WITH(mysql-sock, for specified location of the MySQL UNIX socket,  [ --with-mysql-sock[=DIR] MySQL: Location of the MySQL unix socket pointer.

                             If unspecified, the default locations are searched], no, no)
 
-PHP_ARG_ENABLE(mysqlnd, wheter to enable MySQL native driver support,
-[ --enable-mysqlnd Enable MySQL native driver supprt], no, no) -
 if test -z "$PHP_ZLIB_DIR"; then
   PHP_ARG_WITH(zlib-dir, for the location of libz,    [ --with-zlib-dir[=DIR] MySQL: Set the path to libz install prefix], no, no)  fi  
-if test "$PHP_MYSQL" != "no"; then
-  AC_DEFINE(HAVE_MYSQL, 1, [Whether you have MySQL])
-  sources="php_mysql.c"
-fi
+if test "$PHP_MYSQL" = "mysqlnd"; then

+ dnl enables build of mysqnd library
+ PHP_MYSQLND_ENABLED=yes  
-if test "$PHP_MYSQLND" = "yes"; then
-
-  AC_DEFINE(HAVE_MYSQLND, 1, "MySQL native driver support enabled")
-  MYSQLND_DIR="../mysqli/mysqlnd"
-  extra_sources="php_mysql.c \
-  				 $MYSQLND_DIR/mysqlnd.c \
-				 $MYSQLND_DIR/mysqlnd_charset.c \
-				 $MYSQLND_DIR/mysqlnd_wireprotocol.c \
-                 $MYSQLND_DIR/mysqlnd_ps.c \
-				 $MYSQLND_DIR/mysqlnd_loaddata.c \
-				 $MYSQLND_DIR/mysqlnd_palloc.c \
-				 $MYSQLND_DIR/mysqlnd_ps_codec.c \
-				 $MYSQLND_DIR/mysqlnd_statistics.c \
-				 $MYSQLND_DIR/mysqlnd_qcache.c \
-				 $MYSQLND_DIR/mysqlnd_result.c \
-				 $MYSQLND_DIR/mysqlnd_result_meta.c"
-

 elif test "$PHP_MYSQL" != "no"; then  

   AC_MSG_CHECKING([for MySQL UNIX socket location])
@@ -170,7 +150,15 @@

   PHP_SUBST_OLD(MYSQL_INCLUDE)
 fi  

Do you need help?X

-if test -n "$sources"; then
- PHP_NEW_EXTENSION(mysql, $sources, $ext_shared)

+dnl Enable extension
+if test "$PHP_MYSQL" != "no"; then
+  AC_DEFINE(HAVE_MYSQL, 1, [Whether you have MySQL])
+  PHP_NEW_EXTENSION(mysql, php_mysql.c, $ext_shared)

   PHP_SUBST(MYSQL_SHARED_LIBADD)

+
+  dnl These 3 lines are neeeded to be able to build ext/mysql and/or ext/mysqli with/without mysqlnd.
+  dnl Need to do this here for the file to be always available.
+  $php_shtool mkdir -p ext/mysql/
Do you need more help?X
+ echo > ext/mysql/php_have_mysqlnd.h + test "$PHP_MYSQL" = "mysqlnd" && PHP_DEFINE(HAVE_MYSQLND, 1, [ext/mysql])
 fi

Modified: trunk/php5/ext/mysql/mysql_mysqlnd.h


  • trunk/php5/ext/mysql/mysql_mysqlnd.h 2007-06-26 13:36:34 UTC (rev 504) +++ trunk/php5/ext/mysql/mysql_mysqlnd.h 2007-06-26 19:45:25 UTC (rev 505)
    @@ -19,6 +19,9 @@

 */  

+#ifndef MYSQL_MYSQLND_H
+#define MYSQL_MYSQLND_H
+
 /* Global types and definitions*/
 #define MYSQL_NO_DATA			MYSQLND_NO_DATA
 #define MYSQL_DATA_TRUNCATED	MYSQLND_DATA_TRUNCATED

@@ -121,3 +124,4 @@
#define mysqli_stmt_close(c, implicit) mysqlnd_stmt_close((c), (implicit)) #define mysqli_free_result(r, implicit) mysqlnd_free_result((r), (implicit))

+#endif

Modified: trunk/php5/ext/mysql/php_mysql.c


  • trunk/php5/ext/mysql/php_mysql.c 2007-06-26 13:36:34 UTC (rev 504) +++ trunk/php5/ext/mysql/php_mysql.c 2007-06-26 19:45:25 UTC (rev 505)
    @@ -66,7 +66,6 @@

 #include "php_ini.h"  

-
 #include "php_mysql.h"  

Can we help you?X

 /* True globals, no need for thread safety */

Modified: trunk/php5/ext/mysqli/config9.m4


  • trunk/php5/ext/mysqli/config9.m4 2007-06-26 13:36:34 UTC (rev 504) +++ trunk/php5/ext/mysqli/config9.m4 2007-06-26 19:45:25 UTC (rev 505)
    @@ -3,32 +3,18 @@
    dnl config.m4 for extension mysqli

 PHP_ARG_WITH(mysqli, for MySQLi support, -[ --with-mysqli[=FILE] Include MySQLi support. FILE is the optional pathname

-                          to mysql_config])
+[  --with-mysqli[=FILE]    Include MySQLi support. FILE is the optional pathname to mysql_config.
+                          If mysqlnd is passed as FILE, the MySQL native driver will be used])
 

 PHP_ARG_ENABLE(embedded_mysqli, whether to enable embedded MySQLi support,  [ --enable-embedded-mysqli MYSQLi: Enable embedded support], no, no)  

-if test -z "$PHP_MYSQLND"; then
-  PHP_ARG_ENABLE(mysqlnd, whether to enable MySQL native driver support,
-  [  --enable-mysqlnd          MYSQLi: Enable MySQL native driver supprt], no, no)
-fi
+if test "$PHP_MYSQLI" = "mysqlnd"; then
+ dnl This needs to be set in any extension which wishes to use mysqlnd + PHP_MYSQLND_ENABLED=yes  
-dnl If some extension uses mysqlnd it will get compiled in PHP whether MYSQLi is enabled or not.
-if test "$PHP_MYSQLND" = "yes"; then
-  AC_DEFINE(HAVE_MYSQLND, 1, [MySQL native driver support enabled])
-  mysqlnd_sources="mysqlnd.c mysqlnd_charset.c mysqlnd_wireprotocol.c \
-                   mysqlnd_ps.c mysqlnd_loaddata.c mysqlnd_palloc.c \
-                   mysqlnd_ps_codec.c mysqlnd_statistics.c mysqlnd_qcache.c\
-				   mysqlnd_result.c mysqlnd_result_meta.c"
+elif test "$PHP_MYSQLI" != "no"; then  
  • PHP_ADD_SOURCES(ext/mysqli/mysqlnd, $mysqlnd_sources)
  • PHP_ADD_BUILD_DIR([ext/mysqli/mysqlnd])
  • PHP_INSTALL_HEADERS([ext/mysqli/mysqlnd]) -fi - -if test "$PHP_MYSQLI" != "no" && test "$PHP_MYSQLND" != "yes"; then - if test "$PHP_MYSQLI" = "yes"; then MYSQL_CONFIG=`$php_shtool path mysql_config` else
    @@ -77,10 +63,31 @@
    extra_sources="$extra_sources mysqli_repl.c" fi

+dnl Build extension
 if test -n "$extra_sources" || test "$PHP_MYSQLI" != "no"; then    mysqli_sources="mysqli.c mysqli_api.c mysqli_prop.c mysqli_nonapi.c \

                   mysqli_fe.c mysqli_report.c mysqli_driver.c mysqli_warning.c \
                   mysqli_exception.c $extra_sources"
   PHP_NEW_EXTENSION(mysqli, $mysqli_sources, $ext_shared)    PHP_SUBST(MYSQLI_SHARED_LIBADD)
+
+  dnl These 3 lines are neeeded to be able to build ext/mysql and/or ext/mysqli with/without mysqlnd.
+  dnl Need to do this here for the file to be always available.
+  $php_shtool mkdir -p ext/mysqli/
+  echo > ext/mysqli/php_have_mysqlnd.h    
Can't find what you're looking for?X
+ test "$PHP_MYSQLI" = "mysqlnd" && PHP_DEFINE(HAVE_MYSQLND, 1, [ext/mysqli])
 fi
+
+dnl MySQLnd build
+dnl If some extension uses mysqlnd it will get compiled in PHP whether MYSQLi is enabled or not.
+if test "$PHP_MYSQLND_ENABLED" = "yes"; then
+  mysqlnd_sources="mysqlnd.c mysqlnd_charset.c mysqlnd_wireprotocol.c \
+                   mysqlnd_ps.c mysqlnd_loaddata.c mysqlnd_palloc.c \
+                   mysqlnd_ps_codec.c mysqlnd_statistics.c mysqlnd_qcache.c\
+				   mysqlnd_result.c mysqlnd_result_meta.c"
+
+  PHP_ADD_SOURCES(ext/mysqli/mysqlnd, $mysqlnd_sources)
+  PHP_ADD_BUILD_DIR([ext/mysqli/mysqlnd])
+  PHP_INSTALL_HEADERS([ext/mysqli/mysqlnd])
+fi
+

Modified: trunk/php5/ext/mysqli/php_mysqli.h


  • trunk/php5/ext/mysqli/php_mysqli.h 2007-06-26 13:36:34 UTC (rev 504) +++ trunk/php5/ext/mysqli/php_mysqli.h 2007-06-26 19:45:25 UTC (rev 505)
    @@ -33,6 +33,10 @@
    #define FALSE 0 #endif
+#ifdef PHP_ATOM_INC
+#include "ext/mysqli/php_have_mysqlnd.h" /* HAVE_MYSQLND is defined here if enabled */
+#endif
+
 #if defined(HAVE_MYSQLND)

 #include "ext/mysqli/mysqlnd/mysqlnd.h"  #include "ext/mysqli/mysqli_mysqlnd.h"
-- 
MySQL Code Commits Mailing List
For list archives: 
http://lists.mysql.com/commits
To unsubscribe:    
http://lists.mysql.com/commits?unsub=lists@pantek.com
Received on Tue Jun 26 15:49:08 2007

This archive was generated by hypermail 2.1.8 : Tue Jun 26 2007 - 15:50:04 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library