Skip to content

Commit

Permalink
finish gae install
Browse files Browse the repository at this point in the history
  • Loading branch information
joyqi committed Apr 25, 2014
1 parent 59a6a52 commit 2e26899
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions install.php
Original file line number Diff line number Diff line change
Expand Up @@ -471,12 +471,14 @@ function _u() {
$key = '{' . $key . '}';
}

if (!empty($_dbConfig['dbDsn'])) {
$dbConfig['dsn'] = str_replace($replace, array_values($dbConfig), $dbConfig['dsn']);
}
$config = str_replace($replace, array_values($dbConfig), _r('config'));
$dbConfig['dsn'] = str_replace($replace, array_values($dbConfig), $dbConfig['dsn']);
}

if (!isset($config) && $success && !_r('created')) {
$installDb = new Typecho_Db ($adapter, _r('dbPrefix'));
$installDb = new Typecho_Db($adapter, _r('dbPrefix'));
$installDb->addServer($dbConfig, Typecho_Db::READ | Typecho_Db::WRITE);


Expand Down
6 changes: 3 additions & 3 deletions install/Mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@
<li>
<label class="typecho-label" for="dbHost"><?php _e('数据库实例名'); ?></label>
<input type="text" class="text" name="dbHost" id="dbHost" value="<?php _v('dbHost'); ?>"/>
<p class="description"><?php _e('请填入您在Cloud SQL面板中创建的数据库实例名称,示例:<em class="warning">/cloudsql/typecho-gae:typecho</em>'); ?></p>
<p class="description"><?php _e('请填入您在Cloud SQL面板中创建的数据库实例名称, 示例: %s', '<em class="warning">/cloudsql/typecho-gae:typecho</em>'); ?></p>
</li>
<?php else: ?>
<li>
<label class="typecho-label" for="dbHost"><?php _e('数据库实例名'); ?></label>
<input type="text" class="text" name="dbHost" id="dbHost" value="<?php _v('dbHost'); ?>"/>
<p class="description"><?php _e('请填入您在Cloud SQL面板中创建的数据库实例名称,示例:<em class="warning">:/cloudsql/typecho-gae:typecho</em>'); ?></p>
<p class="description"><?php _e('请填入您在Cloud SQL面板中创建的数据库实例名称, 示例: %s', '<em class="warning">:/cloudsql/typecho-gae:typecho</em>'); ?></p>
</li>
<?php endif; ?>

Expand All @@ -130,7 +130,7 @@
<?php if (0 === strpos($adapter, 'Pdo_')): ?>
<input type="hidden" name="dbDsn" value="mysql:dbname={database};unix_socket={host};charset=<?php _e('utf8'); ?>" />
<input type="hidden" name="config" value="array (
'dsn' => 'mysql:dbname={database};unix_socket={host};charset=<?php _e('utf8'); ?>',
'dsn' => '{dsn}',
'user' => '{user}',
'password' => '{password}'
)" />
Expand Down

0 comments on commit 2e26899

Please sign in to comment.