UpgradeController
extends AbstractBase
in package
Uses
ConfigPathTrait, SecureDatabaseTrait
Class controls VuFind upgrading.
Tags
Table of Contents
- $accessDeniedBehavior : string
- Behavior when access is denied (used unless overridden through permissionBehavior.ini). Valid values are 'promptLogin' and 'exception'.
- $accessPermission : string|bool|null
- Permission that must be granted to access this module (false for no restriction, null to use configured default (which is usually the same as false)).
- $cookie : Container
- Cookie container
- $logsql : bool
- Are we capturing SQL instead of executing it?
- $serviceLocator : ContainerInterface
- Service manager
- $session : Container
- Session container
- $translator : TranslatorInterface
- Translator
- __construct() : mixed
- Constructor
- captcha() : Captcha
- confirm() : mixed
- Confirm an action.
- confirmdeprecatedcolumnsAction() : mixed
- Prompt the user to confirm removal of deprecated columns.
- criticalFixBlowfishAction() : mixed
- Lead users through the steps required to replace blowfish quickly and easily
- criticalFixInsecureDatabaseAction() : mixed
- Lead users through the steps required to fix an insecure database
- dbUpgrade() : DbUpgrade
- disabledAction() : mixed
- Display disabled message.
- errorAction() : mixed
- Display a fatal error message.
- establishversionsAction() : mixed
- Figure out which version(s) are being used.
- fixanonymoustagsAction() : mixed
- Prompt the user about fixing anonymous tags.
- fixconfigAction() : mixed
- Upgrade the configuration files.
- fixdatabaseAction() : mixed
- Upgrade the database.
- fixduplicatetagsAction() : mixed
- Prompt the user about fixing duplicate tags.
- fixmetadataAction() : mixed
- Fix missing metadata in the resource table.
- flashMessenger() : FlashMessenger
- followup() : Followup
- forceLogin() : mixed
- Redirect the user to the login screen.
- forwardTo() : mixed
- Convenience method to make invocation of forward() helper less verbose.
- getAccessPermission() : string|bool|null
- Getter for access permission (string for required permission name, false for no permission required, null to use default permission).
- getConfig() : Config
- Get a VuFind configuration.
- getdbcredentialsAction() : mixed
- Prompt the user for database credentials.
- getDbService() : T
- Get a database service object.
- getILS() : Connection
- Get the ILS connection.
- getRecordCache() : Cache
- Get the record cache
- getRecordLoader() : Loader
- Get the record loader
- getRecordRouter() : Router
- Get the record router.
- getRequest() : Request
- Get request object
- getSearchMemory() : Memory
- Get the search memory
- getServerUrl() : string
- Get the full URL to one of VuFind's routes.
- getService() : T
- Retrieve a service
- getsourcedirAction() : mixed
- Prompt the user for a source directory (to upgrade from 1.x).
- getsourceversionAction() : mixed
- Prompt the user for a source version (to upgrade from 2.x+).
- getTable() : Gateway
- Get a database table object.
- getTranslator() : TranslatorInterface
- Get translator object.
- getTranslatorLocale() : string
- Get the locale from the translator.
- holds() : Holds
- homeAction() : mixed
- Display summary of installation status
- ILLRequests() : ILLRequests
- ilsRecords() : IlsRecords
- newItems() : NewItems
- permission() : Permission
- renewals() : Renewals
- reserves() : Reserves
- resetAction() : mixed
- Start over with the upgrade process in case of an error.
- resultScroller() : ResultScroller
- setAccessPermission() : void
- Getter for access permission.
- setTranslator() : TranslatorAwareInterface
- Set a translator
- showsqlAction() : mixed
- Prompt the user for database credentials.
- storageRetrievalRequests() : StorageRetrievalRequests
- translate() : string
- Translate a string (or string-castable object)
- translateWithPrefix() : string
- Translate a string (or string-castable object) using a prefix, or without the prefix if a prefixed translation is not found.
- validateAccessPermission() : void
- Use preDispatch event to block access when appropriate.
- validateAutoConfigureConfig() : void
- Use preDispatch event to block access when appropriate.
- attachDefaultListeners() : void
- Register the default events for this controller
- catalogLogin() : bool|array<string|int, mixed>|ViewModel
- Does the user have catalog credentials available? Returns associative array of patron data if so, otherwise forwards to appropriate login prompt and returns false. If there is an ILS exception, a flash message is added and a newly created ViewModel is returned.
- clearFollowupUrl() : void
- Sometimes we need to unset the followup to trigger default behaviors
- commentsEnabled() : bool
- Are comments enabled?
- createEmailViewModel() : ViewModel
- Create a new ViewModel to use as an email form.
- createViewModel() : ViewModel
- Create a new ViewModel.
- criticalCheckForBlowfishEncryption() : string|null
- Check for deprecated and insecure use of blowfish encryption
- criticalCheckForInsecureDatabase() : string|null
- Check for insecure database settings
- disableSessionWrites() : void
- Prevent session writes -- this is designed to be called prior to time- consuming AJAX operations to help reduce the odds of a timing-related bug that causes the wrong version of session data to be written to disk (see VUFIND-716 for more details).
- extractTextDomain() : array<string|int, mixed>
- Given a translation string with or without a text domain, return an array with the raw string and the text domain separated.
- fixInvalidUserIdsInSearchTable() : void
- Support method for fixdatabaseAction() -- clean up invalid user ID values in the search table.
- fixSearchChecksumsInDatabase() : void
- Support method for fixdatabaseAction() -- add checksums to search table rows.
- fixshortlinks() : void
- Generate base62 encoding to migrate old shortlinks
- fixVuFindSourceInDatabase() : void
- Support method for fixdatabaseAction() -- clean up legacy 'VuFind' source values in the database.
- formWasSubmitted() : bool
- Check to see if a form was submitted from its post value Also validate the Captcha, if it's activated
- getAndClearFollowupUrl() : string
- Retrieve a referer to keep post-login redirect pointing to an appropriate location.
- getAuthManager() : Manager
- Get the account manager object.
- getAuthorizationService() : AuthorizationService
- Get the authorization service (note that we're doing this on-demand rather than through injection with the AuthorizationServiceAwareInterface to minimize expensive initialization when authorization is not needed.
- getBaseConfigFilePath() : string
- Get path to base configuration file
- getDebugTranslation() : string
- Build a debug-mode translation
- getForcedLocalConfigPath() : string
- Get path to local configuration file (even if it does not yet exist)
- getILSAuthenticator() : ILSAuthenticator
- Get the ILS authenticator.
- getILSLoginMethod() : string
- What login method does the ILS use (password, email, vufind)
- getILSLoginSettings() : array<string|int, mixed>
- Get settings required for displaying the catalog login form
- getRecordTabManager() : TabManager
- Get the tab configuration for this controller.
- getRefreshResponse() : Response
- Construct an HTTP 205 (refresh) response. Useful for reporting success in the lightbox without actually rendering content.
- getRootDbAdapter() : Adapter
- Get a database adapter for root access using credentials in session.
- getSecureAlgorithmAndKey() : array<string|int, mixed>
- Get an array containing an ILS encryption algorithm and a randomly generated key.
- getSourceDir() : string
- Get the source directory for the upgrade
- getUser() : UserEntityInterface|null
- Get the user object if logged in, false otherwise.
- getViewRenderer() : RendererInterface
- Get the view renderer
- hasDatabaseRootCredentials() : bool
- Do we have root DB credentials stored?
- hasFollowupUrl() : bool
- Checks if a followup url is set
- hasSecureDatabase() : bool
- Does the instance have secure database configuration and contents?
- inLightbox() : bool
- Are we currently in a lightbox context?
- isLocalUrl() : bool
- Is the provided URL local to this instance?
- isSourceDirValid() : bool
- Validate a source directory string.
- listsEnabled() : bool
- Are lists enabled?
- normalizeUrlForComparison() : string
- Normalize the referer URL so that inconsistencies in protocol and trailing slashes do not break comparisons.
- performCriticalChecks() : string|null
- Organize and run critical, blocking checks
- processSkipParam() : void
- Make sure we only skip the actions the user wants us to.
- sanitizeTranslationKey() : string
- Make sure there are not any illegal characters in the translation key that might prevent successful lookup in language files.
- setDbEncodingConfiguration() : void
- Configure the database encoding.
- setFollowupUrlToReferer() : void
- Store a referer (if appropriate) to keep post-login redirect pointing to an appropriate location. This is used when the user clicks the log in link from an arbitrary page or when a password is mistyped; separate logic is used for storing followup information when VuFind forces the user to log in from another context.
- setSourceDir() : void
- Set the source directory for the upgrade
- tagsEnabled() : bool
- Are tags enabled?
- translateString() : string
- Get translation for a string
- upgradeMySQL() : mixed
- Attempt to perform a MySQL upgrade; return either a string containing SQL (if we are in "log SQL" mode), an empty string (if we are successful but not logging SQL) or a Laminas object representing forward/redirect (if we need to obtain user input).
Properties
$accessDeniedBehavior
Behavior when access is denied (used unless overridden through permissionBehavior.ini). Valid values are 'promptLogin' and 'exception'.
protected
string
$accessDeniedBehavior
= null
Leave at null to use the defaultDeniedControllerBehavior set in permissionBehavior.ini (normally 'promptLogin' unless changed).
$accessPermission
Permission that must be granted to access this module (false for no restriction, null to use configured default (which is usually the same as false)).
protected
string|bool|null
$accessPermission
= null
$cookie
Cookie container
protected
Container
$cookie
$logsql
Are we capturing SQL instead of executing it?
protected
bool
$logsql
= false
$serviceLocator
Service manager
protected
ContainerInterface
$serviceLocator
$session
Session container
protected
Container
$session
$translator
Translator
protected
TranslatorInterface
$translator
= null
Methods
__construct()
Constructor
public
__construct(ServiceLocatorInterface $sm, CookieManager $cookieManager, Container $sessionContainer) : mixed
Parameters
- $sm : ServiceLocatorInterface
-
Service manager
- $cookieManager : CookieManager
-
Cookie manager
- $sessionContainer : Container
-
Session container
Return values
mixed —captcha()
public
captcha() : Captcha
Captcha plugin
Return values
Captcha —confirm()
Confirm an action.
public
confirm(string $title, string $yesTarget, string $noTarget[, string|array<string|int, mixed> $messages = [] ][, array<string|int, mixed> $extras = [] ]) : mixed
Parameters
- $title : string
-
Title of confirm dialog
- $yesTarget : string
-
Form target for "confirm" action
- $noTarget : string
-
Form target for "cancel" action
- $messages : string|array<string|int, mixed> = []
-
Info messages for confirm dialog
- $extras : array<string|int, mixed> = []
-
Extra details to include in form
Return values
mixed —confirmdeprecatedcolumnsAction()
Prompt the user to confirm removal of deprecated columns.
public
confirmdeprecatedcolumnsAction() : mixed
Return values
mixed —criticalFixBlowfishAction()
Lead users through the steps required to replace blowfish quickly and easily
public
criticalFixBlowfishAction() : mixed
Return values
mixed —criticalFixInsecureDatabaseAction()
Lead users through the steps required to fix an insecure database
public
criticalFixInsecureDatabaseAction() : mixed
Return values
mixed —dbUpgrade()
public
dbUpgrade() : DbUpgrade
DbUpgrade plugin
Return values
DbUpgrade —disabledAction()
Display disabled message.
public
disabledAction() : mixed
Return values
mixed —errorAction()
Display a fatal error message.
public
errorAction() : mixed
Return values
mixed —establishversionsAction()
Figure out which version(s) are being used.
public
establishversionsAction() : mixed
Tags
Return values
mixed —fixanonymoustagsAction()
Prompt the user about fixing anonymous tags.
public
fixanonymoustagsAction() : mixed
Return values
mixed —fixconfigAction()
Upgrade the configuration files.
public
fixconfigAction() : mixed
Return values
mixed —fixdatabaseAction()
Upgrade the database.
public
fixdatabaseAction() : mixed
Return values
mixed —fixduplicatetagsAction()
Prompt the user about fixing duplicate tags.
public
fixduplicatetagsAction() : mixed
Return values
mixed —fixmetadataAction()
Fix missing metadata in the resource table.
public
fixmetadataAction() : mixed
Tags
Return values
mixed —flashMessenger()
public
flashMessenger() : FlashMessenger
FlashMessenger plugin
Return values
FlashMessenger —followup()
public
followup() : Followup
Followup plugin
Return values
Followup —forceLogin()
Redirect the user to the login screen.
public
forceLogin([string $msg = null ][, array<string|int, mixed> $extras = [] ][, bool $forward = true ]) : mixed
Parameters
- $msg : string = null
-
Flash message to display on login screen
- $extras : array<string|int, mixed> = []
-
Associative array of extra fields to store
- $forward : bool = true
-
True to forward, false to redirect
Return values
mixed —forwardTo()
Convenience method to make invocation of forward() helper less verbose.
public
forwardTo(string $controller, string $action[, array<string|int, mixed> $params = [] ]) : mixed
Parameters
- $controller : string
-
Controller to invoke
- $action : string
-
Action to invoke
- $params : array<string|int, mixed> = []
-
Extra parameters for the RouteMatch object (no need to provide action here, since $action takes care of that)
Return values
mixed —getAccessPermission()
Getter for access permission (string for required permission name, false for no permission required, null to use default permission).
public
getAccessPermission() : string|bool|null
Return values
string|bool|null —getConfig()
Get a VuFind configuration.
public
getConfig([string $id = 'config' ]) : Config
Parameters
- $id : string = 'config'
-
Configuration identifier (default = main VuFind config)
Return values
Config —getdbcredentialsAction()
Prompt the user for database credentials.
public
getdbcredentialsAction() : mixed
Return values
mixed —getDbService()
Get a database service object.
public
getDbService(class-string<\VuFind\Controller\T> $name) : T
Parameters
- $name : class-string<\VuFind\Controller\T>
-
Name of service to retrieve
Tags
Return values
T —getILS()
Get the ILS connection.
public
getILS() : Connection
Return values
Connection —getRecordCache()
Get the record cache
public
getRecordCache() : Cache
Return values
Cache —getRecordLoader()
Get the record loader
public
getRecordLoader() : Loader
Return values
Loader —getRecordRouter()
Get the record router.
public
getRecordRouter() : Router
Return values
Router —getRequest()
Get request object
public
getRequest() : Request
Return values
Request —getSearchMemory()
Get the search memory
public
getSearchMemory() : Memory
Return values
Memory —getServerUrl()
Get the full URL to one of VuFind's routes.
public
getServerUrl([bool|string $route = true ]) : string
Parameters
- $route : bool|string = true
-
Boolean true for current URL, otherwise name of route to render as URL
Return values
string —getService()
Retrieve a service
public
getService(class-string<\VuFind\Service\T> $name) : T
Parameters
- $name : class-string<\VuFind\Service\T>
-
Name of service to retrieve
Tags
Return values
T —getsourcedirAction()
Prompt the user for a source directory (to upgrade from 1.x).
public
getsourcedirAction() : mixed
Return values
mixed —getsourceversionAction()
Prompt the user for a source version (to upgrade from 2.x+).
public
getsourceversionAction() : mixed
Tags
Return values
mixed —getTable()
Get a database table object.
public
getTable(string $table) : Gateway
Parameters
- $table : string
-
Name of table to retrieve
Return values
Gateway —getTranslator()
Get translator object.
public
getTranslator() : TranslatorInterface
Return values
TranslatorInterface —getTranslatorLocale()
Get the locale from the translator.
public
getTranslatorLocale([string $default = 'en' ]) : string
Parameters
- $default : string = 'en'
-
Default to use if translator absent.
Return values
string —holds()
public
holds() : Holds
Holds plugin
Return values
Holds —homeAction()
Display summary of installation status
public
homeAction() : mixed
Return values
mixed —ILLRequests()
public
ILLRequests() : ILLRequests
ILLRequests plugin
Return values
ILLRequests —ilsRecords()
public
ilsRecords() : IlsRecords
IlsRecords plugin
Return values
IlsRecords —newItems()
public
newItems() : NewItems
NewItems plugin
Return values
NewItems —permission()
public
permission() : Permission
Permission plugin
Return values
Permission —renewals()
public
renewals() : Renewals
Renewals plugin
Return values
Renewals —reserves()
public
reserves() : Reserves
Reserves plugin
Return values
Reserves —resetAction()
Start over with the upgrade process in case of an error.
public
resetAction() : mixed
Return values
mixed —resultScroller()
public
resultScroller() : ResultScroller
ResultScroller plugin
Return values
ResultScroller —setAccessPermission()
Getter for access permission.
public
setAccessPermission(string|false $ap) : void
Parameters
- $ap : string|false
-
Permission to require for access to the controller (false for no requirement)
Return values
void —setTranslator()
Set a translator
public
setTranslator(TranslatorInterface $translator) : TranslatorAwareInterface
Parameters
- $translator : TranslatorInterface
-
Translator
Return values
TranslatorAwareInterface —showsqlAction()
Prompt the user for database credentials.
public
showsqlAction() : mixed
Return values
mixed —storageRetrievalRequests()
public
storageRetrievalRequests() : StorageRetrievalRequests
StorageRetrievalRequests plugin
Return values
StorageRetrievalRequests —translate()
Translate a string (or string-castable object)
public
translate(string|object|array<string|int, mixed> $target[, array<string|int, mixed> $tokens = [] ][, string $default = null ][, bool $useIcuFormatter = false ][, array<string|int, string> $fallbackDomains = [] ]) : string
Parameters
- $target : string|object|array<string|int, mixed>
-
String to translate or an array of text domain and string to translate
- $tokens : array<string|int, mixed> = []
-
Tokens to inject into the translated string
- $default : string = null
-
Default value to use if no translation is found (null for no default).
- $useIcuFormatter : bool = false
-
Should we use an ICU message formatter instead of the default behavior?
- $fallbackDomains : array<string|int, string> = []
-
Text domains to check if no match is found in the domain specified in $target
Return values
string —translateWithPrefix()
Translate a string (or string-castable object) using a prefix, or without the prefix if a prefixed translation is not found.
public
translateWithPrefix(string $prefix, string|object|array<string|int, mixed> $target[, array<string|int, mixed> $tokens = [] ][, string $default = null ][, bool $useIcuFormatter = false ][, array<string|int, string> $fallbackDomains = [] ]) : string
Parameters
- $prefix : string
-
Translation key prefix
- $target : string|object|array<string|int, mixed>
-
String to translate or an array of text domain and string to translate
- $tokens : array<string|int, mixed> = []
-
Tokens to inject into the translated string
- $default : string = null
-
Default value to use if no translation is found (null for no default).
- $useIcuFormatter : bool = false
-
Should we use an ICU message formatter instead of the default behavior?
- $fallbackDomains : array<string|int, string> = []
-
Text domains to check if no match is found in the domain specified in $target
Return values
string —validateAccessPermission()
Use preDispatch event to block access when appropriate.
public
validateAccessPermission(MvcEvent $e) : void
Parameters
- $e : MvcEvent
-
Event object
Return values
void —validateAutoConfigureConfig()
Use preDispatch event to block access when appropriate.
public
validateAutoConfigureConfig(MvcEvent $e) : void
Parameters
- $e : MvcEvent
-
Event object
Return values
void —attachDefaultListeners()
Register the default events for this controller
protected
attachDefaultListeners() : void
Return values
void —catalogLogin()
Does the user have catalog credentials available? Returns associative array of patron data if so, otherwise forwards to appropriate login prompt and returns false. If there is an ILS exception, a flash message is added and a newly created ViewModel is returned.
protected
catalogLogin() : bool|array<string|int, mixed>|ViewModel
Return values
bool|array<string|int, mixed>|ViewModel —clearFollowupUrl()
Sometimes we need to unset the followup to trigger default behaviors
protected
clearFollowupUrl() : void
Return values
void —commentsEnabled()
Are comments enabled?
protected
commentsEnabled() : bool
Return values
bool —createEmailViewModel()
Create a new ViewModel to use as an email form.
protected
createEmailViewModel([array<string|int, mixed> $params = null ][, string $defaultSubject = null ]) : ViewModel
Parameters
- $params : array<string|int, mixed> = null
-
Parameters to pass to ViewModel constructor.
- $defaultSubject : string = null
-
Default subject line to use.
Return values
ViewModel —createViewModel()
Create a new ViewModel.
protected
createViewModel([array<string|int, mixed> $params = null ]) : ViewModel
Parameters
- $params : array<string|int, mixed> = null
-
Parameters to pass to ViewModel constructor.
Return values
ViewModel —criticalCheckForBlowfishEncryption()
Check for deprecated and insecure use of blowfish encryption
protected
criticalCheckForBlowfishEncryption() : string|null
Return values
string|null —criticalCheckForInsecureDatabase()
Check for insecure database settings
protected
criticalCheckForInsecureDatabase() : string|null
Return values
string|null —disableSessionWrites()
Prevent session writes -- this is designed to be called prior to time- consuming AJAX operations to help reduce the odds of a timing-related bug that causes the wrong version of session data to be written to disk (see VUFIND-716 for more details).
protected
disableSessionWrites() : void
Return values
void —extractTextDomain()
Given a translation string with or without a text domain, return an array with the raw string and the text domain separated.
protected
extractTextDomain(string|object|array<string|int, mixed> $target) : array<string|int, mixed>
Parameters
- $target : string|object|array<string|int, mixed>
-
String to translate or an array of text domain and string to translate
Return values
array<string|int, mixed> —fixInvalidUserIdsInSearchTable()
Support method for fixdatabaseAction() -- clean up invalid user ID values in the search table.
protected
fixInvalidUserIdsInSearchTable() : void
Return values
void —fixSearchChecksumsInDatabase()
Support method for fixdatabaseAction() -- add checksums to search table rows.
protected
fixSearchChecksumsInDatabase() : void
Return values
void —fixshortlinks()
Generate base62 encoding to migrate old shortlinks
protected
fixshortlinks() : void
Tags
Return values
void —fixVuFindSourceInDatabase()
Support method for fixdatabaseAction() -- clean up legacy 'VuFind' source values in the database.
protected
fixVuFindSourceInDatabase() : void
Return values
void —formWasSubmitted()
Check to see if a form was submitted from its post value Also validate the Captcha, if it's activated
protected
formWasSubmitted([string|array<string|int, string>|null $submitElements = null ][, bool $useCaptcha = false ]) : bool
Parameters
- $submitElements : string|array<string|int, string>|null = null
-
Name of the post field(s) to check to indicate a form submission (or null for default)
- $useCaptcha : bool = false
-
Are we using captcha in this situation?
Return values
bool —getAndClearFollowupUrl()
Retrieve a referer to keep post-login redirect pointing to an appropriate location.
protected
getAndClearFollowupUrl([bool $checkRedirect = false ]) : string
Unset the followup before returning.
Parameters
- $checkRedirect : bool = false
-
Whether the query should be checked for param 'redirect'
Return values
string —getAuthManager()
Get the account manager object.
protected
getAuthManager() : Manager
Return values
Manager —getAuthorizationService()
Get the authorization service (note that we're doing this on-demand rather than through injection with the AuthorizationServiceAwareInterface to minimize expensive initialization when authorization is not needed.
protected
getAuthorizationService() : AuthorizationService
Return values
AuthorizationService —getBaseConfigFilePath()
Get path to base configuration file
protected
getBaseConfigFilePath(string $filename) : string
Parameters
- $filename : string
-
Configuration file name
Return values
string —getDebugTranslation()
Build a debug-mode translation
protected
getDebugTranslation(string $domain, string $str, array<string|int, mixed> $tokens) : string
Parameters
- $domain : string
-
Text domain
- $str : string
-
String to translate
- $tokens : array<string|int, mixed>
-
Tokens to inject into the translated string
Return values
string —getForcedLocalConfigPath()
Get path to local configuration file (even if it does not yet exist)
protected
getForcedLocalConfigPath(string $filename) : string
Parameters
- $filename : string
-
Configuration file name
Return values
string —getILSAuthenticator()
Get the ILS authenticator.
protected
getILSAuthenticator() : ILSAuthenticator
Return values
ILSAuthenticator —getILSLoginMethod()
What login method does the ILS use (password, email, vufind)
protected
getILSLoginMethod([string $target = '' ]) : string
Parameters
- $target : string = ''
-
Login target (MultiILS only)
Return values
string —getILSLoginSettings()
Get settings required for displaying the catalog login form
protected
getILSLoginSettings() : array<string|int, mixed>
Return values
array<string|int, mixed> —getRecordTabManager()
Get the tab configuration for this controller.
protected
getRecordTabManager() : TabManager
Return values
TabManager —getRefreshResponse()
Construct an HTTP 205 (refresh) response. Useful for reporting success in the lightbox without actually rendering content.
protected
getRefreshResponse() : Response
Return values
Response —getRootDbAdapter()
Get a database adapter for root access using credentials in session.
protected
getRootDbAdapter() : Adapter
Return values
Adapter —getSecureAlgorithmAndKey()
Get an array containing an ILS encryption algorithm and a randomly generated key.
protected
getSecureAlgorithmAndKey() : array<string|int, mixed>
Return values
array<string|int, mixed> —getSourceDir()
Get the source directory for the upgrade
protected
getSourceDir([bool $validate = true ]) : string
Parameters
- $validate : bool = true
-
Should we validate the directory?
Return values
string —getUser()
Get the user object if logged in, false otherwise.
protected
getUser() : UserEntityInterface|null
Return values
UserEntityInterface|null —getViewRenderer()
Get the view renderer
protected
getViewRenderer() : RendererInterface
Return values
RendererInterface —hasDatabaseRootCredentials()
Do we have root DB credentials stored?
protected
hasDatabaseRootCredentials() : bool
Return values
bool —hasFollowupUrl()
Checks if a followup url is set
protected
hasFollowupUrl() : bool
Return values
bool —hasSecureDatabase()
Does the instance have secure database configuration and contents?
protected
hasSecureDatabase() : bool
Return values
bool —inLightbox()
Are we currently in a lightbox context?
protected
inLightbox() : bool
Return values
bool —isLocalUrl()
Is the provided URL local to this instance?
protected
isLocalUrl(string $url) : bool
Parameters
- $url : string
-
URL to check
Return values
bool —isSourceDirValid()
Validate a source directory string.
protected
isSourceDirValid(string $dir) : bool
Parameters
- $dir : string
-
Directory string to check
Return values
bool —listsEnabled()
Are lists enabled?
protected
listsEnabled() : bool
Return values
bool —normalizeUrlForComparison()
Normalize the referer URL so that inconsistencies in protocol and trailing slashes do not break comparisons.
protected
normalizeUrlForComparison(string $url) : string
Parameters
- $url : string
-
URL to normalize
Return values
string —performCriticalChecks()
Organize and run critical, blocking checks
protected
performCriticalChecks() : string|null
Return values
string|null —processSkipParam()
Make sure we only skip the actions the user wants us to.
protected
processSkipParam() : void
Return values
void —sanitizeTranslationKey()
Make sure there are not any illegal characters in the translation key that might prevent successful lookup in language files.
protected
sanitizeTranslationKey(string $key) : string
Parameters
- $key : string
-
Key to sanitize
Return values
string —Sanitized key
setDbEncodingConfiguration()
Configure the database encoding.
protected
setDbEncodingConfiguration(string $charset) : void
Parameters
- $charset : string
-
Encoding setting to use.
Tags
Return values
void —setFollowupUrlToReferer()
Store a referer (if appropriate) to keep post-login redirect pointing to an appropriate location. This is used when the user clicks the log in link from an arbitrary page or when a password is mistyped; separate logic is used for storing followup information when VuFind forces the user to log in from another context.
protected
setFollowupUrlToReferer([bool $allowCurrentUrl = true ][, array<string|int, mixed> $extras = [] ]) : void
Parameters
- $allowCurrentUrl : bool = true
-
Whether the current URL is valid for followup
- $extras : array<string|int, mixed> = []
-
Extra data for the followup
Return values
void —setSourceDir()
Set the source directory for the upgrade
protected
setSourceDir(string $dir) : void
Parameters
- $dir : string
-
Directory to set
Return values
void —tagsEnabled()
Are tags enabled?
protected
tagsEnabled() : bool
Return values
bool —translateString()
Get translation for a string
protected
translateString(string $rawStr[, array<string|int, mixed> $tokens = [] ][, string $default = null ][, string $domain = 'default' ][, bool $useIcuFormatter = false ]) : string
Parameters
- $rawStr : string
-
String to translate
- $tokens : array<string|int, mixed> = []
-
Tokens to inject into the translated string
- $default : string = null
-
Default value to use if no translation is found (null for no default).
- $domain : string = 'default'
-
Text domain (omit for default)
- $useIcuFormatter : bool = false
-
Should we use an ICU message formatter instead of the default behavior?
Return values
string —upgradeMySQL()
Attempt to perform a MySQL upgrade; return either a string containing SQL (if we are in "log SQL" mode), an empty string (if we are successful but not logging SQL) or a Laminas object representing forward/redirect (if we need to obtain user input).
protected
upgradeMySQL(Adapter $adapter) : mixed
Parameters
- $adapter : Adapter
-
Database adapter