Upgrade5_0_0B1 extends UpgradeUtil
Upgrades to version 5.0.0-b1
Table of Contents
Properties
| $companies | |
| $navigation_index | |
| $tasks |
Methods
| __construct() | Setup |
| addConfig() | Adds a config setting to the given file |
| editConfig() | Updates a config setting in the given file with the given value |
| errors() | Return all validation errors encountered |
| getEnvironment() | Fetches the current tasks environment |
| mergeConfig() | Extracts all config settings from $file, merges their values into $template and writes the result back in $file. |
| process() | Processes the given task |
| rollback() | Rolls back all tasks completed for the upgrade process |
| setEnvironment() | Set the environment where the task are going to be executed |
| tasks() | Returns a numerically indexed array of tasks to execute for the upgrade process |
| newRecord() | Creates a new database connection |
| replaceConfig() | Replaces a config setting within the context of a string |
| addActionNavigationPagePermissions() | Adds permissions for action and navigation pages |
| addActionsTable() | Adds a new `actions` table |
| addCustomizeSettingsPermission() | Adds a new permission for Customize settings page |
| addEuropeTaxSettings() | Adds the new european tax settings to all system companies |
| addNavigationItemsTable() | Adds a new `navigation_items` table |
| convertCoreNavigation() | Adds to the database all of the current navigation items that used to be supplied by the Navigation model |
| convertExistingCoreActions() | Adds core actions and navigation items |
| convertExistingPluginActions() | Adds plugin actions and navigation items, and removes the `plugin_actions` table |
| convertPluginActions() | Adds actions and navigation items for all the records currently stored in `plugin_actions` |
| deleteFiles() | Deletes all the files and subdirectories of a given directory |
| getAllLanguages() | Retrieves all languages |
| getCoreClientNavItems() | Gets a list of core client navigation item specifications |
| getCoreStaffNavItems() | Gets a list of core staff navigation item specifications |
| insertCoreAction() | Inserts an action and navigation item for the given level |
| insertPluginAction() | Adds an action and navigation item for a plugin_action and each of it's |
| installThemes() | Installs the new default theme |
| migrate2Checkout() | Migrates the data from the older 2Checkout gateway to the new one |
| migrateLogo() | Migrates the logo url from the Themes to Customize |
| removeDeprecatedLibraries() | Removes unused code and deprecated libraries |
| removePackageAndGroupDescriptionsNames() | Remove the `name`, `description`, and `description_html` fields from the `packages` and `package_groups` tables |
| setConfigSessionNames() | Sets config values for the session name and cookie session name |
| updateClientThemes() | Adds the new colors to all client themes |
| updatePaginationConfiguration() | Update pagination configuration |
| updatePluginCardsFields() | Add the text_color column to the plugin_cards table |
Methods
__construct()
Setup
public
__construct() : mixed
addConfig()
Adds a config setting to the given file
public
addConfig(string $file, string $key, mixed $value) : mixed
Parameters
- $file : string
-
The full path to the config file
- $key : string
-
The config setting name
- $value : mixed
-
The config setting value
editConfig()
Updates a config setting in the given file with the given value
public
editConfig(string $file, string $key, mixed $value) : mixed
Parameters
- $file : string
-
The full path to the config file
- $key : string
-
The config setting name
- $value : mixed
-
The config setting value
errors()
Return all validation errors encountered
public
errors() : mixed
Return values
mixed —Boolean false if no errors encountered, an array of errors otherwise
getEnvironment()
Fetches the current tasks environment
public
getEnvironment() : string
Return values
string —The environment where the tasks are running
mergeConfig()
Extracts all config settings from $file, merges their values into $template and writes the result back in $file.
public
mergeConfig(string $file, string $template) : mixed
Parameters
- $file : string
-
The full path to the config
- $template : string
-
The full path to the config template
process()
Processes the given task
public
process(string $task) : mixed
Parameters
- $task : string
-
The task to process
rollback()
Rolls back all tasks completed for the upgrade process
public
rollback() : mixed
setEnvironment()
Set the environment where the task are going to be executed
public
setEnvironment(string $environment) : mixed
Parameters
- $environment : string
-
The environment where the upgrade tasks are running, "install" or "upgrade"
tasks()
Returns a numerically indexed array of tasks to execute for the upgrade process
public
tasks() : array<string|int, mixed>
Return values
array<string|int, mixed> —A numerically indexed array of tasks to execute for the upgrade process
newRecord()
Creates a new database connection
protected
newRecord() : Record
Return values
Record —a new instance of Record
replaceConfig()
Replaces a config setting within the context of a string
protected
replaceConfig(string $key, string $value, string $contents) : string
Parameters
- $key : string
-
The config key to replace the value of
- $value : string
-
The new value
- $contents : string
-
The context in which the $key is set
Return values
string —$contents with the given $value replaced
addActionNavigationPagePermissions()
Adds permissions for action and navigation pages
private
addActionNavigationPagePermissions([bool $undo = false ]) : mixed
Parameters
- $undo : bool = false
-
Whether to add or undo the change
addActionsTable()
Adds a new `actions` table
private
addActionsTable([bool $undo = false ]) : mixed
Parameters
- $undo : bool = false
-
True to undo the change, or false to perform the change
addCustomizeSettingsPermission()
Adds a new permission for Customize settings page
private
addCustomizeSettingsPermission([bool $undo = false ]) : mixed
Parameters
- $undo : bool = false
-
True to undo the change, or false to perform the change
addEuropeTaxSettings()
Adds the new european tax settings to all system companies
private
addEuropeTaxSettings([bool $undo = false ]) : mixed
Parameters
- $undo : bool = false
-
True to undo the change, or false to perform the change
addNavigationItemsTable()
Adds a new `navigation_items` table
private
addNavigationItemsTable([bool $undo = false ]) : mixed
Parameters
- $undo : bool = false
-
True to undo the change, or false to perform the change
convertCoreNavigation()
Adds to the database all of the current navigation items that used to be supplied by the Navigation model
private
convertCoreNavigation() : mixed
convertExistingCoreActions()
Adds core actions and navigation items
private
convertExistingCoreActions([bool $undo = false ]) : mixed
Parameters
- $undo : bool = false
-
True to undo the change, or false to perform the change
convertExistingPluginActions()
Adds plugin actions and navigation items, and removes the `plugin_actions` table
private
convertExistingPluginActions([bool $undo = false ]) : mixed
Parameters
- $undo : bool = false
-
True to undo the change, or false to perform the change
convertPluginActions()
Adds actions and navigation items for all the records currently stored in `plugin_actions`
private
convertPluginActions() : mixed
deleteFiles()
Deletes all the files and subdirectories of a given directory
private
deleteFiles(string $directory) : mixed
Parameters
- $directory : string
-
The directory to delete
getAllLanguages()
Retrieves all languages
private
getAllLanguages() : array<string|int, mixed>
Return values
array<string|int, mixed> —An array of stdClass objects each representing a language in the system
getCoreClientNavItems()
Gets a list of core client navigation item specifications
private
getCoreClientNavItems() : array<string|int, mixed>
Return values
array<string|int, mixed> —A list of primary and secondary navigation items
- primary
-
- name
-
- uri
-
- options
- secondary
-
- name
-
- uri
-
- parent
-
- options
getCoreStaffNavItems()
Gets a list of core staff navigation item specifications
private
getCoreStaffNavItems() : array<string|int, mixed>
Return values
array<string|int, mixed> —A list of primary and secondary navigation items
- primary
-
- name
-
- uri
-
- options
- secondary
-
- name
-
- uri
-
- parent
-
- options
insertCoreAction()
Inserts an action and navigation item for the given level
private
insertCoreAction(array<string|int, mixed> $nav_item, string $location) : mixed
Parameters
- $nav_item : array<string|int, mixed>
-
An array containing the navigation item details
- uri The uri to which this navigation item will link
- name The language key from which the title of this navigation item will be derived
- options A list of addition option for the navigation item (optional)
- parent The URI of the parent navigation item to this one (optional)
- $location : string
-
The location of the navigation and action ('nav_public','nav_client','nav_staff')
insertPluginAction()
Adds an action and navigation item for a plugin_action and each of it's
private
insertPluginAction(array<string|int, mixed> $action) : mixed
Parameters
- $action : array<string|int, mixed>
installThemes()
Installs the new default theme
private
installThemes([bool $undo = false ]) : mixed
Parameters
- $undo : bool = false
-
True to undo the change, or false to perform the change
migrate2Checkout()
Migrates the data from the older 2Checkout gateway to the new one
private
migrate2Checkout([bool $undo = false ]) : mixed
Parameters
- $undo : bool = false
-
True to undo the change, or false to perform the change
migrateLogo()
Migrates the logo url from the Themes to Customize
private
migrateLogo([bool $undo = false ]) : mixed
Parameters
- $undo : bool = false
-
True to undo the change, or false to perform the change
removeDeprecatedLibraries()
Removes unused code and deprecated libraries
private
removeDeprecatedLibraries([bool $undo = false ]) : mixed
Parameters
- $undo : bool = false
-
True to undo the change, or false to perform the change
removePackageAndGroupDescriptionsNames()
Remove the `name`, `description`, and `description_html` fields from the `packages` and `package_groups` tables
private
removePackageAndGroupDescriptionsNames([bool $undo = false ]) : mixed
Parameters
- $undo : bool = false
-
True to undo the change, or false to perform the change
setConfigSessionNames()
Sets config values for the session name and cookie session name
private
setConfigSessionNames([bool $undo = false ]) : mixed
Parameters
- $undo : bool = false
-
True to undo the change, or false to perform the change
updateClientThemes()
Adds the new colors to all client themes
private
updateClientThemes([bool $undo = false ]) : mixed
Parameters
- $undo : bool = false
-
True to undo the change, or false to perform the change
updatePaginationConfiguration()
Update pagination configuration
private
updatePaginationConfiguration([bool $undo = false ]) : mixed
Parameters
- $undo : bool = false
-
True to undo the change, false to perform the change
updatePluginCardsFields()
Add the text_color column to the plugin_cards table
private
updatePluginCardsFields([bool $undo = false ]) : mixed
Parameters
- $undo : bool = false
-
True to undo the change, false to perform the change