diff --git a/install.php b/install.php index ed3f3266..6a65fcc6 100644 --- a/install.php +++ b/install.php @@ -536,6 +536,16 @@ Typecho_Cookie::set('__typecho_lang', $lang); } if($success) { + // 重置原有数据库状态 + if (isset($installDb)) { + try { + $installDb->query($installDb->update('table.options') + ->rows(array('value' => 0))->where('name = ?', 'installed')); + } catch (Exception $e) { + // do nothing + } + } + Typecho_Cookie::set('__typecho_config', base64_encode(serialize(array_merge(array( 'prefix' => _r('dbPrefix'), 'userName' => _r('userName'), diff --git a/var/Typecho/Date.php b/var/Typecho/Date.php index ed27541d..cbc42c66 100644 --- a/var/Typecho/Date.php +++ b/var/Typecho/Date.php @@ -127,6 +127,6 @@ class Typecho_Date */ public static function time() { - return self::$serverTimeStamp ? self::$serverTimeStamp : (self::$serverTimeStamp = time() - idate('Z')); + return self::$serverTimeStamp ? self::$serverTimeStamp : (self::$serverTimeStamp = time()); } } diff --git a/var/Typecho/Db/Adapter/Mysqli.php b/var/Typecho/Db/Adapter/Mysqli.php index edf99660..5a40bec4 100644 --- a/var/Typecho/Db/Adapter/Mysqli.php +++ b/var/Typecho/Db/Adapter/Mysqli.php @@ -31,7 +31,7 @@ class Typecho_Db_Adapter_Mysqli implements Typecho_Db_Adapter */ public static function isAvailable() { - return extension_loaded('mysqli'); + return class_exists('MySQLi'); } /** diff --git a/var/Typecho/Db/Adapter/Pdo.php b/var/Typecho/Db/Adapter/Pdo.php index 1c1de13c..d1cd9375 100644 --- a/var/Typecho/Db/Adapter/Pdo.php +++ b/var/Typecho/Db/Adapter/Pdo.php @@ -39,7 +39,7 @@ abstract class Typecho_Db_Adapter_Pdo implements Typecho_Db_Adapter */ public static function isAvailable() { - return extension_loaded('pdo'); + return class_exists('PDO'); } /**