Skip to content
Snippets Groups Projects
Commit 0d2b4cd3 authored by Demian Katz's avatar Demian Katz
Browse files

Eliminated [GoogleSearch] setting (search API is now deprecated and should no...

Eliminated [GoogleSearch] setting (search API is now deprecated and should no longer be used -- no reason to support in VuFind 2); created central method for storing warnings in \VuFind\Config\Upgrade (for easier debugging, etc.).
parent 7c5ddecc
No related merge requests found
...@@ -413,17 +413,6 @@ url = "http://syndetics.com" ...@@ -413,17 +413,6 @@ url = "http://syndetics.com"
url = "http://contentcafe2.btol.com" url = "http://contentcafe2.btol.com"
pw = "Password" pw = "Password"
; Web Search is Optional. The Web Search is powered by Google.
; To use enter your Google Web Search key and the domain the of your library
; website.
; The side_recommend setting is used to load recommendations modules; see
; searches.ini for a list of options (though not all will work in this context).
; You can set it to false if you do not want to display any recommendations.
;[GoogleSearch]
;key = MyGoogleSearchKey
;domain = library.myuniversity.edu
;side_recommend[] = CatalogResults:lookfor
; Summon is Optional. See also the separate Summon.ini file. ; Summon is Optional. See also the separate Summon.ini file.
;[Summon] ;[Summon]
;apiId = myAccessId ;apiId = myAccessId
......
...@@ -109,6 +109,18 @@ class Upgrade ...@@ -109,6 +109,18 @@ class Upgrade
return $this->warnings; return $this->warnings;
} }
/**
* Add a warning message.
*
* @param string $msg Warning message.
*
* @return void
*/
protected function addWarning($msg)
{
$this->warnings[] = $msg;
}
/** /**
* Support function -- merge the contents of two arrays parsed from ini files. * Support function -- merge the contents of two arrays parsed from ini files.
* *
...@@ -313,10 +325,12 @@ class Upgrade ...@@ -313,10 +325,12 @@ class Upgrade
if (!file_exists(APPLICATION_PATH . '/themes/' . $theme) if (!file_exists(APPLICATION_PATH . '/themes/' . $theme)
|| !is_dir(APPLICATION_PATH . '/themes/' . $theme) || !is_dir(APPLICATION_PATH . '/themes/' . $theme)
) { ) {
$this->warnings[] = "WARNING: This version of VuFind does not support " $this->addWarning(
"WARNING: This version of VuFind does not support "
. "the {$theme} theme. Your config.ini [Site] {$setting} setting " . "the {$theme} theme. Your config.ini [Site] {$setting} setting "
. "has been reset to the default: {$default}. You may need to " . "has been reset to the default: {$default}. You may need to "
. "reimplement your custom theme."; . "reimplement your custom theme."
);
$this->newConfigs['config.ini']['Site'][$setting] = $default; $this->newConfigs['config.ini']['Site'][$setting] = $default;
} }
} }
...@@ -357,19 +371,30 @@ class Upgrade ...@@ -357,19 +371,30 @@ class Upgrade
&& stristr($newConfig['Content']['coverimages'], 'amazon'); && stristr($newConfig['Content']['coverimages'], 'amazon');
if ($hasAmazonReview || $hasAmazonCover) { if ($hasAmazonReview || $hasAmazonCover) {
if (!isset($newConfig['Content']['amazonsecret'])) { if (!isset($newConfig['Content']['amazonsecret'])) {
$this->warnings[] $this->addWarning(
= 'WARNING: You have Amazon content enabled but are missing ' 'WARNING: You have Amazon content enabled but are missing '
. 'the required amazonsecret setting in the [Content] section ' . 'the required amazonsecret setting in the [Content] section '
. 'of config.ini'; . 'of config.ini'
);
} }
if (!isset($newConfig['Content']['amazonassociate'])) { if (!isset($newConfig['Content']['amazonassociate'])) {
$this->warnings[] $this->addWarning(
= 'WARNING: You have Amazon content enabled but are missing ' 'WARNING: You have Amazon content enabled but are missing '
. 'the required amazonassociate setting in the [Content] section' . 'the required amazonassociate setting in the [Content] section'
. ' of config.ini'; . ' of config.ini'
);
} }
} }
// Warn the user if they have enabled a deprecated Google API:
if (isset($newConfig['GoogleSearch'])) {
unset($newConfig['GoogleSearch']);
$this->addWarning(
'The [GoogleSearch] section of config.ini is no '
. 'longer supported due to changes in Google APIs.'
);
}
// Warn the user if they are using an unsupported theme: // Warn the user if they are using an unsupported theme:
$this->checkTheme('theme', 'blueprint'); $this->checkTheme('theme', 'blueprint');
$this->checkTheme('mobile_theme', 'jquerymobile'); $this->checkTheme('mobile_theme', 'jquerymobile');
...@@ -684,10 +709,12 @@ class Upgrade ...@@ -684,10 +709,12 @@ class Upgrade
$driver = isset($this->newConfigs['config.ini']['Catalog']['driver']) $driver = isset($this->newConfigs['config.ini']['Catalog']['driver'])
? $this->newConfigs['config.ini']['Catalog']['driver'] : ''; ? $this->newConfigs['config.ini']['Catalog']['driver'] : '';
if (empty($driver)) { if (empty($driver)) {
$this->warnings[] = "WARNING: Could not find ILS driver setting."; $this->addWarning("WARNING: Could not find ILS driver setting.");
} else if (!file_exists($this->oldDir . '/' . $driver . '.ini')) { } else if (!file_exists($this->oldDir . '/' . $driver . '.ini')) {
$this->warnings[] = "WARNING: Could not find {$driver}.ini file; " $this->addWarning(
. "check your ILS driver configuration."; "WARNING: Could not find {$driver}.ini file; "
. "check your ILS driver configuration."
);
} else { } else {
$this->saveUnmodifiedConfig($driver . '.ini'); $this->saveUnmodifiedConfig($driver . '.ini');
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment