Skip to content

Commit

Permalink
Fixed installer errors where migration failed with a compressed file
Browse files Browse the repository at this point in the history
  • Loading branch information
mystralkk committed Nov 27, 2016
1 parent 7fb64ef commit a90f959
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 28 deletions.
31 changes: 15 additions & 16 deletions public_html/admin/install/classes/installer.class.php
Expand Up @@ -295,12 +295,15 @@ private function checkUploadedFileSize()

/**
* Check if any message for upgrades, exit the installer
*
* @param string $version
* @return string
*/
private function checkUpgradeMessage($version)
{
$retval = '';

if (($this->doDatabaseUpgrades($version, true)) && (!empty($this->upgradeMessages))) {
if ($this->doDatabaseUpgrades($version, true) && !empty($this->upgradeMessages)) {
$prompt = 'information';
$retval = '<h1 class="heading">' . $this->LANG['ERROR'][14] . '</h1>' . PHP_EOL; // Upgrade Notice

Expand All @@ -310,8 +313,8 @@ private function checkUpgradeMessage($version)
$retval .= $this->getAlertMessage($this->LANG['ERROR'][$message_id], $type);

// record what type of prompt we need
if ($type == 'information' || $type == 'warning' || $type == 'error') {
if ($prompt != 'error') {
if ($type === 'information' || $type === 'warning' || $type === 'error') {
if ($prompt !== 'error') {
if ($prompt == 'information') {
$prompt = $type;
}
Expand All @@ -321,7 +324,7 @@ private function checkUpgradeMessage($version)
}

// Add prompt
if ($prompt == 'error') {
if ($prompt === 'error') {
$retval .= MicroTemplate::quick(PATH_LAYOUT, 'upgrade_prompt_error', $this->env);
} else {
$retval .= MicroTemplate::quick(PATH_LAYOUT, 'upgrade_prompt_warning', $this->env); }
Expand Down Expand Up @@ -4223,7 +4226,7 @@ private function migrateStep4()
*/
private function installEngine($installType, $installStep)
{
global $_CONF, $_TABLES, $_DB, $_DB_dbms, $_DB_host, $_DB_name, $_DB_user, $_DB_pass, $_DB_table_prefix;
global $_CONF, $_TABLES, $_DB, $_DB_dbms, $_DB_host, $_DB_name, $_DB_user, $_DB_pass, $_DB_table_prefix, $_DEVICE, $_URL;

$retval = '';

Expand All @@ -4235,7 +4238,7 @@ private function installEngine($installType, $installStep)
break;
}

require_once $this->env['dbconfig_path']; // Get the current DB info
include $this->env['dbconfig_path']; // Get the current DB info

if ($installType === 'upgrade') {
$v = $this->checkPost150Upgrade($this->env['dbconfig_path'], $this->env['siteconfig_path']);
Expand Down Expand Up @@ -4456,22 +4459,23 @@ private function installEngine($installType, $installStep)
}
}

require_once $this->env['dbconfig_path'];
require $this->env['dbconfig_path'];
require_once $this->env['siteconfig_path'];
require_once $_CONF['path_system'] . 'lib-database.php';

$params = array(
'mode' => $installType,
'step' => 3,
'dbconfig_path' => $this->env['dbconfig_path'],
'install_plugins' => $installPlugins,
'install_plugins' => ($installPlugins ? 'true' : 'false'),
'language' => $this->env['language'],
'site_name' => $site_name,
'site_slogan' => $site_slogan,
'site_url' => $site_url,
'site_admin_url' => $site_admin_url,
'site_mail' => $site_mail,
'noreply_mail' => $noreply_mail,
'upgrade_check' => $this->post('upgrade_check', 'continue'),
);

if ($utf8) {
Expand Down Expand Up @@ -4501,7 +4505,6 @@ private function installEngine($installType, $installStep)
break;

case 'upgrade':

// Try and find out what the current version of GL is
$currentVersion = $this->identifyGeeklogVersion();

Expand All @@ -4521,7 +4524,6 @@ private function installEngine($installType, $installStep)

// If we were unable to determine the current GL
// version is then ask the user what it is

$this->env['old_versions'] = array();
$old_versions = array(
'1.2.5-1', '1.3', '1.3.1', '1.3.2', '1.3.2-1', '1.3.3', '1.3.4',
Expand Down Expand Up @@ -4558,7 +4560,7 @@ private function installEngine($installType, $installStep)
}

$gl_path = str_replace(self::DB_CONFIG_FILE, '', $this->env['dbconfig_path']);
$installPlugins = ($this->request('install_plugins') !== null);
$installPlugins = ($this->request('install_plugins') === 'true');
$nextLink = $installPlugins
? 'install-plugins.php?language=' . $this->env['language']
: 'success.php?type=' . $installType . '&language=' . $this->env['language'];
Expand Down Expand Up @@ -4647,7 +4649,6 @@ private function installEngine($installType, $installStep)
$config->set('path_themes', $this->env['html_path'] . 'layout/');
$config->set('path_editors', $this->env['html_path'] . 'editors/');
$config->set('rdf_file', $this->env['html_path'] . 'backend/geeklog.rss');
$config->set('path_pear', $_CONF['path_system'] . 'pear/');
$config->set('cookie_path', $this->guessCookiePath(urldecode($site_url)));
$config->set_default('default_photo', urldecode($site_url) . '/default.jpg');

Expand All @@ -4669,9 +4670,7 @@ private function installEngine($installType, $installStep)
* things and rely on a few global declarations
* (see beginning of function).
*/

// Hack: not needed here - avoid notice
require_once dirname(__FILE__) . '/../../../lib-common.php';
require str_replace('siteconfig.php', 'lib-common.php', $this->env['siteconfig_path']);
$this->defaultPluginInstall();
}

Expand Down Expand Up @@ -4778,7 +4777,7 @@ private function installEngine($installType, $installStep)
}

$this->upgradePlugins();
$installPlugins = ($this->get('install_plugins', null) !== null);
$installPlugins = ($this->get('install_plugins') === 'true');

if (!$installPlugins) {
// if we don't do the manual selection, install all new plugins now
Expand Down
16 changes: 8 additions & 8 deletions public_html/admin/install/language/japanese_utf-8.php
Expand Up @@ -254,25 +254,25 @@
// install-plugins.php

$LANG_PLUGINS = array(
1 => 'プラグインインストール',
1 => 'プラグインのインストール',
2 => 'ステップ',
3 => '検索オプションのプラグインやアドオンコンポーネントは、新しい機能を活用した記事の内部サービスを提供しています。デフォルトでは、検索オプションでは、インストールしたい場合は、いくつか便利なプラグインが含まれています。',
3 => 'プラグインは新しい機能を提供する追加コンポーネントで、Geeklogの内部サービスを更に強化します。Geeklogはデフォルトでインストールしたくなる便利なプラグインを同梱しています。',
4 => 'また、追加のプラグインをアップロードすることができます。',
5 => 'アップロードしたファイルは ZIP または GZip 圧縮形式のプラグインファイルではありません。',
6 => 'アップロードしたプラグインはすでに存在しています!',
7 => '成功!',
8 => '%s プラグインのアップロードに成功しました。',
9 => 'プラグインアップロード',
10 => 'プラグインファイル選択',
9 => 'プラグインをアップロードする',
10 => 'プラグインファイルの指定',
11 => 'アップロード',
12 => 'インストールプラグイン選択',
13 => 'インストール?',
14 => 'プラグイン',
12 => 'インストールするプラグインを選択してください',
13 => 'インストールする',
14 => 'プラグイン名',
15 => 'バージョン',
16 => '不明',
17 => '注意',
18 => 'このプラグインは、プラグイン管理パネルから手動で有効化する必要があります。',
19 => 'リフレッシュ',
19 => '一覧を更新',
20 => '新しいプラグインはありません。'
);

Expand Down
4 changes: 0 additions & 4 deletions public_html/lib-common.php
Expand Up @@ -33,8 +33,6 @@
// | |
// +---------------------------------------------------------------------------+

global $_CONF, $_TABLES;

// Prevent PHP from reporting uninitialized variables
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR);

Expand Down Expand Up @@ -160,8 +158,6 @@
*
* @global $_PLUGINS array of the names of active plugins
*/
global $_PLUGINS;

require_once $_CONF['path_system'] . 'lib-plugins.php';

/**
Expand Down

0 comments on commit a90f959

Please sign in to comment.