[textpattern commit] r2980 - in development/4.0/textpattern: . lib setup

0 views
Skip to first unread message

codesite...@google.com

unread,
Oct 2, 2008, 12:29:46 PM10/2/08
to txp...@googlegroups.com
Author: r.wetzlmayr
Date: Thu Oct 2 09:28:49 2008
New Revision: 2980

Modified:
development/4.0/textpattern/config-dist.php
development/4.0/textpattern/lib/txplib_db.php
development/4.0/textpattern/setup/index.php
development/4.0/textpattern/setup/txpsql.php

Log:
Support for MySQL SSL connections. Props Sam.

Modified: development/4.0/textpattern/config-dist.php
==============================================================================
--- development/4.0/textpattern/config-dist.php (original)
+++ development/4.0/textpattern/config-dist.php Thu Oct 2 09:28:49 2008
@@ -34,9 +34,15 @@
$txpcfg['txpath'] = '/home/path/to/textpattern';

/**
- * DB Connetion Charset, only for MySQL4.1 and up. Must be equal to the
Table-Charset.
+ * DB Connection Charset, only for MySQL4.1 and up. Must be equal to the
Table-Charset.
*/

$txpcfg['dbcharset'] = 'latin1';
+
+ /**
+ * optional: database client flags as needed (@see
http://www.php.net/manual/function.mysql-connect.php)
+ */
+
+ # $txpcfg['client_flags'] = MYSQL_CLIENT_SSL | MYSQL_CLIENT_COMPRESS;

?>

Modified: development/4.0/textpattern/lib/txplib_db.php
==============================================================================
--- development/4.0/textpattern/lib/txplib_db.php (original)
+++ development/4.0/textpattern/lib/txplib_db.php Thu Oct 2 09:28:49 2008
@@ -21,9 +21,10 @@
$this->host = $txpcfg['host'];
$this->db = $txpcfg['db'];
$this->user = $txpcfg['user'];
- $this->pass = $txpcfg['pass'];
+ $this->pass = $txpcfg['pass'];
+ $this->client_flags = isset($txpcfg['client_flags']) ?
$txpcfg['client_flags'] : 0;

- $this->link = @mysql_connect($this->host, $this->user, $this->pass);
+ $this->link = @mysql_connect($this->host, $this->user, $this->pass,
false, $this->client_flags);
if (!$this->link) die(db_down());

$this->version = mysql_get_server_info();

Modified: development/4.0/textpattern/setup/index.php
==============================================================================
--- development/4.0/textpattern/setup/index.php (original)
+++ development/4.0/textpattern/setup/index.php Thu Oct 2 09:28:49 2008
@@ -175,10 +175,12 @@

echo graf(gTxt("checking_database"));

- if (!($mylink = mysql_connect($dhost,$duser,$dpass)))
- {
+ if (($mylink = mysql_connect($dhost, $duser, $dpass)))
+ $carry['dclient_flags'] = 0;
+ elseif (($mylink = mysql_connect($dhost, $duser, $dpass, false,
MYSQL_CLIENT_SSL)))
+ $carry['dclient_flags'] = 'MYSQL_CLIENT_SSL';
+ else
exit(graf(gTxt('db_cant_connect')));
- }

echo graf(gTxt('db_connected'));

@@ -310,6 +312,7 @@
$duser = $txpcfg['user'];
$dpass = $txpcfg['pass'];
$dhost = $txpcfg['host'];
+ $dclient_flags = isset($txpcfg['client_flags']) ?
$txpcfg['client_flags'] : 0;
$dprefix = $txpcfg['table_prefix'];
$dbcharset = $txpcfg['dbcharset'];

@@ -354,6 +357,7 @@
.o.'user' .m.$duser.nl
.o.'pass' .m.$dpass.nl
.o.'host' .m.$dhost.nl
+ .($dclient_flags ? o.'client_flags'."'] = ".$dclient_flags.";\n" : '')
.o.'table_prefix' .m.$dprefix.nl
.o.'txpath' .m.txpath.nl // remove in crockery
.o.'dbcharset' .m.$dbcharset.nl

Modified: development/4.0/textpattern/setup/txpsql.php
==============================================================================
--- development/4.0/textpattern/setup/txpsql.php (original)
+++ development/4.0/textpattern/setup/txpsql.php Thu Oct 2 09:28:49 2008
@@ -12,7 +12,7 @@
@ignore_user_abort(1);
@set_time_limit(0);

-mysql_connect($dhost,$duser,$dpass);
+mysql_connect($dhost,$duser,$dpass,false,$dclient_flags);
mysql_select_db($ddb);

$result = mysql_query("describe `".PFX."textpattern`");

Reply all
Reply to author
Forward
0 new messages