Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
joyqi committed Oct 29, 2017
1 parent a214977 commit 93bcd46
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
10 changes: 10 additions & 0 deletions install.php
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,16 @@ function _u() {
}

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'),
Expand Down
2 changes: 1 addition & 1 deletion var/Typecho/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,6 @@ public static function gmtTime()
*/
public static function time()
{
return self::$serverTimeStamp ? self::$serverTimeStamp : (self::$serverTimeStamp = time() - idate('Z'));
return self::$serverTimeStamp ? self::$serverTimeStamp : (self::$serverTimeStamp = time());
}
}
2 changes: 1 addition & 1 deletion var/Typecho/Db/Adapter/Mysqli.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion var/Typecho/Db/Adapter/Pdo.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

/**
Expand Down

0 comments on commit 93bcd46

Please sign in to comment.