Upgrade
in package
Class to upgrade previous VuFind configurations to the current version
Tags
Table of Contents
- $comments : array<string|int, mixed>
- Comments parsed from configuration files
- $from : string
- Version we're upgrading from
- $inPlaceUpgrade : bool
- Are we upgrading files in place rather than creating them?
- $newConfigs : array<string|int, mixed>
- Processed new configurations
- $newDir : string
- Directory where new configurations should be written (null for test mode)
- $oldConfigs : array<string|int, mixed>
- Parsed old configurations
- $oldDir : string
- Directory containing configurations to upgrade
- $permissionsModified : bool
- Have we modified permissions.ini?
- $rawDir : string
- Directory containing unmodified new configurations
- $to : string
- Version we're upgrading to
- $warnings : array<string|int, mixed>
- Warnings generated during upgrade process
- __construct() : mixed
- Constructor
- getNewConfigs() : array<string|int, mixed>
- Get processed configurations (used by test routines).
- getWarnings() : array<string|int, mixed>
- Get warning strings generated during upgrade process.
- iniMerge() : array<string|int, mixed>
- Support function -- merge the contents of two arrays parsed from ini files.
- run() : void
- Run through all of the necessary upgrading.
- addWarning() : void
- Add a warning message.
- applyOldSettings() : void
- Apply settings from an old configuration to a new configuration.
- changeArrayKey() : array<string|int, mixed>
- Change an array key.
- checkAmazonConfig() : void
- Add warnings if Amazon problems were found.
- checkTheme() : void
- Check for invalid theme setting.
- extractComments() : array<string|int, mixed>
- Read the specified file and return an associative array of this format containing all comments extracted from the file:
- fileContainsMeaningfulLines() : bool
- Does the specified properties file contain any meaningful (non-empty/non-comment) lines?
- getOldConfigPath() : string
- Find the path to the old configuration file.
- isDefaultBulkExportOptions() : bool
- Is this a default BulkExport options setting?
- loadConfigs() : void
- Load all of the user's existing configurations.
- loadOldBaseConfig() : void
- Load the old config.ini settings.
- renameFacet() : void
- Support method for upgradeFacetsAndCollection() - change the name of a facet field.
- saveModifiedConfig() : void
- Save a modified configuration file.
- saveUnmodifiedConfig() : void
- Save an unmodified configuration file -- copy the old version, unless it is the same as the new version!
- upgradeAdminPermissions() : void
- Translate obsolete permission settings.
- upgradeAuthority() : void
- Upgrade authority.ini.
- upgradeAutocompleteName() : string
- Update an old VuFind 1.x-style autocomplete handler name to the new style.
- upgradeConfig() : void
- Upgrade config.ini.
- upgradeFacetsAndCollection() : void
- Upgrade facets.ini and Collection.ini (since these are tied together).
- upgradeFulltext() : void
- Upgrade fulltext.ini.
- upgradeILS() : void
- Upgrade ILS driver configuration.
- upgradePrimo() : void
- Upgrade Primo.ini.
- upgradePrimoPermissions() : void
- Translate obsolete permission settings.
- upgradePrimoServerSettings() : void
- Translate obsolete server settings.
- upgradeReserves() : void
- Upgrade reserves.ini.
- upgradeSearches() : void
- Upgrade searches.ini.
- upgradeSearchSpecs() : void
- Upgrade .yaml configurations.
- upgradeShardSettings() : void
- Upgrade shard settings (they have moved to a different config file, so this is handled as a separate method so that all affected settings are addressed in one place.
- upgradeSitemap() : void
- Upgrade sitemap.ini.
- upgradeSms() : void
- Upgrade sms.ini.
- upgradeSolrMarc() : void
- Upgrade SolrMarc configurations.
- upgradeSpellingSettings() : void
- Upgrade spelling settings to account for refactoring of spelling as a recommendation module starting in release 2.4.
- upgradeSummon() : void
- Upgrade Summon.ini.
- upgradeSummonPermissions() : void
- Translate obsolete permission settings.
- upgradeWorldCat() : void
- Upgrade WorldCat.ini.
Properties
$comments
Comments parsed from configuration files
protected
array<string|int, mixed>
$comments
= []
$from
Version we're upgrading from
protected
string
$from
$inPlaceUpgrade
Are we upgrading files in place rather than creating them?
protected
bool
$inPlaceUpgrade
$newConfigs
Processed new configurations
protected
array<string|int, mixed>
$newConfigs
= []
$newDir
Directory where new configurations should be written (null for test mode)
protected
string
$newDir
$oldConfigs
Parsed old configurations
protected
array<string|int, mixed>
$oldConfigs
= []
$oldDir
Directory containing configurations to upgrade
protected
string
$oldDir
$permissionsModified
Have we modified permissions.ini?
protected
bool
$permissionsModified
= false
$rawDir
Directory containing unmodified new configurations
protected
string
$rawDir
$to
Version we're upgrading to
protected
string
$to
$warnings
Warnings generated during upgrade process
protected
array<string|int, mixed>
$warnings
= []
Methods
__construct()
Constructor
public
__construct(string $from, string $to, string $oldDir, string $rawDir[, string $newDir = null ]) : mixed
Parameters
- $from : string
-
Version we're upgrading from.
- $to : string
-
Version we're upgrading to.
- $oldDir : string
-
Directory containing old configurations.
- $rawDir : string
-
Directory containing raw new configurations.
- $newDir : string = null
-
Directory to write updated new configurations into (leave null to disable writes -- used in test mode).
Return values
mixed —getNewConfigs()
Get processed configurations (used by test routines).
public
getNewConfigs() : array<string|int, mixed>
Return values
array<string|int, mixed> —getWarnings()
Get warning strings generated during upgrade process.
public
getWarnings() : array<string|int, mixed>
Return values
array<string|int, mixed> —iniMerge()
Support function -- merge the contents of two arrays parsed from ini files.
public
static iniMerge(string $config_ini, string $custom_ini) : array<string|int, mixed>
Parameters
- $config_ini : string
-
The base config array.
- $custom_ini : string
-
Overrides to apply on top of the base array.
Return values
array<string|int, mixed> —The merged results.
run()
Run through all of the necessary upgrading.
public
run() : void
Return values
void —addWarning()
Add a warning message.
protected
addWarning(string $msg) : void
Parameters
- $msg : string
-
Warning message.
Return values
void —applyOldSettings()
Apply settings from an old configuration to a new configuration.
protected
applyOldSettings(string $filename[, array<string|int, mixed> $fullSections = [] ]) : void
Parameters
- $filename : string
-
Name of the configuration being updated.
- $fullSections : array<string|int, mixed> = []
-
Array of section names that need to be fully overridden (as opposed to overridden on a setting-by-setting basis).
Return values
void —changeArrayKey()
Change an array key.
protected
changeArrayKey(array<string|int, mixed> $array, string $old, string $new) : array<string|int, mixed>
Parameters
- $array : array<string|int, mixed>
-
Array to rewrite
- $old : string
-
Old key name
- $new : string
-
New key name
Return values
array<string|int, mixed> —checkAmazonConfig()
Add warnings if Amazon problems were found.
protected
checkAmazonConfig(array<string|int, mixed> $config) : void
Parameters
- $config : array<string|int, mixed>
-
Configuration to check
Return values
void —checkTheme()
Check for invalid theme setting.
protected
checkTheme(string $setting[, string $default = null ]) : void
Parameters
- $setting : string
-
Name of setting in [Site] section to check.
- $default : string = null
-
Default value to use if invalid option was found.
Return values
void —extractComments()
Read the specified file and return an associative array of this format containing all comments extracted from the file:
protected
extractComments(string $filename) : array<string|int, mixed>
[ 'sections' => array 'section_name_1' => array 'before' => string ("Comments found at the beginning of this section") 'inline' => string ("Comments found at the end of the section's line") 'settings' => array 'setting_name_1' => array 'before' => string ("Comments found before this setting") 'inline' => string ("Comments found at the end of setting's line") ... 'setting_name_n' => array (same keys as setting_name_1) ... 'section_name_n' => array (same keys as section_name_1) 'after' => string ("Comments found at the very end of the file") ]
Parameters
- $filename : string
-
Name of ini file to read.
Return values
array<string|int, mixed> —Associative array as described above.
fileContainsMeaningfulLines()
Does the specified properties file contain any meaningful (non-empty/non-comment) lines?
protected
fileContainsMeaningfulLines(string $src) : bool
Parameters
- $src : string
-
File to check
Return values
bool —getOldConfigPath()
Find the path to the old configuration file.
protected
getOldConfigPath(string $filename) : string
Parameters
- $filename : string
-
Filename of configuration file.
Return values
string —isDefaultBulkExportOptions()
Is this a default BulkExport options setting?
protected
isDefaultBulkExportOptions(string $eo) : bool
Parameters
- $eo : string
-
Bulk export options
Return values
bool —loadConfigs()
Load all of the user's existing configurations.
protected
loadConfigs() : void
Return values
void —loadOldBaseConfig()
Load the old config.ini settings.
protected
loadOldBaseConfig() : void
Return values
void —renameFacet()
Support method for upgradeFacetsAndCollection() - change the name of a facet field.
protected
renameFacet(string $old, string $new) : void
Parameters
- $old : string
-
Old field name
- $new : string
-
New field name
Return values
void —saveModifiedConfig()
Save a modified configuration file.
protected
saveModifiedConfig(string $filename) : void
Parameters
- $filename : string
-
Name of config file to write (contents will be pulled from current state of object properties).
Tags
Return values
void —saveUnmodifiedConfig()
Save an unmodified configuration file -- copy the old version, unless it is the same as the new version!
protected
saveUnmodifiedConfig(string $filename) : void
Parameters
- $filename : string
-
Path to the old config file
Tags
Return values
void —upgradeAdminPermissions()
Translate obsolete permission settings.
protected
upgradeAdminPermissions() : void
Return values
void —upgradeAuthority()
Upgrade authority.ini.
protected
upgradeAuthority() : void
Tags
Return values
void —upgradeAutocompleteName()
Update an old VuFind 1.x-style autocomplete handler name to the new style.
protected
upgradeAutocompleteName(string $name) : string
Parameters
- $name : string
-
Name of module.
Return values
string —upgradeConfig()
Upgrade config.ini.
protected
upgradeConfig() : void
Tags
Return values
void —upgradeFacetsAndCollection()
Upgrade facets.ini and Collection.ini (since these are tied together).
protected
upgradeFacetsAndCollection() : void
Tags
Return values
void —upgradeFulltext()
Upgrade fulltext.ini.
protected
upgradeFulltext() : void
Tags
Return values
void —upgradeILS()
Upgrade ILS driver configuration.
protected
upgradeILS() : void
Tags
Return values
void —upgradePrimo()
Upgrade Primo.ini.
protected
upgradePrimo() : void
Tags
Return values
void —upgradePrimoPermissions()
Translate obsolete permission settings.
protected
upgradePrimoPermissions() : void
Return values
void —upgradePrimoServerSettings()
Translate obsolete server settings.
protected
upgradePrimoServerSettings() : void
Return values
void —upgradeReserves()
Upgrade reserves.ini.
protected
upgradeReserves() : void
Tags
Return values
void —upgradeSearches()
Upgrade searches.ini.
protected
upgradeSearches() : void
Tags
Return values
void —upgradeSearchSpecs()
Upgrade .yaml configurations.
protected
upgradeSearchSpecs() : void
Tags
Return values
void —upgradeShardSettings()
Upgrade shard settings (they have moved to a different config file, so this is handled as a separate method so that all affected settings are addressed in one place.
protected
upgradeShardSettings() : void
This gets called from updateConfig(), which gets called before other configuration upgrade routines. This means that we need to modify the config.ini settings in the newConfigs property (since it is currently being worked on and will be written to disk shortly), but we need to modify the searches.ini/facets.ini settings in the oldConfigs property (because they have not been processed yet).
Return values
void —upgradeSitemap()
Upgrade sitemap.ini.
protected
upgradeSitemap() : void
Tags
Return values
void —upgradeSms()
Upgrade sms.ini.
protected
upgradeSms() : void
Tags
Return values
void —upgradeSolrMarc()
Upgrade SolrMarc configurations.
protected
upgradeSolrMarc() : void
Tags
Return values
void —upgradeSpellingSettings()
Upgrade spelling settings to account for refactoring of spelling as a recommendation module starting in release 2.4.
protected
upgradeSpellingSettings(string $ini[, array<string|int, mixed> $skip = [] ]) : void
Parameters
- $ini : string
-
.ini file to modify
- $skip : array<string|int, mixed> = []
-
Keys to skip within [TopRecommendations]
Return values
void —upgradeSummon()
Upgrade Summon.ini.
protected
upgradeSummon() : void
Tags
Return values
void —upgradeSummonPermissions()
Translate obsolete permission settings.
protected
upgradeSummonPermissions() : void
Return values
void —upgradeWorldCat()
Upgrade WorldCat.ini.
protected
upgradeWorldCat() : void