From a0cb9d64f650ebf0d45fa9257c29fdc844153c1d Mon Sep 17 00:00:00 2001 From: joyqi Date: Fri, 18 Oct 2013 11:54:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0GAE=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.php | 32 +++++++------- install/Mysql.php | 65 ++++++++++++++++++++++------ install/Pgsql.php | 20 ++++----- install/SQLite.php | 4 +- var/Typecho/Db/Adapter/Pdo/Mysql.php | 3 +- 5 files changed, 81 insertions(+), 43 deletions(-) diff --git a/install.php b/install.php index 213d1b4b..61c186f3 100644 --- a/install.php +++ b/install.php @@ -218,7 +218,7 @@ list($prefixVersion, $suffixVersion) = explode('/', $currentVersion); -

+

@@ -508,8 +508,8 @@ Typecho_Db::set(\$db); ?> @@ -537,18 +537,18 @@ Typecho_Db::set(\$db);

@@ -561,12 +561,12 @@ Typecho_Db::set(\$db);

-

+

GPL 协议发布,我们允许用户在 GPL 协议许可的范围内使用,拷贝,修改和分发此程序. -你可以自由地将其用于商业以及非商业用途.'); ?>

-

+您可以自由地将其用于商业以及非商业用途.'); ?>

+

    diff --git a/install/Mysql.php b/install/Mysql.php index c9cb5348..4994dcb8 100644 --- a/install/Mysql.php +++ b/install/Mysql.php @@ -2,7 +2,7 @@ -

    +

    -

    +

  1. - - + +

  2. + + +

    +
  3. + + +

    +
  4. +
  5. + + +
  6. +
  7. + + +
  8. +
  9. + + +

    +
  10. + + + + + + +
  11. - - + +

  12. - - + +

  13. - - + +

  14. - - + +
  15. - - + +

  16. diff --git a/install/Pgsql.php b/install/Pgsql.php index 0bed2c84..d548fb71 100644 --- a/install/Pgsql.php +++ b/install/Pgsql.php @@ -1,26 +1,26 @@
  17. - - + +

  18. - - + +

  19. - - + +

  20. - - + +
  21. - - + +

  22. diff --git a/install/SQLite.php b/install/SQLite.php index a5600218..ec0fa661 100644 --- a/install/SQLite.php +++ b/install/SQLite.php @@ -1,7 +1,7 @@
  23. - - + +

  24. diff --git a/var/Typecho/Db/Adapter/Pdo/Mysql.php b/var/Typecho/Db/Adapter/Pdo/Mysql.php index d8b26d6e..d2528956 100644 --- a/var/Typecho/Db/Adapter/Pdo/Mysql.php +++ b/var/Typecho/Db/Adapter/Pdo/Mysql.php @@ -37,7 +37,8 @@ class Typecho_Db_Adapter_Pdo_Mysql extends Typecho_Db_Adapter_Pdo */ public function init(Typecho_Config $config) { - $pdo = new PDO("mysql:dbname={$config->database};host={$config->host};port={$config->port}", $config->user, $config->password); + $pdo = new PDO(!empty($config->dsn) ? $config->dsn : + "mysql:dbname={$config->database};host={$config->host};port={$config->port}", $config->user, $config->password); $pdo->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true); $pdo->exec("SET NAMES '{$config->charset}'"); return $pdo;