List:Commits« Previous MessageNext Message »
From:uwendel Date:April 17 2007 12:05pm
Subject:PHP mysqlnd svn commit: r325 - trunk/tests/ext/mysqli/bench/framework
View as plain text  
Author: uwendel
Date: 2007-04-17 12:05:50 +0200 (Tue, 17 Apr 2007)
New Revision: 325

Modified:
   trunk/tests/ext/mysqli/bench/framework/config.php
   trunk/tests/ext/mysqli/bench/framework/main.php
   trunk/tests/ext/mysqli/bench/framework/rb_main.php
Log:
Fixed config to be able to use run-bench.php environment settings also for the
microbenchmarks. Added dump of config settings to the run script. 


Modified: trunk/tests/ext/mysqli/bench/framework/config.php
===================================================================
--- trunk/tests/ext/mysqli/bench/framework/config.php	2007-04-02 13:39:24 UTC (rev 324)
+++ trunk/tests/ext/mysqli/bench/framework/config.php	2007-04-17 10:05:50 UTC (rev 325)
@@ -9,54 +9,71 @@
 // PHP binaries to use
 //
 $rb_binaries = array(
-  'mysqli'        =>
'/home/andrey/dev/non_cpp_mysqlnd/php6.0-200702150930/sapi/cli/php',  
-  'mysqlnd'       => '/home/andrey/dev/php6/sapi/cli/php',
+  'mysqli'        => '/home/nixnutz/php6_mysqli/sapi/cli/php',  
+  'mysqlnd'       => '/home/nixnutz/php6_mysqlnd/sapi/cli/php',
 );
 
-//
-// Database connection parameter
-//
 
-// database user
-define('RB_DB_USER', 'foo');
-// database password
-define('RB_DB_PASSWD', 'bar');
-// database 
-define('RB_DB_DB', 'test');
-// host, for mysqlnd: localhost = socket, 127.0.0.1 = tcp/ip
-define('RB_DB_HOST', '127.0.0.1');
-// port
-define('RB_DB_PORT', 3306);
-// socket
-define('RB_DB_SOCKET', NULL);
-// database engine
-define('RB_DB_ENGINE', 'InnoDB');
+if (!RB_USE_ENV) {
 
+  //
+  // Database connection parameter
+  //
 
-// WARNING, run-tests.php can overrule the above settings!
-// .. which is handy for dev environments ;)
-if (RB_USE_ENV) {
+  // database user
+  define('RB_DB_USER', 'root');
+  // database password
+  define('RB_DB_PASSWD', '');
+  // database 
+  define('RB_DB_DB', 'test');
+  // host, for mysqlnd: localhost = socket, 127.0.0.1 = tcp/ip
+  define('RB_DB_HOST', '127.0.0.1');
+  // port
+  define('RB_DB_PORT', 3306);
+  // socket
+  define('RB_DB_SOCKET', NULL);
+  // database engine
+  define('RB_DB_ENGINE', 'InnoDB');
+
+} else {
+
+  // let the environment define the settings
   
   if ($tmp = getenv('MYSQL_TEST_USER'))
     define('RB_DB_USER', $tmp);
+  else
+    define('RB_DB_USER', 'root');
     
   if ($tmp = getenv('MYSQL_TEST_PASSWD'))
     define('RB_DB_PASSWD', $tmp);
+  else
+    define('RB_DB_PASSWD', '');
+
     
   if ($tmp = getenv('MYSQL_TEST_DB'))
     define('RB_DB_DB', $tmp);
+  else
+     define('RB_DB_DB', 'test');
     
   if ($tmp = getenv('MYSQL_TEST_HOST'))
     define('RB_DB_HOST', $tmp);
+  else
+    define('RB_DB_HOST', '127.0.0.1');
     
   if ($tmp = getenv('MYSQL_TEST_PORT'))
     define('RB_DB_PORT', $tmp);
+  else
+    define('RB_DB_PORT', 3306);
     
   if ($tmp = getenv('MYSQL_TEST_SOCKET'))
-    define('RB_TEST_SOCKET', $tmp);
+    define('RB_DB_SOCKET', $tmp);
+  else
+    define('RB_DB_SOCKET', NULL);
     
   if ($tmp = getenv('MYSQL_TEST_ENGINE'))
-    define('RB_TEST_ENGINE', $tmp);
+    define('RB_DB_ENGINE', $tmp);
+  else 
+    define('RB_DB_ENGINE', 'InnoDB');
 }
 
 //

Modified: trunk/tests/ext/mysqli/bench/framework/main.php
===================================================================
--- trunk/tests/ext/mysqli/bench/framework/main.php	2007-04-02 13:39:24 UTC (rev 324)
+++ trunk/tests/ext/mysqli/bench/framework/main.php	2007-04-17 10:05:50 UTC (rev 325)
@@ -6,6 +6,7 @@
   
   $rb = new rb_main('My test run label', date('Y-m-d H:i:s'));
   $rb->parseArgs($argc, $argv);
+  printf("Config:\n%s\n", implode("\n", $rb->getConfig()));
   $rb->runTests(true);
   
 } catch (Exception $e) {
@@ -16,4 +17,4 @@
   exit(1);
 }
 exit(0);
-?>
\ No newline at end of file
+?>

Modified: trunk/tests/ext/mysqli/bench/framework/rb_main.php
===================================================================
--- trunk/tests/ext/mysqli/bench/framework/rb_main.php	2007-04-02 13:39:24 UTC (rev 324)
+++ trunk/tests/ext/mysqli/bench/framework/rb_main.php	2007-04-17 10:05:50 UTC (rev 325)
@@ -149,6 +149,20 @@
       throw new Exception(sprintf("No benchmark files found!\n"));
        
   }
+
+
+  public function getConfig() {
+
+    return array(
+        'RB_DB_USER'     => RB_DB_USER,
+        'RB_DB_PASSWD'   => RB_DB_PASSWD,
+        'RB_DB_DB'       => RB_DB_DB,
+        'RB_DB_HOST'     => RB_DB_HOST,
+        'RB_DB_PORT'     => RB_DB_PORT,
+        'RB_DB_SOCKET'   => RB_DB_SOCKET,
+        'RB_DB_ENGINE'   => RB_DB_ENGINE,
+    );
+  }
      
   
   public function getCommandlineSyntax() {

Thread
PHP mysqlnd svn commit: r325 - trunk/tests/ext/mysqli/bench/frameworkuwendel17 Apr